diff --git a/build.gradle b/build.gradle index cb711198..7a4020ae 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-v0.9.2-Beta-Pre6" +version = "1.7.10-v0.9.3-Beta-Pre1" group= "com.brandon3055.draconicevolution" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Draconic-Evolution" diff --git a/src/main/java/cofh/api/energy/EnergyStorage.java b/src/main/java/cofh/api/energy/EnergyStorage.java index 591b75d9..d327a48e 100644 --- a/src/main/java/cofh/api/energy/EnergyStorage.java +++ b/src/main/java/cofh/api/energy/EnergyStorage.java @@ -155,4 +155,25 @@ public class EnergyStorage implements IEnergyStorage { return capacity; } + /* Added By Brandon3055 24/07/2014 */ + + public EnergyStorage readFromNBT(NBTTagCompound nbt, String tag) { + + this.energy = nbt.getInteger(tag); + + if (energy > capacity) { + energy = capacity; + } + return this; + } + + public NBTTagCompound writeToNBT(NBTTagCompound nbt, String tag) { + + if (energy < 0) { + energy = 0; + } + nbt.setInteger(tag, energy); + return nbt; + } + } diff --git a/src/main/java/cofh/api/energy/IEnergyStorage.java b/src/main/java/cofh/api/energy/IEnergyStorage.java index 43cfdd42..5ca711ec 100644 --- a/src/main/java/cofh/api/energy/IEnergyStorage.java +++ b/src/main/java/cofh/api/energy/IEnergyStorage.java @@ -1,7 +1,7 @@ package cofh.api.energy; /** - * An energy storage is the unit of interaction with EnergyHelper inventories. + * An energy internalGenBuffer is the unit of interaction with EnergyHelper inventories. * * A reference implementation can be found at {@link EnergyStorage}. * @@ -11,24 +11,24 @@ package cofh.api.energy; public interface IEnergyStorage { /** - * Adds energy to the storage. Returns quantity of energy that was accepted. + * Adds energy to the internalGenBuffer. Returns quantity of energy that was accepted. * * @param maxReceive * Maximum amount of energy to be inserted. * @param simulate * If TRUE, the insertion will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. + * @return Amount of energy that was (or would have been, if simulated) accepted by the internalGenBuffer. */ int receiveEnergy(int maxReceive, boolean simulate); /** - * Removes energy from the storage. Returns quantity of energy that was removed. + * Removes energy from the internalGenBuffer. Returns quantity of energy that was removed. * * @param maxExtract * Maximum amount of energy to be extracted. * @param simulate * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. + * @return Amount of energy that was (or would have been, if simulated) extracted from the internalGenBuffer. */ int extractEnergy(int maxExtract, boolean simulate); diff --git a/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java b/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java index db0946f9..22dab907 100644 --- a/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java +++ b/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java @@ -35,7 +35,7 @@ public class DraconicEvolution { public static final String networkChannelName = "DraconicEvolution"; public static ChannelHandler channelHandler = new ChannelHandler(References.MODID, networkChannelName); //public static FMLEventChannel channel; - public static boolean debug = false; + public static boolean debug = true; public DraconicEvolution() { diff --git a/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGenerator.java b/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGenerator.java new file mode 100644 index 00000000..8e7a88cc --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGenerator.java @@ -0,0 +1,115 @@ +package com.brandon3055.draconicevolution.client.interfaces; + +import cofh.api.energy.IEnergyContainerItem; +import com.brandon3055.draconicevolution.common.container.ContainerGenerator; +import com.brandon3055.draconicevolution.common.core.utills.GuiHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.tileentities.TileGenerator; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; + +@SideOnly(Side.CLIENT) +public class GUIGenerator extends GuiContainer { + + public EntityPlayer player; + private TileGenerator tile; + private int guiUpdateTick; + + public GUIGenerator(InventoryPlayer invPlayer, TileGenerator tile) { + super(new ContainerGenerator(invPlayer, tile)); + + xSize = 176; + ySize = 162; + + this.tile = tile; + this.player = invPlayer.player; + } + + private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/Grinder.png"); + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) + { + GL11.glColor4f(1, 1, 1, 1); + + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box + drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box + if (tile.getStackInSlot(0) == null) + drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box + + float power = (float)tile.getEnergyStored(ForgeDirection.DOWN) / (float)tile.getMaxEnergyStored(ForgeDirection.DOWN) * -1 + 1; + float fuel = tile.burnTimeRemaining / ((float)tile.burnTime) * -1 + 1; + + drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int)(power*40), xSize, 0 + (int)(power*40), 12, 40 - (int)(power*40));//Power bar + drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int)(fuel*13), xSize, 40 + (int)(fuel*13), 18, 18 - (int)(fuel*13));//Power bar + + fontRendererObj.drawStringWithShadow("Generator", guiLeft + 64, guiTop + 0, 0x00FFFF); + + int x = X - guiLeft; + int y = Y - guiTop; + if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) { + ArrayList internal = new ArrayList(); + internal.add("Internal Storage"); + internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP)); + drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj); + } + } + + @Override + protected void drawGuiContainerForegroundLayer(int X, int Y) + { + + int x = X - guiLeft; + int y = Y - guiTop; + /* if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) { + ArrayList internal = new ArrayList(); + internal.add("Internal Storage"); + internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP)); + drawHoveringText(internal, x, y, fontRendererObj); + } +*/ } + + @Override + public void initGui() + { + super.initGui(); + + //ID + //buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text)); + } + + @Override + protected void actionPerformed(GuiButton button) + { + + + } + + @Override + public void updateScreen() + { + guiUpdateTick++; + if (guiUpdateTick >= 10){ + initGui(); + guiUpdateTick = 0; + } + super.updateScreen(); + + } + + // ####Draw at############ read from size + //drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38); +} diff --git a/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGrinder.java b/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGrinder.java index a2c1372c..05f7d201 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGrinder.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GUIGrinder.java @@ -1,12 +1,15 @@ package com.brandon3055.draconicevolution.client.interfaces; +import com.brandon3055.draconicevolution.common.core.utills.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; @@ -15,6 +18,8 @@ import com.brandon3055.draconicevolution.common.container.ContainerGrinder; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.TileGrinder; +import java.util.ArrayList; + @SideOnly(Side.CLIENT) public class GUIGrinder extends GuiContainer { @@ -35,23 +40,44 @@ public class GUIGrinder extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/Grinder.png"); @Override - protected void drawGuiContainerBackgroundLayer(float f, int x, int y) - { + protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) { GL11.glColor4f(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box + if (!tile.isExternallyPowered()) + drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box - if (tile.getStackInSlot(0) == null) + if (tile.getStackInSlot(0) == null && !tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box - - float power = tile.energy / 5000f * -1 + 1; + + float power; + if (tile.isExternallyPowered()){ + power = (float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) * -1 + 1; + }else { + power = (float) tile.getInternalBuffer().getEnergyStored() / (float) tile.getInternalBuffer().getMaxEnergyStored() * -1 + 1; + } float fuel = tile.burnTimeRemaining / ((float)tile.burnTime) * -1 + 1; drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int)(power*40), xSize, 0 + (int)(power*40), 12, 40 - (int)(power*40));//Power bar drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int)(fuel*13), xSize, 40 + (int)(fuel*13), 18, 18 - (int)(fuel*13));//Power bar - + if (tile.isExternallyPowered()) + drawTexturedModalRect(guiLeft + 100, guiTop + 37, xSize, 66, 13, 13); + + fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop + 0, 0x00FFFF); + + int x = X - guiLeft; + int y = Y - guiTop; + if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) { + ArrayList internal = new ArrayList(); + internal.add("Energy Buffer"); + if (tile.isExternallyPowered()) { + internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP)); + } else { + internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getInternalBuffer().getEnergyStored() + "/" + tile.getInternalBuffer().getMaxEnergyStored()); + } + drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj); + } } @Override diff --git a/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GuiHandler.java b/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GuiHandler.java index 18a6c870..71e53a4b 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GuiHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/interfaces/GuiHandler.java @@ -12,7 +12,7 @@ import com.brandon3055.draconicevolution.common.core.utills.InventoryReader; public class GuiHandler implements IGuiHandler { - public static final int GUIID_WEATHER_CONTROLLER = 0; + public static final int GUIID_WEATHER_CONTROLLER = 0; public static final int GUIID_SUN_DIAL = 1; public static final int GUIID_GRINDER = 2; public static final int GUIID_TELEPORTER = 3; @@ -20,91 +20,101 @@ public class GuiHandler implements IGuiHandler { public static final int GUIID_PARTICLEGEN = 5; public static final int GUIID_PLAYERDETECTOR = 6; public static final int GUIID_ENERGY_INFUSER = 7; - + public static final int GUIID_GENERATOR = 8; + public GuiHandler() { NetworkRegistry.INSTANCE.registerGuiHandler(DraconicEvolution.instance, this); } @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { - case GUIID_WEATHER_CONTROLLER: - TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileWeatherController) { - return new ContainerWeatherController(player.inventory, (TileWeatherController) te); - } - break; - case GUIID_SUN_DIAL: - TileEntity te1 = world.getTileEntity(x, y, z); - if (te1 != null && te1 instanceof TileSunDial) { - return new ContainerSunDial(player.inventory, (TileSunDial) te1); - } - break; - case GUIID_GRINDER: - TileEntity te2 = world.getTileEntity(x, y, z); - if (te2 != null && te2 instanceof TileGrinder) { - return new ContainerGrinder(player.inventory, (TileGrinder) te2); - } - break; - case GUIID_READER: - return new ContainerReader(player.inventory, new InventoryReader(player)); - case GUIID_PLAYERDETECTOR: - TileEntity detector = world.getTileEntity(x, y, z); - if (detector != null && detector instanceof TilePlayerDetectorAdvanced) { - return new ContainerPlayerDetector(player.inventory, (TilePlayerDetectorAdvanced) detector); - } - break; - case GUIID_ENERGY_INFUSER: - TileEntity infuser = world.getTileEntity(x, y, z); - if (infuser != null && infuser instanceof TileEnergyInfuser) { - return new ContainerEnergyInfuser(player.inventory, (TileEnergyInfuser) infuser); + case GUIID_WEATHER_CONTROLLER: + TileEntity te = world.getTileEntity(x, y, z); + if (te != null && te instanceof TileWeatherController) { + return new ContainerWeatherController(player.inventory, (TileWeatherController) te); + } + break; + case GUIID_SUN_DIAL: + TileEntity te1 = world.getTileEntity(x, y, z); + if (te1 != null && te1 instanceof TileSunDial) { + return new ContainerSunDial(player.inventory, (TileSunDial) te1); + } + break; + case GUIID_GRINDER: + TileEntity te2 = world.getTileEntity(x, y, z); + if (te2 != null && te2 instanceof TileGrinder) { + return new ContainerGrinder(player.inventory, (TileGrinder) te2); + } + break; + case GUIID_READER: + return new ContainerReader(player.inventory, new InventoryReader(player)); + case GUIID_PLAYERDETECTOR: + TileEntity detector = world.getTileEntity(x, y, z); + if (detector != null && detector instanceof TilePlayerDetectorAdvanced) { + return new ContainerPlayerDetector(player.inventory, (TilePlayerDetectorAdvanced) detector); + } + break; + case GUIID_ENERGY_INFUSER: + TileEntity infuser = world.getTileEntity(x, y, z); + if (infuser != null && infuser instanceof TileEnergyInfuser) { + return new ContainerEnergyInfuser(player.inventory, (TileEnergyInfuser) infuser); + } + break; + case GUIID_GENERATOR: + TileEntity generator = world.getTileEntity(x, y, z); + if (generator != null && generator instanceof TileGenerator) { + return new ContainerGenerator(player.inventory, (TileGenerator) generator); + } + break; } - break; - } return null; } @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { - case GUIID_WEATHER_CONTROLLER: - TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileWeatherController) { - return new GUIWeatherController(player.inventory, (TileWeatherController) te); - } - break; - case GUIID_SUN_DIAL: - TileEntity te1 = world.getTileEntity(x, y, z); - if (te1 != null && te1 instanceof TileSunDial) { - return new GUISunDial(player.inventory, (TileSunDial) te1); - } - break; - case GUIID_TELEPORTER: - return new GUITeleporter(player); - case GUIID_GRINDER: - TileEntity te2 = world.getTileEntity(x, y, z); - if (te2 != null && te2 instanceof TileGrinder) { - return new GUIGrinder(player.inventory, (TileGrinder) te2); - } - break; - case GUIID_READER: - return new GUIReader(player.inventory, new InventoryReader(player)); - case GUIID_PARTICLEGEN: - TileEntity gen = world.getTileEntity(x, y, z); - return (gen != null && gen instanceof TileParticleGenerator) ? new GUIParticleGenerator((TileParticleGenerator)gen, player) : null; - case GUIID_PLAYERDETECTOR: - TileEntity detector = world.getTileEntity(x, y, z); - if (detector != null && detector instanceof TilePlayerDetectorAdvanced) { - return new GUIPlayerDetector(player.inventory, (TilePlayerDetectorAdvanced) detector); - } - case GUIID_ENERGY_INFUSER: - TileEntity infuser = world.getTileEntity(x, y, z); - if (infuser != null && infuser instanceof TileEnergyInfuser) { - return new GUIEnergyInfuser(player.inventory, (TileEnergyInfuser) infuser); - } + case GUIID_WEATHER_CONTROLLER: + TileEntity te = world.getTileEntity(x, y, z); + if (te != null && te instanceof TileWeatherController) { + return new GUIWeatherController(player.inventory, (TileWeatherController) te); + } + break; + case GUIID_SUN_DIAL: + TileEntity te1 = world.getTileEntity(x, y, z); + if (te1 != null && te1 instanceof TileSunDial) { + return new GUISunDial(player.inventory, (TileSunDial) te1); + } + break; + case GUIID_TELEPORTER: + return new GUITeleporter(player); + case GUIID_GRINDER: + TileEntity te2 = world.getTileEntity(x, y, z); + if (te2 != null && te2 instanceof TileGrinder) { + return new GUIGrinder(player.inventory, (TileGrinder) te2); + } + break; + case GUIID_READER: + return new GUIReader(player.inventory, new InventoryReader(player)); + case GUIID_PARTICLEGEN: + TileEntity gen = world.getTileEntity(x, y, z); + return (gen != null && gen instanceof TileParticleGenerator) ? new GUIParticleGenerator((TileParticleGenerator) gen, player) : null; + case GUIID_PLAYERDETECTOR: + TileEntity detector = world.getTileEntity(x, y, z); + if (detector != null && detector instanceof TilePlayerDetectorAdvanced) { + return new GUIPlayerDetector(player.inventory, (TilePlayerDetectorAdvanced) detector); + } + case GUIID_ENERGY_INFUSER: + TileEntity infuser = world.getTileEntity(x, y, z); + if (infuser != null && infuser instanceof TileEnergyInfuser) { + return new GUIEnergyInfuser(player.inventory, (TileEnergyInfuser) infuser); + } + case GUIID_GENERATOR: + TileEntity generator = world.getTileEntity(x, y, z); + if (generator != null && generator instanceof TileGenerator) { + return new GUIGenerator(player.inventory, (TileGenerator) generator); + } } return null; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/CustonSpawnerRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/CustonSpawnerRenderer.java index dd990f7a..def6af23 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/CustonSpawnerRenderer.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/CustonSpawnerRenderer.java @@ -71,6 +71,16 @@ public class CustonSpawnerRenderer extends TileEntitySpecialRenderer tessellator.addVertexWithUV(1, 0.99D, 1, 1, 1); tessellator.addVertexWithUV(1, 0.99D, 0, 0, 1); + tessellator.addVertexWithUV(0, 0.01D, 0, 0, 0); + tessellator.addVertexWithUV(1, 0.01D, 0, 1, 0); + tessellator.addVertexWithUV(1, 0.01D, 1, 1, 1); + tessellator.addVertexWithUV(0, 0.01D, 1, 0, 1); + + tessellator.addVertexWithUV(0, 0.01D, 0, 0, 0); + tessellator.addVertexWithUV(0, 0.01D, 1, 1, 0); + tessellator.addVertexWithUV(1, 0.01D, 1, 1, 1); + tessellator.addVertexWithUV(1, 0.01D, 0, 0, 1); + tessellator.draw(); GL11.glPopMatrix(); diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyParticle.java b/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyParticle.java index 0a7dcf59..c9023b31 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyParticle.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/EnergyParticle.java @@ -71,7 +71,7 @@ public class EnergyParticle extends EntityFX { setDead(); } moveEntity(motionX, motionY, motionZ);// also important if you want your particle to move - float speedMultiplyer = 0.0501F; + float speedMultiplyer = 0.000501F; float ySpeedMultiplyer = 0.1006F; if (expand) { motionX = motionX + (targetX - posX) * speedMultiplyer; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/SoulItemRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/SoulItemRenderer.java index f6a8409f..89fbcf59 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/SoulItemRenderer.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/SoulItemRenderer.java @@ -47,23 +47,21 @@ public class SoulItemRenderer implements IItemRenderer { Entity mob = EntityList.createEntityByName(ItemNBTHelper.getString(item, "Name", "Pig"), mc.theWorld); GL11.glPushMatrix(); - //GL11.glEnable(GL11.GL_BLEND); + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glScalef(0.5F, 0.5F, 0.5F); - //GL11.glColor4f(1F, 1F, 1F, 0.5F); if (type == ItemRenderType.INVENTORY) { GL11.glPushMatrix(); - //RenderHelper.enableStandardItemLighting(); GL11.glScalef(13F, 13F, 13F); GL11.glTranslated(1.2, 2.2, 0); GL11.glRotatef(180F, 1F, 0F, 0F); GL11.glRotatef(mc.getSystemTime() / -10, 0F, 1F, 0F); GL11.glRotatef(-20F, 1F, 0F, 0F); RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F); - //RenderHelper.disableStandardItemLighting(); GL11.glPopMatrix(); - } else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) + } + else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) { GL11.glPushMatrix(); GL11.glScalef(0.8F, 0.8F, 0.8F); @@ -73,7 +71,8 @@ public class SoulItemRenderer implements IItemRenderer { GL11.glRotatef(-20F, 1F, 0F, 0F); RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F); GL11.glPopMatrix(); - } else if (type == ItemRenderType.EQUIPPED) + } + else if (type == ItemRenderType.EQUIPPED) { GL11.glPushMatrix(); GL11.glScalef(0.8F, 0.8F, 0.8F); @@ -83,19 +82,18 @@ public class SoulItemRenderer implements IItemRenderer { GL11.glRotatef(-20F, 1F, 0F, 0F); RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F); GL11.glPopMatrix(); - - } else + } + else { GL11.glPushMatrix(); GL11.glScalef(1.5F, 1.5F, 1.5F); GL11.glRotatef(mc.getSystemTime() / -10, 0F, 1F, 0F); GL11.glRotatef(-20F, 1F, 0F, 0F); - RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 0F); + RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F); GL11.glPopMatrix(); - } - //GL11.glDisable(GL11.GL_BLEND); + GL11.glPopAttrib(); GL11.glPopMatrix(); } diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java b/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java new file mode 100644 index 00000000..59f294da --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/TestBlockRenderer.java @@ -0,0 +1,63 @@ +package com.brandon3055.draconicevolution.client.render; + +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.tileentities.TileTestBlock; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; +import org.lwjgl.opengl.GL11; + +/** + * Created by Brandon on 24/07/2014. + */ +public class TestBlockRenderer extends TileEntitySpecialRenderer { + + private static final ResourceLocation iner_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png"); + private static final ResourceLocation outer_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.png"); + private IModelCustom iner_model; + private IModelCustom outer_model; + + public TestBlockRenderer() + { + iner_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj")); + outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_2.obj")); + } + + @Override + public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float var8) + { + GL11.glPushMatrix(); + + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 100, (float) 100); + + GL11.glTranslated(x+0.5, y+0.5, z+0.5); + + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture); + + GL11.glPushMatrix(); + GL11.glRotatef(((TileTestBlock)var1).modelRotation, 0F, 1F, 0.5F); + GL11.glColor4f(2F, 2F, 2F, 1F); + iner_model.renderAll(); + GL11.glPopMatrix(); + + GL11.glScalef(1.1F, 1.1F, 1.1F); + + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_BLEND); + GL11.glRotatef(((TileTestBlock)var1).modelRotation*0.5F, 0F, -1F, -0.5F); + GL11.glColor4f(0.5F, 2F, 2F, 0.7F); + outer_model.renderAll(); + GL11.glDisable(GL11.GL_BLEND); + + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/Generator.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/Generator.java new file mode 100644 index 00000000..e1d7c2f3 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/Generator.java @@ -0,0 +1,314 @@ +package com.brandon3055.draconicevolution.common.blocks; + +import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.client.interfaces.GuiHandler; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.lib.Strings; +import com.brandon3055.draconicevolution.common.tileentities.TileGenerator; +import com.brandon3055.draconicevolution.common.tileentities.TileGrinder; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.List; +import java.util.Random; + +/** + * Created by Brandon on 23/07/2014. + */ +public class Generator extends BlockContainer { + + public IIcon icon_front; + public IIcon icon_side; + public IIcon icon_back; + public IIcon icon_back_inactive; + public IIcon icon_front_inactive; + public IIcon icon_top[] = new IIcon[4]; + + protected Generator() { + super(Material.rock); + this.setBlockName(Strings.generatorName); + this.setCreativeTab(DraconicEvolution.getCreativeTab(2)); + this.setStepSound(soundTypeStone); + this.setHardness(1f); + this.setResistance(2000.0f); + GameRegistry.registerBlock(this, this.getUnlocalizedName()); + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister iconRegister) + { + icon_front = iconRegister.registerIcon(References.RESOURCESPREFIX + "animated/generator_front_active"); + icon_front_inactive = iconRegister.registerIcon(References.RESOURCESPREFIX + "generator_front"); + icon_side = iconRegister.registerIcon(References.RESOURCESPREFIX + "machine_side"); + icon_back = iconRegister.registerIcon(References.RESOURCESPREFIX + "animated/machine_fan"); + icon_back_inactive = iconRegister.registerIcon(References.RESOURCESPREFIX + "machine_fan"); + for (int i = 0; i < 4; i++) + { + icon_top[i] = iconRegister.registerIcon(References.RESOURCESPREFIX + "machine_top_" + i); + } + + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(final Item item, final CreativeTabs tab, final List par3list) + { + par3list.add(new ItemStack(item, 1, 3)); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + TileGenerator tile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileGenerator) ? (TileGenerator) world.getTileEntity(x, y, z) : null; + if (tile == null) + { + LogHelper.error("Missing Tile Entity (Generator)"); + return 0; + } + return tile.burnTimeRemaining > 0 && tile.getEnergyStored(ForgeDirection.UP) < tile.getMaxEnergyStored(ForgeDirection.UP) ? 13 : 0; + } + + @Override + public int damageDropped(int p_149692_1_) + { + return 3; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) + { + TileGenerator tile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileGenerator) ? (TileGenerator) world.getTileEntity(x, y, z) : null; + if (tile == null) + { + LogHelper.error("Missing Tile Entity (Generator)"); + return null; + } + int meta = world.getBlockMetadata(x, y, z); + + IIcon back; + IIcon front; + + if (tile.burnTimeRemaining > 0 && tile.getEnergyStored(ForgeDirection.UP) < tile.getMaxEnergyStored(ForgeDirection.UP)) + { + back = icon_back; + front = icon_front; + } + else + { + back = icon_back_inactive; + front = icon_front_inactive; + } + + switch (side) + { + case 0: + return icon_side; + case 1: + return icon_top[meta]; + case 2: + if (meta == 0) + return front; + else if (meta == 2) + return back; + else + return icon_side; + case 3: + if (meta == 2) + return front; + else if (meta == 0) + return back; + else + return icon_side; + case 4: + if (meta == 3) + return front; + else if (meta == 1) + return back; + else + return icon_side; + case 5: + if (meta == 1) + return front; + else if (meta == 3) + return back; + else + return icon_side; + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (side) + { + case 0: + return icon_side; + case 1: + return icon_top[meta]; + case 2: + if (meta == 0) + return icon_front; + else if (meta == 2) + return icon_back; + else + return icon_side; + case 3: + if (meta == 2) + return icon_front; + else if (meta == 0) + return icon_back; + else + return icon_side; + case 4: + if (meta == 3) + return icon_front; + else if (meta == 1) + return icon_back; + else + return icon_side; + case 5: + if (meta == 1) + return icon_front; + else if (meta == 3) + return icon_back; + else + return icon_side; + } + return null; + } + + @Override + public TileEntity createNewTileEntity(World var1, int var2) + { + return new TileGenerator(); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float prx, float pry, float prz) + { + if (!world.isRemote) { + FMLNetworkHandler.openGui(player, DraconicEvolution.instance, GuiHandler.GUIID_GENERATOR, world, x, y, z); + } + return true; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack stack) + { + int l = MathHelper.floor_double((double) (placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + if (l == 0) + { + world.setBlockMetadataWithNotify(x, y, z, 0, 2); + } + + if (l == 1) + { + world.setBlockMetadataWithNotify(x, y, z, 1, 2); + } + + if (l == 2) + { + world.setBlockMetadataWithNotify(x, y, z, 2, 2); + } + + if (l == 3) + { + world.setBlockMetadataWithNotify(x, y, z, 3, 2); + } + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) + { + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TileGrinder) + { + ((TileGrinder)tile).disabled = world.isBlockIndirectlyGettingPowered(x, y, z); + world.markBlockForUpdate(x, y, z); + } + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) + { + TileEntity te = world.getTileEntity(x, y, z); + if (te != null && te instanceof IInventory) { + IInventory inventory = (IInventory) te; + + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack stack = inventory.getStackInSlot(i); + + if (stack != null) { + float spawnX = x + world.rand.nextFloat(); + float spawnY = y + world.rand.nextFloat(); + float spawnZ = z + world.rand.nextFloat(); + + EntityItem droppedItem = new EntityItem(world, spawnX, spawnY, spawnZ, stack); + + float mult = 0.05F; + + droppedItem.motionX = (-0.5F + world.rand.nextFloat()) * mult; + droppedItem.motionY = (4 + world.rand.nextFloat()) * mult; + droppedItem.motionZ = (-0.5F + world.rand.nextFloat()) * mult; + + world.spawnEntityInWorld(droppedItem); + } + } + } + + super.breakBlock(world, x, y, z, block, meta); + } + + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) { + TileGenerator tile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileGenerator) ? (TileGenerator) world.getTileEntity(x, y, z) : null; + if (tile == null) + { + LogHelper.error("Missing Tile Entity (Generator)"); + return; + } + if(tile.burnTimeRemaining > 0 && tile.getEnergyStored(ForgeDirection.UP) < tile.getMaxEnergyStored(ForgeDirection.UP)) + { + double ox = 0; + double oz = 0; + if (world.getBlockMetadata(x, y, z) == 0) + oz = -0.5; + if (world.getBlockMetadata(x, y, z) == 1) + ox = 0.5; + if (world.getBlockMetadata(x, y, z) == 2) + oz = 0.5; + if (world.getBlockMetadata(x, y, z) == 3) + ox = -0.5; + + world.spawnParticle("flame", ox + x + 0.5 + (Math.abs(ox)-0.5) * ((random.nextDouble() - 0.5)*1), y + 0.3 + (random.nextDouble() * 0.5), oz + z + 0.5 + (Math.abs(oz)-0.5) * ((random.nextDouble() - 0.5)*1), (ox*0.05)*random.nextDouble(), (random.nextDouble() - 0.2)*0.03, (oz*0.05)*random.nextDouble()); + world.spawnParticle("smoke", ox + x + 0.5 + (Math.abs(ox)-0.5) * ((random.nextDouble() - 0.5)*1), y + 0.3 + (random.nextDouble() * 0.5), oz + z + 0.5 + (Math.abs(oz)-0.5) * ((random.nextDouble() - 0.5)*1), (ox*0.05)*random.nextDouble(), (random.nextDouble() - 0.2)*0.03, (oz*0.05)*random.nextDouble()); + + world.playSound((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), "fire.fire", 0.2F + (random.nextFloat()*0.1F), random.nextFloat() * 0.7F + 0.5F, false); + } + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/Grinder.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/Grinder.java index a0763eef..952028a2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/Grinder.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/Grinder.java @@ -88,7 +88,7 @@ public class Grinder extends BlockContainer IIcon back; IIcon front; - if (!tile.disabled && tile.energy >= 50) + if (!tile.disabled && tile.getActiveBuffer().getEnergyStored() >= tile.energyPerKill) { back = icon_back; front = icon_front; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/LRDItemBlock.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/LRDItemBlock.java new file mode 100644 index 00000000..90601feb --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/LRDItemBlock.java @@ -0,0 +1,30 @@ +package com.brandon3055.draconicevolution.common.blocks; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +import java.util.List; + +/** + * Created by Brandon on 23/06/2014. + */ +public class LRDItemBlock extends ItemBlock { + public LRDItemBlock(Block block) { + super(block); + setHasSubtypes(true); + } + + @Override + public int getMetadata(int par1) { + return par1; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName(stack) + stack.getItemDamage(); + } + +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/LongRangeDislocator.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/LongRangeDislocator.java new file mode 100644 index 00000000..1647caf5 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/LongRangeDislocator.java @@ -0,0 +1,154 @@ +package com.brandon3055.draconicevolution.common.blocks; + +import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.common.core.handler.ConfigHandler; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.lib.References; +import com.brandon3055.draconicevolution.common.lib.Strings; +import com.brandon3055.draconicevolution.common.tileentities.TileLRD; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +import java.util.List; +import java.util.Random; + +/** + * Created by Brandon on 20/07/2014. + */ +public class LongRangeDislocator extends DraconicEvolutionBlock { + + IIcon blockIconTop; + + public LongRangeDislocator() { + this.setBlockName(Strings.longRangeDislocatorName); + this.setCreativeTab(DraconicEvolution.getCreativeTab(2)); + this.setHardness(5f); + this.setResistance(20.0f); + GameRegistry.registerBlock(this, LRDItemBlock.class, this.getUnlocalizedName()); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister iconRegister) + { + blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "teteporter_front"); + blockIconTop = iconRegister.registerIcon(References.RESOURCESPREFIX + "machine_top_0"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int side, final int meta) + { + if (side == 0 || side == 1) + return blockIconTop; + else + return blockIcon; + } + + @Override + public void getSubBlocks(Item item, CreativeTabs p_149666_2_, List list) { + //list.add(new ItemStack(item, 1, 0)); + list.add(new ItemStack(item, 1, 1)); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + int meta = world.getBlockMetadata(x,y,z); + if (meta == 0) + return false;//return teleportPlayer(world, player, false); + else if (meta == 1) + return false; + else{ + LogHelper.error("Invalid LRT Metadata"); + return false; + } + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { + EntityPlayer player; + if (world.getBlockMetadata(x, y, z) == 1 && world.isBlockIndirectlyGettingPowered(x, y, z)) + { + player = world.getClosestPlayer(x, y, z, ConfigHandler.admin_dislocator_Detect_Range); + if (player != null) + { + teleportPlayer(world, player, true); + } + } + } + + private boolean teleportPlayer(World world, EntityPlayer player, boolean admin){ + if (world.isRemote) return true; + Random rand = new Random(); + + if (admin) + { + int randX = ConfigHandler.admin_dislocator_Min_Range + rand.nextInt(ConfigHandler.admin_dislocator_Max_Range - ConfigHandler.admin_dislocator_Min_Range); + int randZ = ConfigHandler.admin_dislocator_Min_Range + rand.nextInt(ConfigHandler.admin_dislocator_Max_Range - ConfigHandler.admin_dislocator_Min_Range); + randX = rand.nextBoolean() ? randX * -1 : randX * 1; + randZ = rand.nextBoolean() ? randZ * -1 : randZ * 1; + randX += (int)player.posX; + randZ += (int)player.posZ; + int y = 255; + for (int i = 255; i > 1; i--) + { + if (world.getBlock(randX, i, randZ) != Blocks.air) + { + //LogHelper.info(world.getBlock(randX, i, randZ)); + y = i; + break; + } + } + + if (world.getBlock(randX, y, randZ).isBlockSolid(world, randX, y, randZ, 0)) + { + world.setBlock(randX, y, randZ, world.getBlock(randX, y, randZ)); + player.setLocationAndAngles(randX + 0.5, y + 1.5, randZ + 0.5, 0F, 0F); + player.setPositionAndUpdate(randX + 0.5, y + 1.5, randZ + 0.5); + }else{ + world.setBlock(randX, y, randZ, Blocks.stone); + player.setLocationAndAngles(randX + 0.5, y + 1.5, randZ + 0.5, 0F, 0F); + player.setPositionAndUpdate(randX + 0.5, y + 1.5, randZ + 0.5); + } + + return true; + }else{ + int randX = ConfigHandler.dislocator_Min_Range + rand.nextInt(ConfigHandler.dislocator_Max_Range - ConfigHandler.dislocator_Min_Range); + int randZ = ConfigHandler.dislocator_Min_Range + rand.nextInt(ConfigHandler.dislocator_Max_Range - ConfigHandler.dislocator_Min_Range); + randX = rand.nextBoolean() ? randX * -1 : randX * 1; + randZ = rand.nextBoolean() ? randZ * -1 : randZ * 1; + int y = 255; + for (int i = 255; i > 1; i--) + { + if (world.getBlock(randX, i, randZ) != Blocks.air) + { + //LogHelper.info(world.getBlock(randX, i, randZ)); + y = i; + break; + } + } + + if (world.getBlock(randX, y, randZ).isBlockSolid(world, randX, y, randZ, 0)) + { + world.setBlock(randX, y, randZ, world.getBlock(randX, y, randZ)); + player.setLocationAndAngles(randX + 0.5, y + 1.5, randZ + 0.5, 0F, 0F); + player.setPositionAndUpdate(randX + 0.5, y + 1.5, randZ + 0.5); + }else{ + world.setBlock(randX, y, randZ, Blocks.stone); + player.setLocationAndAngles(randX + 0.5, y + 1.5, randZ + 0.5, 0F, 0F); + player.setPositionAndUpdate(randX + 0.5, y + 1.5, randZ + 0.5); + } + } + return true; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java index 3f4d68d5..54309d92 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java @@ -19,6 +19,8 @@ public class ModBlocks { public static Block playerDetectorAdvanced; public static Block energyInfuser; public static Block customSpawner; + public static Block longRangeDislocator; + public static Block generator; public static void init() { @@ -34,6 +36,8 @@ public class ModBlocks { playerDetectorAdvanced = new PlayerDetectorAdvanced(); energyInfuser = new EnergyInfuser(); customSpawner = new CustomSpawner(); + generator = new Generator(); + if(ConfigHandler.disable_LRD < 2) longRangeDislocator = new LongRangeDislocator(); if(DraconicEvolution.debug) testBlock = new TestBlock(); //testBlock = new TestBlock(); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/TestBlock.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/TestBlock.java index 400bc45d..f5736b88 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/TestBlock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/TestBlock.java @@ -15,6 +15,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -33,10 +34,17 @@ public class TestBlock extends DraconicEvolutionBlock { } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) - { - return super.getCollisionBoundingBoxFromPool( p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); - //return null; + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return null; + //return super.getIcon(p_149673_1_, p_149673_2_, p_149673_3_, p_149673_4_, p_149673_5_); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return null; + //return super.getIcon(p_149691_1_, p_149691_2_); } @Override @@ -110,4 +118,24 @@ public class TestBlock extends DraconicEvolutionBlock { { } + + @Override + public int getRenderType() { + return super.getRenderType(); + } + + @Override + public boolean shouldSideBeRendered(IBlockAccess world, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return true; + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + return 0; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGenerator.java b/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGenerator.java new file mode 100644 index 00000000..112e91fd --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGenerator.java @@ -0,0 +1,84 @@ +package com.brandon3055.draconicevolution.common.container; + +import com.brandon3055.draconicevolution.client.interfaces.SlotItemValid; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import com.brandon3055.draconicevolution.common.tileentities.TileGenerator; +import com.brandon3055.draconicevolution.common.tileentities.TileGrinder; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerGenerator extends Container { + + private TileGenerator tile; + private int cachSize = -1; + + public ContainerGenerator(InventoryPlayer invPlayer, TileGenerator tile) { + this.tile = tile; + + for (int x = 0; x < 9; x++) { + addSlotToContainer(new Slot(invPlayer, x, 8 + 18 * x, 138)); + } + + for (int y = 0; y < 3; y++) { + for (int x = 0; x < 9; x++) { + addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + 18 * x, 80 + y * 18)); + } + } + + addSlotToContainer(new SlotItemValid(tile, 0, 64, 35, true)); + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { + return tile.isUseableByPlayer(player); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int i) + { + Slot slot = getSlot(i); + + if (slot != null && slot.getHasStack()) + { + ItemStack stack = slot.getStack(); + ItemStack result = stack.copy(); + + if (i >= 36){ + if (!mergeItemStack(stack, 0, 36, false)){ + return null; + } + }else if (TileGenerator.getItemBurnTime(stack) == 0 || !mergeItemStack(stack, 36, 36 + tile.getSizeInventory(), false)){ + return null; + } + + if (stack.stackSize == 0) { + slot.putStack(null); + }else{ + slot.onSlotChanged(); + } + + slot.onPickupFromSlot(player, stack); + + return result; + } + + return null; + } + + @Override + public void detectAndSendChanges() { + ItemStack stack = tile.getStackInSlot(0); + int size = stack == null ? 0 : stack.stackSize; + if (cachSize != size) { + cachSize = size; + tile.tryRefuel(); + tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + } + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGrinder.java b/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGrinder.java index aac95793..c29653cd 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGrinder.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerGrinder.java @@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack; public class ContainerGrinder extends Container { + private int cachSize = -1; private TileGrinder tile; public ContainerGrinder(InventoryPlayer invPlayer, TileGrinder tile) { @@ -25,8 +26,11 @@ public class ContainerGrinder extends Container { addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + 18 * x, 80 + y * 18)); } } - - addSlotToContainer(new SlotItemValid(tile, 0, 64, 35, true)); + if (!tile.isExternallyPowered()) + addSlotToContainer(new SlotItemValid(tile, 0, 64, 35, true)); + else + addSlotToContainer(new SlotItemValid(tile, 0, -10000, -10000, true)); + } @Override @@ -68,7 +72,14 @@ public class ContainerGrinder extends Container { return null; } - public TileGrinder getTileWC(){ - return tile; + @Override + public void detectAndSendChanges() { + ItemStack stack = tile.getStackInSlot(0); + int size = stack == null ? 0 : stack.stackSize; + if (cachSize != size) { + cachSize = size; + tile.tryRefuel(); + tile.getWorldObj().markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + } } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/CustomTeleporter.java b/src/main/java/com/brandon3055/draconicevolution/common/core/Teleporter/CustomTeleporter.java similarity index 93% rename from src/main/java/com/brandon3055/draconicevolution/common/core/utills/CustomTeleporter.java rename to src/main/java/com/brandon3055/draconicevolution/common/core/Teleporter/CustomTeleporter.java index 2e7a301a..30c37219 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/CustomTeleporter.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/Teleporter/CustomTeleporter.java @@ -1,4 +1,4 @@ -package com.brandon3055.draconicevolution.common.core.utills; +package com.brandon3055.draconicevolution.common.core.Teleporter; import net.minecraft.entity.Entity; import net.minecraft.world.Teleporter; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Teleporter.java b/src/main/java/com/brandon3055/draconicevolution/common/core/Teleporter/Teleporter.java similarity index 51% rename from src/main/java/com/brandon3055/draconicevolution/common/core/utills/Teleporter.java rename to src/main/java/com/brandon3055/draconicevolution/common/core/Teleporter/Teleporter.java index dec9afab..3a0311e0 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Teleporter.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/Teleporter/Teleporter.java @@ -1,4 +1,4 @@ -package com.brandon3055.draconicevolution.common.core.utills; +package com.brandon3055.draconicevolution.common.core.Teleporter; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -27,4 +27,25 @@ public class Teleporter } } } + + public static void teleport(EntityPlayer player, double x, double y, double z) + { + if (player instanceof EntityPlayerMP) + { + EntityPlayerMP thePlayer = (EntityPlayerMP) player; + + if (thePlayer.dimension == 1) + { + if (thePlayer.isRiding()) + thePlayer.dismountEntity(thePlayer.ridingEntity); + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, thePlayer.dimension, new CustomTeleporter(thePlayer.mcServer.worldServerForDimension(thePlayer.dimension), x, y, z, 0, 0)); + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, thePlayer.dimension, new CustomTeleporter(thePlayer.mcServer.worldServerForDimension(thePlayer.dimension), x, y, z, 0, 0)); + } else + { + if (thePlayer.isRiding()) + thePlayer.dismountEntity(thePlayer.ridingEntity); + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, thePlayer.dimension, new CustomTeleporter(thePlayer.mcServer.worldServerForDimension(thePlayer.dimension), x, y, z, 0, 0)); + } + } + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ConfigHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ConfigHandler.java index 9093b958..4ea199ef 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ConfigHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/handler/ConfigHandler.java @@ -2,7 +2,6 @@ package com.brandon3055.draconicevolution.common.core.handler; import java.io.File; -import com.brandon3055.draconicevolution.DraconicEvolution; import net.minecraftforge.common.config.Configuration; public class ConfigHandler { @@ -14,6 +13,12 @@ public class ConfigHandler { public static String[] spawnerList; public static boolean spawnerListType; public static int soulDropChance; + public static int dislocator_Min_Range; + public static int dislocator_Max_Range; + public static int admin_dislocator_Min_Range; + public static int admin_dislocator_Max_Range; + public static int admin_dislocator_Detect_Range; + public static int disable_LRD; private static String[] defaultList = new String[] {"ExampleMob1", "ExampleMob2", "ExampleMob3 (these examples can be deleted)"}; @@ -24,13 +29,20 @@ public class ConfigHandler { try { config.load(); - disableSunDial = config.get(Configuration.CATEGORY_GENERAL, "disableSunDial", 0, "Disable Sun Dial 0:Default, 1:Disable recipe, 2:Disable completely").getInt(0); - disableXrayBlock = config.get(Configuration.CATEGORY_GENERAL, "disableXrayBlock", 0, "Disable Distortion Flame 0:Default, 1:Disable recipe, 2:Disable completely").getInt(0); - teleporterUsesPerPearl = config.get(Configuration.CATEGORY_GENERAL, "teleporterUsesPerPearl", 10, "Charm of Dislocation uses per Ender pearl").getInt(10); - bowBlockDamage = config.get(Configuration.CATEGORY_GENERAL, "bowBlockDamage", true, "Dose Draconic bow explosion damage blocks").getBoolean(true); + disableSunDial = config.get(Configuration.CATEGORY_GENERAL, "Disable Sun Dial", 0, "Disable Sun Dial 0:Default, 1:Disable recipe, 2:Disable completely").getInt(0); + disableXrayBlock = config.get(Configuration.CATEGORY_GENERAL, "Disable Xray Block", 0, "Disable Distortion Flame 0:Default, 1:Disable recipe, 2:Disable completely").getInt(0); + teleporterUsesPerPearl = config.get(Configuration.CATEGORY_GENERAL, "Teleporter Uses PerPearl", 10, "Charm of Dislocation uses per Ender pearl").getInt(10); + bowBlockDamage = config.get(Configuration.CATEGORY_GENERAL, "Bow Block Damage", true, "Dose Draconic bow explosion damage blocks").getBoolean(true); spawnerListType = config.get("Spawner", "listType", false, "Sets weather the spawner list is a white list or a black list (true = white list false = black list)").getBoolean(false); spawnerList = config.getStringList("Spawn List", "Spawner", defaultList, "List of names that will be ether accepted or rejected by the spawner depending on the list type"); soulDropChance = config.get("Spawner", "soulDropChance", 1000, "Mobs have a 1 in this number chance to drop a soul", 1, Integer.MAX_VALUE).getInt(1000); + + //dislocator_Min_Range = config.get("Long Range Dislocator", "Admin Dislocator Min Range", 1000000).getInt(1000000); + //dislocator_Max_Range = config.get("Long Range Dislocator", "Admin Dislocator Max Range", 29000000).getInt(29000000); + admin_dislocator_Min_Range = config.get("Long Range Dislocator", "Dislocator Min Range", 1000).getInt(1000); + admin_dislocator_Max_Range = config.get("Long Range Dislocator", "Dislocator Max Range", 10000).getInt(10000); + admin_dislocator_Detect_Range = config.get("Long Range Dislocator", "Admin Dislocator Detect Range", 5).getInt(5); + disable_LRD = config.get("Long Range Dislocator", "Disable Dislocator", 0, "Disable Long Range Dislocator 0:Default, 1:Disable recipe, 2:Disable completely (Includes Admin Dislocator)").getInt(0); } catch (Exception e) { //DraconicEvolution.logger.error("Unable to load Config"); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/handler/CraftingHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/core/handler/CraftingHandler.java index 8f24a4a6..0b5f77a8 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/handler/CraftingHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/handler/CraftingHandler.java @@ -66,6 +66,9 @@ public class CraftingHandler { CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.rainSensor), " ", "RBR", "SPS", 'R', Items.redstone, 'B', Items.bucket, 'S', Blocks.stone_slab, 'P', Blocks.heavy_weighted_pressure_plate); CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.particleGenerator), "RBR", "BCB", "RBR", 'R', Blocks.redstone_block, 'B', Items.blaze_rod, 'C', ModItems.draconicCore); CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.playerDetector), "ITI", "CEC", "IDI", 'I', Items.iron_ingot, 'E', Items.ender_eye, 'T', Blocks.redstone_torch, 'C', Items.comparator, 'D', ModItems.draconicCore); + CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.playerDetectorAdvanced), "ISI", "EDE", "ICI", 'I', ModItems.draconiumIngot, 'E', Items.ender_eye, 'S', new ItemStack(Items.skull, 1, 1), 'C', Items.compass, 'D', ModBlocks.playerDetector); + CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.generator, 1, 3), "NIN", "IFI", "NCN", 'N', Items.netherbrick, 'I', Items.iron_ingot, 'F', Blocks.furnace, 'C', ModItems.draconicCore); + CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.energyInfuser), "IPI", "CEC", "IDI", 'I', ModItems.draconiumIngot, 'P', ModBlocks.particleGenerator, 'C', ModItems.draconicCore, 'D', ModItems.infusedCompound, 'E', Blocks.enchanting_table); if(ConfigHandler.disableSunDial == 0) CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.sunDial), "IFI", "TDT", "GEG", 'I', ModItems.draconiumIngot, 'F', ModItems.sunFocus, 'T', ModItems.draconicCore, 'G', Blocks.glowstone, 'E', Blocks.enchanting_table, 'D', ModItems.dragonHeart); @@ -85,7 +88,7 @@ public class CraftingHandler { } /* -//turns dirt into enchanted diamond sword! +//turns dirt into enchanted diamond sword ItemStack manipulation = new ItemStack(Items.diamond_sword); manipulation.addEnchantment(Enchantment.efficiency, 2); CraftingManager.getInstance().addShapelessRecipe(manipulation, Blocks.dirt); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java index 818c7964..933b67ca 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/ClientProxy.java @@ -3,6 +3,7 @@ package com.brandon3055.draconicevolution.common.core.proxy; import com.brandon3055.draconicevolution.client.render.*; import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner; import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser; +import com.brandon3055.draconicevolution.common.tileentities.TileTestBlock; import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.Item; @@ -63,5 +64,8 @@ public class ClientProxy extends CommonProxy { render = new CustonSpawnerRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileCustomSpawner.class, render); + + render = new TestBlockRenderer(); + ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, render); } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java index e84be694..6eaef21f 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/proxy/CommonProxy.java @@ -3,9 +3,11 @@ package com.brandon3055.draconicevolution.common.core.proxy; import com.brandon3055.draconicevolution.common.core.handler.MinecraftForgeEventHandler; import com.brandon3055.draconicevolution.common.core.network.*; import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon; +import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.*; import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator; import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -59,6 +61,7 @@ public class CommonProxy { GameRegistry.registerTileEntity(TilePlayerDetectorAdvanced.class, "TilePlayerDetectorAdvanced"); GameRegistry.registerTileEntity(TileEnergyInfuser.class, "TileEnergyInfuser"); GameRegistry.registerTileEntity(TileCustomSpawner.class, "TileCustomSpawner"); + GameRegistry.registerTileEntity(TileGenerator.class, "TileGenerator"); if(DraconicEvolution.debug) GameRegistry.registerTileEntity(TileTestBlock.class, "TileTestBlock"); } @@ -95,8 +98,8 @@ public class CommonProxy { } public void registerEntitys(){ - int dragonID = EntityRegistry.findGlobalUniqueEntityId(); - int cyan = (0 << 16) + (255 << 8) + 255; - EntityRegistry.registerGlobalEntityID(EntityCustomDragon.class, "enderDragon", dragonID, cyan, 0); + //int cyan = (0 << 16) + (255 << 8) + 255; + //EntityRegistry.registerGlobalEntityID(EntityCustomDragon.class, References.RESOURCESPREFIX + "EnderDragon", EntityRegistry.findGlobalUniqueEntityId(), cyan, 0); + EntityRegistry.registerModEntity(EntityCustomDragon.class, References.RESOURCESPREFIX + "EnderDragon", 0, DraconicEvolution.instance, 200, 3, true); } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/LogHelper.java b/src/main/java/com/brandon3055/draconicevolution/common/core/utills/LogHelper.java index e1ea510e..bdeb78d6 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/core/utills/LogHelper.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/core/utills/LogHelper.java @@ -12,7 +12,7 @@ public class LogHelper { public static void log(Level logLevel, Object object) { - FMLLog.log(logLevel, "Draconic Evolution", String.valueOf(object)); + FMLLog.log(References.MODNAME, logLevel, String.valueOf(object)); } public static void all(Object object){ log(Level.ALL, object); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java b/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java index e8a73f4c..d57a2532 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java @@ -1,11 +1,13 @@ package com.brandon3055.draconicevolution.common.items; +import cofh.api.energy.EnergyStorage; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.blocks.ModBlocks; import com.brandon3055.draconicevolution.common.lib.Strings; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -21,6 +23,8 @@ public class DraconicCore extends DraconicEvolutionItem { @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(StatCollector.translateToLocal("info.draconicCore.txt")); + par3List.add(""); + par3List.add("" + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("info.draconicCore1.txt")); } @Override diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java b/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java index 2548f3e8..c0580935 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java @@ -2,9 +2,18 @@ package com.brandon3055.draconicevolution.common.items; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.core.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; import com.brandon3055.draconicevolution.common.lib.Strings; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import java.util.List; @@ -20,6 +29,36 @@ public class MobSoul extends DraconicEvolutionItem { @Override public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) { String name = ItemNBTHelper.getString(stack, "Name", "Pig"); - list.add(name); + list.add("" + EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul1.txt")); + list.add("" + EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul2.txt")); + list.add("" + EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul3.txt")); + list.add("" + EnumChatFormatting.DARK_PURPLE + name); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (!player.isSneaking()) return false; + String name = ItemNBTHelper.getString(stack, "Name", "Pig"); + Entity entity = EntityList.createEntityByName(name, world); + double sX = x + ForgeDirection.getOrientation(side).offsetX + 0.5; + double sY = y + ForgeDirection.getOrientation(side).offsetY + 0.5; + double sZ = z + ForgeDirection.getOrientation(side).offsetZ + 0.5; + entity.setLocationAndAngles(sX, sY, sZ, player.rotationYaw, 0F); + + if (entity instanceof EntityLivingBase && !world.isRemote) { + ((EntityLiving) entity).onSpawnWithEgg((IEntityLivingData) null); + world.spawnEntityInWorld(entity); + if (!player.capabilities.isCreativeMode) + { + stack.stackSize--; + } + } + return true; } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java index cd37d455..03cebf83 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java @@ -22,7 +22,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.core.utills.ItemNBTHelper; -import com.brandon3055.draconicevolution.common.core.utills.Teleporter; +import com.brandon3055.draconicevolution.common.core.Teleporter.Teleporter; import com.brandon3055.draconicevolution.common.items.ModItems; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.Strings; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java index f72853e8..b64cb2be 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java @@ -22,7 +22,7 @@ import cpw.mods.fml.relauncher.SideOnly; import com.brandon3055.draconicevolution.client.interfaces.GuiHandler; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.core.utills.ItemNBTHelper; -import com.brandon3055.draconicevolution.common.core.utills.Teleporter; +import com.brandon3055.draconicevolution.common.core.Teleporter.Teleporter; import com.brandon3055.draconicevolution.common.items.ModItems; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.Strings; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/lib/References.java b/src/main/java/com/brandon3055/draconicevolution/common/lib/References.java index eab0753b..5c170dca 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/lib/References.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/lib/References.java @@ -3,7 +3,7 @@ package com.brandon3055.draconicevolution.common.lib; public class References { public static final String MODID = "DraconicEvolution"; public static final String MODNAME = "Draconic Evolution"; - public static final String VERSION = "0.9.1-Beta"; + public static final String VERSION = "0.9.2-Beta"; public static final String MCVERSION = "1.7.10"; public static final String CLIENTPROXYLOCATION = "com.brandon3055.draconicevolution.common.core.proxy.ClientProxy"; public static final String COMMONPROXYLOCATION = "com.brandon3055.draconicevolution.common.core.proxy.CommonProxy"; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java b/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java index 5004814b..d884d0fa 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/lib/Strings.java @@ -45,4 +45,6 @@ public class Strings {// public sta public static final String wyvernBootsName = "wyvernBoots"; public static final String customSpawnerName = "customSpawner"; public static final String MobSoulName = "mobSoul"; + public static final String longRangeDislocatorName = "longRangeDislocator"; + public static final String generatorName = "generator"; } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGenerator.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGenerator.java new file mode 100644 index 00000000..03945cf0 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGenerator.java @@ -0,0 +1,282 @@ +package com.brandon3055.draconicevolution.common.tileentities; + +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyHandler; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.*; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.List; + +import static net.minecraftforge.common.util.ForgeDirection.UP; + +public class TileGenerator extends TileEntity implements ISidedInventory, IEnergyHandler { + //########### variables #############// + private ItemStack[] items; + public int burnTime = 1; + public int burnTimeRemaining = 0; + private int burnSpeed = 6; + /** + * Energy per burn tick + */ + private int EPBT = 14; + protected EnergyStorage storage = new EnergyStorage(100000, 0, 1000); + + //##################################// + + public TileGenerator() { + items = new ItemStack[1]; + } + + @Override + public void updateEntity() { + if (burnTimeRemaining > 0 && storage.getEnergyStored() < storage.getMaxEnergyStored()) { + burnTimeRemaining -= burnSpeed; + storage.setEnergyStored(storage.getEnergyStored() + Math.min(burnSpeed * EPBT, storage.getMaxEnergyStored() - storage.getEnergyStored())); + } else if (burnTimeRemaining <= 0) tryRefuel(); + + if ((storage.getEnergyStored() > 0)) { + for (int i = 0; i < 6; i++){ + TileEntity tile = worldObj.getTileEntity(xCoord + ForgeDirection.getOrientation(i).offsetX, yCoord + ForgeDirection.getOrientation(i).offsetY, zCoord + ForgeDirection.getOrientation(i).offsetZ); + if (tile != null && tile instanceof IEnergyHandler) { + storage.extractEnergy(((IEnergyHandler)tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), storage.extractEnergy(storage.getMaxExtract(), true), false), false); + } + } + } + } + + public void tryRefuel() { + if (burnTimeRemaining > 0 || storage.getEnergyStored() >= storage.getMaxEnergyStored()) return; + if (items[0] != null && items[0].stackSize > 0) { + int itemBurnTime = getItemBurnTime(items[0]); + + if (itemBurnTime > 0) { + decrStackSize(0, 1); + burnTime = itemBurnTime; + burnTimeRemaining = itemBurnTime; + //LogHelper.info(itemBurnTime); + } + } + } + + public static int getItemBurnTime(ItemStack stack) { + if (stack == null) { + return 0; + } else { + Item item = stack.getItem(); + + if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) { + Block block = Block.getBlockFromItem(item); + + if (block == Blocks.wooden_slab) { + return 150; + } + + if (block.getMaterial() == Material.wood) { + return 300; + } + + if (block == Blocks.coal_block) { + return 16000; + } + } + + if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200; + if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200; + if (item instanceof ItemHoe && ((ItemHoe) item).getToolMaterialName().equals("WOOD")) return 200; + if (item == Items.stick) return 100; + if (item == Items.coal) return 1600; + if (item == Items.lava_bucket) return 20000; + if (item == Item.getItemFromBlock(Blocks.sapling)) return 100; + if (item == Items.blaze_rod) return 2400; + return GameRegistry.getFuelValue(stack); + } + } + + @Override + public int getSizeInventory() { + return items.length; + } + + @Override + public ItemStack getStackInSlot(int i) { + return items[i]; + } + + @Override + public ItemStack decrStackSize(int i, int count) { + ItemStack itemstack = getStackInSlot(i); + + if (itemstack != null) { + if (itemstack.stackSize <= count) { + setInventorySlotContents(i, null); + } else { + itemstack = itemstack.splitStack(count); + if (itemstack.stackSize == 0) { + setInventorySlotContents(i, null); + } + } + } + return itemstack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + ItemStack item = getStackInSlot(i); + if (item != null) setInventorySlotContents(i, null); + return item; + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items[i] = itemstack; + if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { + itemstack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return ""; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.4) < 64; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack) { + return getItemBurnTime(stack) > 0; + } + + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + return new int[1]; + } + + @Override + public boolean canInsertItem(int var1, ItemStack var2, int var3) { + return true; + } + + @Override + public boolean canExtractItem(int var1, ItemStack var2, int var3) { + return false; + } + + @Override + public void writeToNBT(NBTTagCompound compound) { + NBTTagCompound[] tag = new NBTTagCompound[items.length]; + + for (int i = 0; i < items.length; i++) { + tag[i] = new NBTTagCompound(); + + if (items[i] != null) { + tag[i] = items[i].writeToNBT(tag[i]); + } + + compound.setTag("Item" + i, tag[i]); + } + + compound.setInteger("BurnTime", burnTime); + compound.setInteger("BurnTimeRemaining", burnTimeRemaining); + storage.writeToNBT(compound); + + super.writeToNBT(compound); + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + NBTTagCompound[] tag = new NBTTagCompound[items.length]; + + for (int i = 0; i < items.length; i++) { + tag[i] = compound.getCompoundTag("Item" + i); + items[i] = ItemStack.loadItemStackFromNBT(tag[i]); + } + + burnTime = compound.getInteger("BurnTime"); + burnTimeRemaining = compound.getInteger("BurnTimeRemaining"); + storage.readFromNBT(compound); + + super.readFromNBT(compound); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound tagCompound = new NBTTagCompound(); + writeToNBT(tagCompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tagCompound); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + /* IEnergyHandler */ + @Override + public boolean canConnectEnergy(ForgeDirection from) { + return true; + } + + @Override + public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { + + return storage.receiveEnergy(maxReceive, simulate); + } + + @Override + public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return storage.extractEnergy(maxExtract, simulate); + } + + @Override + public int getEnergyStored(ForgeDirection from) { + return storage.getEnergyStored(); + } + + @Override + public int getMaxEnergyStored(ForgeDirection from) { + return storage.getMaxEnergyStored(); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGrinder.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGrinder.java index 0d776a50..c67928db 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGrinder.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileGrinder.java @@ -2,6 +2,8 @@ package com.brandon3055.draconicevolution.common.tileentities; import java.util.List; +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyHandler; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -27,23 +29,27 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraftforge.common.util.ForgeDirection; -public class TileGrinder extends TileEntity implements ISidedInventory { +public class TileGrinder extends TileEntity implements ISidedInventory, IEnergyHandler { //########### variables #############// public int meta = -1; List killList; AxisAlignedBB killBox; int tick = 0; - int updateTick = 0; double centreX; double centreY = -1; double centreZ; private ItemStack[] items; - public int energy = 0; public int burnTime = 1; public int burnTimeRemaining = 0; public boolean disabled = false; private boolean readyNext = false; + protected EnergyStorage internalGenBuffer = new EnergyStorage(20000, 32000, 0); + protected EnergyStorage externalInputBuffer = new EnergyStorage(100000, 32000, 0); + public int energyPerKill = 1000; + private int burnSpeed = 2; + private int EPBT = 10; public void updateVariables() { if (meta == -1) meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); @@ -72,13 +78,6 @@ public class TileGrinder extends TileEntity implements ISidedInventory { break; } } - - if (burnTimeRemaining > 0) { - burnTimeRemaining -= 2; - energy += 2; - if (burnTimeRemaining < 0) burnTimeRemaining = 0; - } - if (energy > 5000) energy = 5000; } //##################################// @@ -88,22 +87,28 @@ public class TileGrinder extends TileEntity implements ISidedInventory { @Override public void updateEntity() { - if ((burnTimeRemaining == 1 || (burnTimeRemaining == 0 && updateTick == 20)) && !disabled && energy < 2500) { - updateVariables(); - tryRefuel(); - } else updateVariables(); + updateVariables(); - if (!worldObj.isRemote && updateTick >= 50 && readyNext && !disabled && energy >= 100) { - if (killNextEntity()) { - energy -= 100; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if (burnTimeRemaining > 0 && internalGenBuffer.getEnergyStored() < internalGenBuffer.getMaxEnergyStored()) { + burnTimeRemaining -= burnSpeed; + internalGenBuffer.setEnergyStored(internalGenBuffer.getEnergyStored() + Math.min(burnSpeed * EPBT, internalGenBuffer.getMaxEnergyStored() - internalGenBuffer.getEnergyStored())); + } else if (burnTimeRemaining <= 0) tryRefuel(); + + if ((internalGenBuffer.getEnergyStored() > 0)) { + for (int i = 0; i < 6; i++){ + TileEntity tile = worldObj.getTileEntity(xCoord + ForgeDirection.getOrientation(i).offsetX, yCoord + ForgeDirection.getOrientation(i).offsetY, zCoord + ForgeDirection.getOrientation(i).offsetZ); + if (tile != null && tile instanceof IEnergyHandler) { + internalGenBuffer.extractEnergy(((IEnergyHandler) tile).receiveEnergy(ForgeDirection.getOrientation(i).getOpposite(), internalGenBuffer.extractEnergy(internalGenBuffer.getMaxExtract(), true), false), false); + } } } - if (updateTick >= 50) { - updateTick = 0; + if (!worldObj.isRemote && readyNext && !disabled && getActiveBuffer().getEnergyStored() >= energyPerKill) { + if (killNextEntity()) { + getActiveBuffer().modifyEnergyStored(-energyPerKill); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } } - if (!disabled) updateTick += worldObj.rand.nextInt(10); if (tick >= 100) { tick = 0; @@ -113,11 +118,21 @@ public class TileGrinder extends TileEntity implements ISidedInventory { } else tick++; } + public EnergyStorage getActiveBuffer(){ + return isExternallyPowered() ? externalInputBuffer : internalGenBuffer; + } + public void checkSignal() { disabled = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); } - private void tryRefuel() { + public boolean isExternallyPowered() + { + return externalInputBuffer.getEnergyStored() > energyPerKill; + } + + public void tryRefuel() { + if (burnTimeRemaining > 0 || internalGenBuffer.getEnergyStored() >= internalGenBuffer.getMaxEnergyStored()) return; if (items[0] != null && items[0].stackSize > 0) { int itemBurnTime = getItemBurnTime(items[0]); @@ -139,7 +154,7 @@ public class TileGrinder extends TileEntity implements ISidedInventory { if (mob instanceof EntityCreature) { if (((EntityCreature) mob).isEntityAlive()) { ((EntityCreature) mob).attackEntityFrom(DamageSource.magic, 50000F); - dropXP(mob); + if (worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) dropXP(mob); readyNext = true; if (mob instanceof EntitySkeleton) { if (((EntitySkeleton) mob).getSkeletonType() == 1) { @@ -155,7 +170,7 @@ public class TileGrinder extends TileEntity implements ISidedInventory { } else if (mob instanceof EntityLiving) { if (((EntityLiving) mob).isEntityAlive()) { ((EntityLiving) mob).attackEntityFrom(DamageSource.magic, 50000F); - dropXP(mob); + if (worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) dropXP(mob); readyNext = true; return true; } @@ -312,10 +327,11 @@ public class TileGrinder extends TileEntity implements ISidedInventory { compound.setTag("Item" + i, tag[i]); } - compound.setInteger("EnergyHelper", energy); compound.setBoolean("Disabled", disabled); compound.setInteger("BurnTime", burnTime); compound.setInteger("BurnTimeRemaining", burnTimeRemaining); + externalInputBuffer.writeToNBT(compound, "ExternalBuffer"); + internalGenBuffer.writeToNBT(compound, "InternalBuffer"); super.writeToNBT(compound); } @@ -329,10 +345,11 @@ public class TileGrinder extends TileEntity implements ISidedInventory { items[i] = ItemStack.loadItemStackFromNBT(tag[i]); } - energy = compound.getInteger("EnergyHelper"); disabled = compound.getBoolean("Disabled"); burnTime = compound.getInteger("BurnTime"); burnTimeRemaining = compound.getInteger("BurnTimeRemaining"); + externalInputBuffer.readFromNBT(compound, "ExternalBuffer"); + internalGenBuffer.readFromNBT(compound, "InternalBuffer"); super.readFromNBT(compound); } @@ -350,4 +367,35 @@ public class TileGrinder extends TileEntity implements ISidedInventory { worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } + /* IEnergyHandler */ + @Override + public boolean canConnectEnergy(ForgeDirection from) { + return true; + } + + @Override + public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { + + return externalInputBuffer.receiveEnergy(maxReceive, simulate); + } + + @Override + public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return externalInputBuffer.extractEnergy(maxExtract, simulate); + } + + @Override + public int getEnergyStored(ForgeDirection from) { + return externalInputBuffer.getEnergyStored(); + } + + @Override + public int getMaxEnergyStored(ForgeDirection from) { + return externalInputBuffer.getMaxEnergyStored(); + } + + public EnergyStorage getInternalBuffer(){ + return internalGenBuffer; + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileLRD.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileLRD.java new file mode 100644 index 00000000..d9b99b0b --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileLRD.java @@ -0,0 +1,9 @@ +package com.brandon3055.draconicevolution.common.tileentities; + +import net.minecraft.tileentity.TileEntity; + +/** + * Created by Brandon on 21/07/2014. + */ +public class TileLRD extends TileEntity { +} diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java index 22e6a715..201d4812 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java @@ -8,6 +8,7 @@ import static net.minecraftforge.common.util.ForgeDirection.UP; import static net.minecraftforge.common.util.ForgeDirection.WEST; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyHandler; +import com.brandon3055.draconicevolution.common.core.utills.LogHelper; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; @@ -17,12 +18,20 @@ import net.minecraftforge.common.util.ForgeDirection; public class TileTestBlock extends TileEntity implements IEnergyHandler { public EnergyStorage energy = new EnergyStorage(100000000); public int maxInput = 100000000; + public float modelRotation; @Override public void updateEntity() { + + if (worldObj.isRemote) modelRotation += 0.5; + + //LogHelper.info(modelRotation); + + + int test = 4; - if (!worldObj.isRemote) - System.out.println(energy.getEnergyStored()); + //if (!worldObj.isRemote) + //System.out.println(energy.getEnergyStored()); if ((this.energy.getEnergyStored() > 0)) { diff --git a/src/main/resources/assets/draconicevolution/lang/en_US.lang b/src/main/resources/assets/draconicevolution/lang/en_US.lang index b648401c..ad949617 100644 --- a/src/main/resources/assets/draconicevolution/lang/en_US.lang +++ b/src/main/resources/assets/draconicevolution/lang/en_US.lang @@ -1,11 +1,4 @@ -################################# -###Tolkien addon language file### -################################# -#Chat formatting is done here -#All other formatting is internal -################################# - -//###################################Blocks###################################// +//###################################Block Names###################################// tile.xRayBlock.name=Distortion Flame tile.sunDial.name=Sun Dial tile.weatherController.name=Weather Controller @@ -17,9 +10,10 @@ tile.particleGenerator.name=Particle Generator tile.playerDetector.name=Player Detector tile.playerDetectorAdvanced.name=Advanced Player Detector tile.energyInfuser.name=Energy Infuser -Tile.customSpawner.name=Stabilized Monster Spawner - -msg.range.txt=Range: +tile.customSpawner.name=Stabilized Mob Spawner +tile.longRangeDislocator1.name=Admin Dislocator +tile.longRangeDislocator0.name=Long Range Dislocator +tile.generator.name=Generator //###################################Item names###################################// item.draconicCompound.name=Draconic Compound @@ -32,52 +26,9 @@ item.sunFocus.name=Solar Focus item.tclogo.name=TCLogo item.draconicCore.name=Draconic Core item.reader.name=WIP -item.wyvernChestPlate.name=WIP - -//###################################Item Groups###################################// -itemGroup.toolsAndWeapons=Draconic Evolution Tools & Weapons -itemGroup.blocksAndItems=Draconic Evolution Blocks & Items - -//###################################Tool modes###################################// -msg.size0.txt=Tool Mode: Single Block -msg.size1.txt=Tool Mode: 3x3 -msg.size2.txt=Tool Mode: 5x5 -msg.size3.txt=Tool Mode: 7x7 -msg.size4.txt=Tool Mode: 9x9 -msg.oblittrue.txt=§aObliteration Mode: §4Active -msg.oblitfalse.txt=§aObliteration Mode: §2Inactive -msg.bowmoderapidfire.txt=§aFire Mode: §4Rapid Fire -msg.bowmodesharpshooter.txt=§aFire Mode: §4Sharp Shooter -msg.bowmodeexplosive.txt=§aFire Mode: §4Explosive -msg.bowmodedevistation.txt=§aFire Mode: §4Devastation!!! §2(Creative Only) -msg.bowoutofgunpowder.txt=§4You need 4 gunpowder to use explosive mode - -//###################################Teleporter###################################// +item.wyvernChestPlate.name=WIP item.teleporterMKI.name=Charm of Dislocation item.teleporterMKII.name=Enhanced Charm of Dislocation -msg.teleporterUnSet.txt=§cYou must first set the destination before you can teleport (Shift + Right click) -msg.teleporterBound.txt=§aTeleporter bound to: -msg.teleporterLowHealth.txt= §cYou are to low on health! -msg.teleporterSentMob.txt=The mob has been sent to -msg.teleporterEntityDimensional.txt=§cYou can not send mobs across dimensions! -msg.teleporterAlreadySet.txt=§cError this charm can only be bound to one location -msg.teleporterOutOfFuel.txt=§cOUT OF FUEL!!! -msg.teleporterOutOfPearls.txt=§cOut of Ender Pearls!!! - -info.teleporterInfUnset1.txt=Unbound -info.teleporterInfUnset2.txt=Shift right click to bind your current -info.teleporterInfUnset3.txt=x, y, z coordinates -info.teleporterInfUnset4.txt=As well as the direction you are facing -info.teleporterInfUnset5.txt=And the dimension you are currently in -info.teleporterInfDest.txt=Destination -info.teleporterInfFuel.txt=Fuel: - -info.teleporterInfSet1.txt=Bound to -info.teleporterInfSet2.txt=Uses remaining - - -//###################################Wyvern###################################// - item.wyvernPickaxe.name=Pickaxe of the Wyvern item.wyvernShovel.name=Shovel of the Wyvern item.wyvernSword.name=Sword of the Wyvern @@ -86,13 +37,6 @@ item.wyvernHelm.name=Wyvern Helm item.wyvernChest.name=Wyvern Chestplate item.wyvernLeggs.name=Wyvern Leggings item.wyvernBoots.name=Wyvern Boots - -info.wyvernLaw1.txt=Weary of plain tools you begin to understand -info.wyvernLaw2.txt=ways to use Draconic energy to upgrade -info.wyvernArmorLegend1.txt=Mundane armor was too weak -info.wyvernArmorLegend2.txt=you use Draconic knowledge to improve it - -//###################################Draconic###################################// item.draconicPickaxe.name=Draconic Pickaxe item.draconicAxe.name=Draconic Axe item.draconicShovel.name=Draconic Shovel @@ -106,6 +50,59 @@ item.draconicBoots.name=Draconic Boots item.draconicDistructionStaff.name=Draconic Staff of Power item.mobSoul.name=Mob Soul +//###################################Item Groups###################################// +itemGroup.toolsAndWeapons=Draconic Evolution Tools & Weapons +itemGroup.blocksAndItems=Draconic Evolution Blocks & Items + +//###################################Chat Messages###################################// +msg.size0.txt=Tool Mode: Single Block +msg.size1.txt=Tool Mode: 3x3 +msg.size2.txt=Tool Mode: 5x5 +msg.size3.txt=Tool Mode: 7x7 +msg.size4.txt=Tool Mode: 9x9 +msg.oblittrue.txt=§aObliteration Mode: §4Active +msg.oblitfalse.txt=§aObliteration Mode: §2Inactive +msg.bowmoderapidfire.txt=§aFire Mode: §4Rapid Fire +msg.bowmodesharpshooter.txt=§aFire Mode: §4Sharp Shooter +msg.bowmodeexplosive.txt=§aFire Mode: §4Explosive +msg.bowmodedevistation.txt=§aFire Mode: §4Devastation!!! §2(Creative Only) +msg.bowoutofgunpowder.txt=§4You need 4 gunpowder to use explosive mode +msg.teleporterUnSet.txt=§cYou must first set the destination before you can teleport (Shift + Right click) +msg.teleporterBound.txt=§aTeleporter bound to: +msg.teleporterLowHealth.txt= §cYou are to low on health! +msg.teleporterSentMob.txt=The mob has been sent to +msg.teleporterEntityDimensional.txt=§cYou can not send mobs across dimensions! +msg.teleporterAlreadySet.txt=§cError this charm can only be bound to one location +msg.teleporterOutOfFuel.txt=§cOUT OF FUEL!!! +msg.teleporterOutOfPearls.txt=§cOut of Ender Pearls!!! +msg.spawnerInfo1.txt=Mob Type +msg.spawnerInfo2.txt=Requires Player +msg.spawnerInfo3.txt=Ignore Spawn Requirements +msg.spawnerInfo4.txt=Spawner Tier +msg.spawnerInfo5.txt=Shift Right click for upgrade info +msg.spawnerInfo6.txt=Requires players : Nether Star +msg.spawnerInfo7.txt=Ignore Spawn Requirements : Notch Apple +msg.spawnerInfo8.txt=Tier 1 : Infused Compound +msg.spawnerInfo9.txt=Tier 2 : Draconic Compound +msg.spawnerInfo10.txt=Tier 3 : ???... +msg.dislocatorUnsafe.txt=Destination Unsafe Please Try Again +msg.dislocatorNoGround.txt=Error world not found +msg.range.txt=Range: + +//###################################Tool Tips###################################// +info.teleporterInfUnset1.txt=Unbound +info.teleporterInfUnset2.txt=Shift right click to bind your current +info.teleporterInfUnset3.txt=x, y, z coordinates +info.teleporterInfUnset4.txt=As well as the direction you are facing +info.teleporterInfUnset5.txt=And the dimension you are currently in +info.teleporterInfDest.txt=Destination +info.teleporterInfFuel.txt=Fuel: +info.teleporterInfSet1.txt=Bound to +info.teleporterInfSet2.txt=Uses remaining +info.wyvernLaw1.txt=Weary of plain tools you begin to understand +info.wyvernLaw2.txt=ways to use Draconic energy to upgrade +info.wyvernArmorLegend1.txt=Mundane armor was too weak +info.wyvernArmorLegend2.txt=you use Draconic knowledge to improve it info.draconicLaw1.txt=Further Draconic research has allowed info.draconicLaw2.txt=you to unlock even better methods info.draconicAxe1.txt=Timber!!!!!! @@ -122,15 +119,17 @@ info.draconicArmorInfoChest1.txt=and with the set complete info.draconicArmorInfoChest2.txt=walk through fire and fear info.draconicArmorInfoChest3.txt=not the dark magic magic!!! info.draconicArmorInfoHelm.txt=See through the darkness what lies beyond -info.draconicCore.txt=Can be used to stabilize mob spawners +info.draconicCore.txt=The core crafting component for Draconic Evolution +info.draconicCore1.txt=Can be used to stabilize mob spawners +info.mobSoul1.txt=Can be used on a stabilized spawner to set the type +info.mobSoul2.txt=Or shift right click to spawn a mob +info.mobSoul3.txt=(Single Use) +info.wyvernArmor.txt=Having enjoyed the protection of diamond for so long +info.wyvernArmor1.txt=you realize that you can infuse it with the power of the Draconic +info.draconicArmor.txt=Further Draconic research +info.draconicArmor1.txt=has shown you ways to even greater protection + +entity.draconicevolution:EnderDragon.name=Ender Dragon + + -msg.spawnerInfo1.txt=Mob Type -msg.spawnerInfo2.txt=Requires Player -msg.spawnerInfo3.txt=Ignore Spawn Requirements -msg.spawnerInfo4.txt=Spawner Tier -msg.spawnerInfo5.txt=Shift Right click for upgrade info -msg.spawnerInfo6.txt=Requires players : Nether Star -msg.spawnerInfo7.txt=Ignore Spawn Requirements : Notch Apple -msg.spawnerInfo8.txt=Tier 1 : Infused Compound -msg.spawnerInfo9.txt=Tier 2 : Draconic Compound -msg.spawnerInfo10.txt=Tier 3 : ???... \ No newline at end of file diff --git a/src/main/resources/assets/draconicevolution/models/power_sphere_layer_1.obj b/src/main/resources/assets/draconicevolution/models/power_sphere_layer_1.obj new file mode 100644 index 00000000..e2ae8452 --- /dev/null +++ b/src/main/resources/assets/draconicevolution/models/power_sphere_layer_1.obj @@ -0,0 +1,490 @@ +# Blender v2.70 (sub 0) OBJ File: 'power_sphere_layer_1.blend' +# www.blender.org +mtllib power_sphere_layer_1.mtl +v 0.000000 -1.000000 0.000000 +v 0.723607 -0.447220 0.525725 +v -0.276388 -0.447220 0.850649 +v -0.894426 -0.447216 0.000000 +v -0.276388 -0.447220 -0.850649 +v 0.723607 -0.447220 -0.525725 +v 0.276388 0.447220 0.850649 +v -0.723607 0.447220 0.525725 +v -0.723607 0.447220 -0.525725 +v 0.276388 0.447220 -0.850649 +v 0.894426 0.447216 0.000000 +v 0.000000 1.000000 0.000000 +v -0.232822 -0.657519 0.716563 +v -0.162456 -0.850654 0.499995 +v -0.077607 -0.967950 0.238853 +v 0.203181 -0.967950 0.147618 +v 0.425323 -0.850654 0.309011 +v 0.609547 -0.657519 0.442856 +v 0.531941 -0.502302 0.681712 +v 0.262869 -0.525738 0.809012 +v -0.029639 -0.502302 0.864184 +v 0.812729 -0.502301 -0.295238 +v 0.850648 -0.525736 0.000000 +v 0.812729 -0.502301 0.295238 +v 0.203181 -0.967950 -0.147618 +v 0.425323 -0.850654 -0.309011 +v 0.609547 -0.657519 -0.442856 +v -0.753442 -0.657515 0.000000 +v -0.525730 -0.850652 0.000000 +v -0.251147 -0.967949 0.000000 +v -0.483971 -0.502302 0.716565 +v -0.688189 -0.525736 0.499997 +v -0.831051 -0.502299 0.238853 +v -0.232822 -0.657519 -0.716563 +v -0.162456 -0.850654 -0.499995 +v -0.077607 -0.967950 -0.238853 +v -0.831051 -0.502299 -0.238853 +v -0.688189 -0.525736 -0.499997 +v -0.483971 -0.502302 -0.716565 +v -0.029639 -0.502302 -0.864184 +v 0.262869 -0.525738 -0.809012 +v 0.531941 -0.502302 -0.681712 +v 0.956626 0.251149 0.147618 +v 0.951058 -0.000000 0.309013 +v 0.860698 -0.251151 0.442858 +v 0.860698 -0.251151 -0.442858 +v 0.951058 0.000000 -0.309013 +v 0.956626 0.251149 -0.147618 +v 0.155215 0.251152 0.955422 +v 0.000000 -0.000000 1.000000 +v -0.155215 -0.251152 0.955422 +v 0.687159 -0.251152 0.681715 +v 0.587786 0.000000 0.809017 +v 0.436007 0.251152 0.864188 +v -0.860698 0.251151 0.442858 +v -0.951058 -0.000000 0.309013 +v -0.956626 -0.251149 0.147618 +v -0.436007 -0.251152 0.864188 +v -0.587786 0.000000 0.809017 +v -0.687159 0.251152 0.681715 +v -0.687159 0.251152 -0.681715 +v -0.587786 -0.000000 -0.809017 +v -0.436007 -0.251152 -0.864188 +v -0.956626 -0.251149 -0.147618 +v -0.951058 0.000000 -0.309013 +v -0.860698 0.251151 -0.442858 +v 0.436007 0.251152 -0.864188 +v 0.587786 -0.000000 -0.809017 +v 0.687159 -0.251152 -0.681715 +v -0.155215 -0.251152 -0.955422 +v 0.000000 0.000000 -1.000000 +v 0.155215 0.251152 -0.955422 +v 0.831051 0.502299 0.238853 +v 0.688189 0.525736 0.499997 +v 0.483971 0.502302 0.716565 +v 0.029639 0.502302 0.864184 +v -0.262869 0.525738 0.809012 +v -0.531941 0.502302 0.681712 +v -0.812729 0.502301 0.295238 +v -0.850648 0.525736 0.000000 +v -0.812729 0.502301 -0.295238 +v -0.531941 0.502302 -0.681712 +v -0.262869 0.525738 -0.809012 +v 0.029639 0.502302 -0.864184 +v 0.483971 0.502302 -0.716565 +v 0.688189 0.525736 -0.499997 +v 0.831051 0.502299 -0.238853 +v 0.077607 0.967950 0.238853 +v 0.162456 0.850654 0.499995 +v 0.232822 0.657519 0.716563 +v 0.753442 0.657515 0.000000 +v 0.525730 0.850652 0.000000 +v 0.251147 0.967949 0.000000 +v -0.203181 0.967950 0.147618 +v -0.425323 0.850654 0.309011 +v -0.609547 0.657519 0.442856 +v -0.203181 0.967950 -0.147618 +v -0.425323 0.850654 -0.309011 +v -0.609547 0.657519 -0.442856 +v 0.077607 0.967950 -0.238853 +v 0.162456 0.850654 -0.499995 +v 0.232822 0.657519 -0.716563 +v 0.052790 -0.723612 0.688185 +v 0.138199 -0.894429 0.425321 +v 0.361805 -0.723611 0.587779 +v 0.670817 -0.723611 -0.162457 +v 0.670818 -0.723610 0.162458 +v 0.447211 -0.894428 0.000001 +v -0.638195 -0.723609 0.262864 +v -0.361801 -0.894428 0.262864 +v -0.447211 -0.723610 0.525729 +v -0.447211 -0.723612 -0.525727 +v -0.361801 -0.894429 -0.262863 +v -0.638195 -0.723609 -0.262863 +v 0.361803 -0.723612 -0.587779 +v 0.138197 -0.894429 -0.425321 +v 0.052789 -0.723611 -0.688186 +v 1.000000 0.000000 0.000000 +v 0.947213 -0.276396 0.162458 +v 0.947213 -0.276396 -0.162458 +v 0.309017 0.000000 0.951056 +v 0.138199 -0.276398 0.951055 +v 0.447216 -0.276398 0.850648 +v -0.809018 0.000000 0.587783 +v -0.861803 -0.276396 0.425324 +v -0.670819 -0.276397 0.688191 +v -0.809018 -0.000000 -0.587783 +v -0.670819 -0.276397 -0.688191 +v -0.861803 -0.276396 -0.425324 +v 0.309017 -0.000000 -0.951056 +v 0.447216 -0.276398 -0.850648 +v 0.138199 -0.276398 -0.951055 +v 0.670820 0.276396 0.688190 +v 0.809019 -0.000002 0.587783 +v 0.861804 0.276394 0.425323 +v -0.447216 0.276397 0.850648 +v -0.309017 -0.000001 0.951056 +v -0.138199 0.276397 0.951055 +v -0.947213 0.276396 -0.162458 +v -1.000000 0.000001 0.000000 +v -0.947213 0.276397 0.162458 +v -0.138199 0.276397 -0.951055 +v -0.309016 -0.000000 -0.951057 +v -0.447215 0.276397 -0.850649 +v 0.861804 0.276396 -0.425322 +v 0.809019 0.000000 -0.587782 +v 0.670821 0.276397 -0.688189 +v 0.361800 0.894429 0.262863 +v 0.447209 0.723612 0.525728 +v 0.638194 0.723610 0.262864 +v -0.138197 0.894430 0.425319 +v -0.361804 0.723612 0.587778 +v -0.052790 0.723612 0.688185 +v -0.447210 0.894429 0.000000 +v -0.670817 0.723611 -0.162457 +v -0.670817 0.723611 0.162457 +v -0.138197 0.894430 -0.425319 +v -0.052790 0.723612 -0.688185 +v -0.361804 0.723612 -0.587778 +v 0.361800 0.894429 -0.262863 +v 0.638194 0.723610 -0.262864 +v 0.447209 0.723612 -0.525728 +vt 0.009900 0.000189 +vt 0.999702 0.000189 +vt 0.999702 0.989991 +usemtl None +s off +f 1/1 16/2 15/3 +f 2/1 18/2 24/3 +f 1/1 15/2 30/3 +f 1/1 30/2 36/3 +f 1/1 36/2 25/3 +f 2/1 24/2 45/3 +f 3/1 21/2 51/3 +f 4/1 33/2 57/3 +f 5/1 39/2 63/3 +f 6/1 42/2 69/3 +f 2/1 45/2 52/3 +f 3/1 51/2 58/3 +f 4/1 57/2 64/3 +f 5/1 63/2 70/3 +f 6/1 69/2 46/3 +f 7/1 75/2 90/3 +f 8/1 78/2 96/3 +f 9/1 81/2 99/3 +f 10/1 84/2 102/3 +f 11/1 87/2 91/3 +f 13/1 21/2 3/3 +f 14/1 103/2 13/3 +f 15/1 104/2 14/3 +f 13/1 103/2 21/3 +f 103/1 20/2 21/3 +f 14/1 104/2 103/3 +f 104/1 105/2 103/3 +f 103/1 105/2 20/3 +f 105/1 19/2 20/3 +f 15/1 16/2 104/3 +f 16/1 17/2 104/3 +f 104/1 17/2 105/3 +f 17/1 18/2 105/3 +f 105/1 18/2 19/3 +f 18/1 2/2 19/3 +f 22/1 27/2 6/3 +f 23/1 106/2 22/3 +f 24/1 107/2 23/3 +f 22/1 106/2 27/3 +f 106/1 26/2 27/3 +f 23/1 107/2 106/3 +f 107/1 108/2 106/3 +f 106/1 108/2 26/3 +f 108/1 25/2 26/3 +f 24/1 18/2 107/3 +f 18/1 17/2 107/3 +f 107/1 17/2 108/3 +f 17/1 16/2 108/3 +f 108/1 16/2 25/3 +f 16/1 1/2 25/3 +f 28/1 33/2 4/3 +f 29/1 109/2 28/3 +f 30/1 110/2 29/3 +f 28/1 109/2 33/3 +f 109/1 32/2 33/3 +f 29/1 110/2 109/3 +f 110/1 111/2 109/3 +f 109/1 111/2 32/3 +f 111/1 31/2 32/3 +f 30/1 15/2 110/3 +f 15/1 14/2 110/3 +f 110/1 14/2 111/3 +f 14/1 13/2 111/3 +f 111/1 13/2 31/3 +f 13/1 3/2 31/3 +f 34/1 39/2 5/3 +f 35/1 112/2 34/3 +f 36/1 113/2 35/3 +f 34/1 112/2 39/3 +f 112/1 38/2 39/3 +f 35/1 113/2 112/3 +f 113/1 114/2 112/3 +f 112/1 114/2 38/3 +f 114/1 37/2 38/3 +f 36/1 30/2 113/3 +f 30/1 29/2 113/3 +f 113/1 29/2 114/3 +f 29/1 28/2 114/3 +f 114/1 28/2 37/3 +f 28/1 4/2 37/3 +f 27/1 42/2 6/3 +f 26/1 115/2 27/3 +f 25/1 116/2 26/3 +f 27/1 115/2 42/3 +f 115/1 41/2 42/3 +f 26/1 116/2 115/3 +f 116/1 117/2 115/3 +f 115/1 117/2 41/3 +f 117/1 40/2 41/3 +f 25/1 36/2 116/3 +f 36/1 35/2 116/3 +f 116/1 35/2 117/3 +f 35/1 34/2 117/3 +f 117/1 34/2 40/3 +f 34/1 5/2 40/3 +f 43/1 48/2 11/3 +f 44/1 118/2 43/3 +f 45/1 119/2 44/3 +f 43/1 118/2 48/3 +f 118/1 47/2 48/3 +f 44/1 119/2 118/3 +f 119/1 120/2 118/3 +f 118/1 120/2 47/3 +f 120/1 46/2 47/3 +f 45/1 24/2 119/3 +f 24/1 23/2 119/3 +f 119/1 23/2 120/3 +f 23/1 22/2 120/3 +f 120/1 22/2 46/3 +f 22/1 6/2 46/3 +f 49/1 54/2 7/3 +f 50/1 121/2 49/3 +f 51/1 122/2 50/3 +f 49/1 121/2 54/3 +f 121/1 53/2 54/3 +f 50/1 122/2 121/3 +f 122/1 123/2 121/3 +f 121/1 123/2 53/3 +f 123/1 52/2 53/3 +f 51/1 21/2 122/3 +f 21/1 20/2 122/3 +f 122/1 20/2 123/3 +f 20/1 19/2 123/3 +f 123/1 19/2 52/3 +f 19/1 2/2 52/3 +f 55/1 60/2 8/3 +f 56/1 124/2 55/3 +f 57/1 125/2 56/3 +f 55/1 124/2 60/3 +f 124/1 59/2 60/3 +f 56/1 125/2 124/3 +f 125/1 126/2 124/3 +f 124/1 126/2 59/3 +f 126/1 58/2 59/3 +f 57/1 33/2 125/3 +f 33/1 32/2 125/3 +f 125/1 32/2 126/3 +f 32/1 31/2 126/3 +f 126/1 31/2 58/3 +f 31/1 3/2 58/3 +f 61/1 66/2 9/3 +f 62/1 127/2 61/3 +f 63/1 128/2 62/3 +f 61/1 127/2 66/3 +f 127/1 65/2 66/3 +f 62/1 128/2 127/3 +f 128/1 129/2 127/3 +f 127/1 129/2 65/3 +f 129/1 64/2 65/3 +f 63/1 39/2 128/3 +f 39/1 38/2 128/3 +f 128/1 38/2 129/3 +f 38/1 37/2 129/3 +f 129/1 37/2 64/3 +f 37/1 4/2 64/3 +f 67/1 72/2 10/3 +f 68/1 130/2 67/3 +f 69/1 131/2 68/3 +f 67/1 130/2 72/3 +f 130/1 71/2 72/3 +f 68/1 131/2 130/3 +f 131/1 132/2 130/3 +f 130/1 132/2 71/3 +f 132/1 70/2 71/3 +f 69/1 42/2 131/3 +f 42/1 41/2 131/3 +f 131/1 41/2 132/3 +f 41/1 40/2 132/3 +f 132/1 40/2 70/3 +f 40/1 5/2 70/3 +f 54/1 75/2 7/3 +f 53/1 133/2 54/3 +f 52/1 134/2 53/3 +f 54/1 133/2 75/3 +f 133/1 74/2 75/3 +f 53/1 134/2 133/3 +f 134/1 135/2 133/3 +f 133/1 135/2 74/3 +f 135/1 73/2 74/3 +f 52/1 45/2 134/3 +f 45/1 44/2 134/3 +f 134/1 44/2 135/3 +f 44/1 43/2 135/3 +f 135/1 43/2 73/3 +f 43/1 11/2 73/3 +f 60/1 78/2 8/3 +f 59/1 136/2 60/3 +f 58/1 137/2 59/3 +f 60/1 136/2 78/3 +f 136/1 77/2 78/3 +f 59/1 137/2 136/3 +f 137/1 138/2 136/3 +f 136/1 138/2 77/3 +f 138/1 76/2 77/3 +f 58/1 51/2 137/3 +f 51/1 50/2 137/3 +f 137/1 50/2 138/3 +f 50/1 49/2 138/3 +f 138/1 49/2 76/3 +f 49/1 7/2 76/3 +f 66/1 81/2 9/3 +f 65/1 139/2 66/3 +f 64/1 140/2 65/3 +f 66/1 139/2 81/3 +f 139/1 80/2 81/3 +f 65/1 140/2 139/3 +f 140/1 141/2 139/3 +f 139/1 141/2 80/3 +f 141/1 79/2 80/3 +f 64/1 57/2 140/3 +f 57/1 56/2 140/3 +f 140/1 56/2 141/3 +f 56/1 55/2 141/3 +f 141/1 55/2 79/3 +f 55/1 8/2 79/3 +f 72/1 84/2 10/3 +f 71/1 142/2 72/3 +f 70/1 143/2 71/3 +f 72/1 142/2 84/3 +f 142/1 83/2 84/3 +f 71/1 143/2 142/3 +f 143/1 144/2 142/3 +f 142/1 144/2 83/3 +f 144/1 82/2 83/3 +f 70/1 63/2 143/3 +f 63/1 62/2 143/3 +f 143/1 62/2 144/3 +f 62/1 61/2 144/3 +f 144/1 61/2 82/3 +f 61/1 9/2 82/3 +f 48/1 87/2 11/3 +f 47/1 145/2 48/3 +f 46/1 146/2 47/3 +f 48/1 145/2 87/3 +f 145/1 86/2 87/3 +f 47/1 146/2 145/3 +f 146/1 147/2 145/3 +f 145/1 147/2 86/3 +f 147/1 85/2 86/3 +f 46/1 69/2 146/3 +f 69/1 68/2 146/3 +f 146/1 68/2 147/3 +f 68/1 67/2 147/3 +f 147/1 67/2 85/3 +f 67/1 10/2 85/3 +f 88/1 93/2 12/3 +f 89/1 148/2 88/3 +f 90/1 149/2 89/3 +f 88/1 148/2 93/3 +f 148/1 92/2 93/3 +f 89/1 149/2 148/3 +f 149/1 150/2 148/3 +f 148/1 150/2 92/3 +f 150/1 91/2 92/3 +f 90/1 75/2 149/3 +f 75/1 74/2 149/3 +f 149/1 74/2 150/3 +f 74/1 73/2 150/3 +f 150/1 73/2 91/3 +f 73/1 11/2 91/3 +f 94/1 88/2 12/3 +f 95/1 151/2 94/3 +f 96/1 152/2 95/3 +f 94/1 151/2 88/3 +f 151/1 89/2 88/3 +f 95/1 152/2 151/3 +f 152/1 153/2 151/3 +f 151/1 153/2 89/3 +f 153/1 90/2 89/3 +f 96/1 78/2 152/3 +f 78/1 77/2 152/3 +f 152/1 77/2 153/3 +f 77/1 76/2 153/3 +f 153/1 76/2 90/3 +f 76/1 7/2 90/3 +f 97/1 94/2 12/3 +f 98/1 154/2 97/3 +f 99/1 155/2 98/3 +f 97/1 154/2 94/3 +f 154/1 95/2 94/3 +f 98/1 155/2 154/3 +f 155/1 156/2 154/3 +f 154/1 156/2 95/3 +f 156/1 96/2 95/3 +f 99/1 81/2 155/3 +f 81/1 80/2 155/3 +f 155/1 80/2 156/3 +f 80/1 79/2 156/3 +f 156/1 79/2 96/3 +f 79/1 8/2 96/3 +f 100/1 97/2 12/3 +f 101/1 157/2 100/3 +f 102/1 158/2 101/3 +f 100/1 157/2 97/3 +f 157/1 98/2 97/3 +f 101/1 158/2 157/3 +f 158/1 159/2 157/3 +f 157/1 159/2 98/3 +f 159/1 99/2 98/3 +f 102/1 84/2 158/3 +f 84/1 83/2 158/3 +f 158/1 83/2 159/3 +f 83/1 82/2 159/3 +f 159/1 82/2 99/3 +f 82/1 9/2 99/3 +f 93/1 100/2 12/3 +f 92/1 160/2 93/3 +f 91/1 161/2 92/3 +f 93/1 160/2 100/3 +f 160/1 101/2 100/3 +f 92/1 161/2 160/3 +f 161/1 162/2 160/3 +f 160/1 162/2 101/3 +f 162/1 102/2 101/3 +f 91/1 87/2 161/3 +f 87/1 86/2 161/3 +f 161/1 86/2 162/3 +f 86/1 85/2 162/3 +f 162/1 85/2 102/3 +f 85/1 10/2 102/3 diff --git a/src/main/resources/assets/draconicevolution/models/power_sphere_layer_2.obj b/src/main/resources/assets/draconicevolution/models/power_sphere_layer_2.obj new file mode 100644 index 00000000..aeeef063 --- /dev/null +++ b/src/main/resources/assets/draconicevolution/models/power_sphere_layer_2.obj @@ -0,0 +1,131 @@ +# Blender v2.70 (sub 0) OBJ File: 'power_sphere_layer_2.blend' +# www.blender.org +mtllib power_sphere_layer_2.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723607 -0.447220 0.525725 +v -0.276388 -0.447220 0.850649 +v -0.894426 -0.447216 0.000000 +v -0.276388 -0.447220 -0.850649 +v 0.723607 -0.447220 -0.525725 +v 0.276388 0.447220 0.850649 +v -0.723607 0.447220 0.525725 +v -0.723607 0.447220 -0.525725 +v 0.276388 0.447220 -0.850649 +v 0.894426 0.447216 0.000000 +v 0.000000 1.000000 0.000000 +v -0.162456 -0.850654 0.499995 +v 0.425323 -0.850654 0.309011 +v 0.262869 -0.525738 0.809012 +v 0.850648 -0.525736 0.000000 +v 0.425323 -0.850654 -0.309011 +v -0.525730 -0.850652 0.000000 +v -0.688189 -0.525736 0.499997 +v -0.162456 -0.850654 -0.499995 +v -0.688189 -0.525736 -0.499997 +v 0.262869 -0.525738 -0.809012 +v 0.951058 0.000000 0.309013 +v 0.951058 0.000000 -0.309013 +v 0.000000 0.000000 1.000000 +v 0.587786 0.000000 0.809017 +v -0.951058 0.000000 0.309013 +v -0.587786 0.000000 0.809017 +v -0.587786 0.000000 -0.809017 +v -0.951058 0.000000 -0.309013 +v 0.587786 0.000000 -0.809017 +v 0.000000 0.000000 -1.000000 +v 0.688189 0.525736 0.499997 +v -0.262869 0.525738 0.809012 +v -0.850648 0.525736 0.000000 +v -0.262869 0.525738 -0.809012 +v 0.688189 0.525736 -0.499997 +v 0.162456 0.850654 0.499995 +v 0.525730 0.850652 0.000000 +v -0.425323 0.850654 0.309011 +v -0.425323 0.850654 -0.309011 +v 0.162456 0.850654 -0.499995 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +usemtl None +s off +f 1/1 14/2 13/3 +f 2/1 14/2 16/3 +f 1/1 13/2 18/3 +f 1/1 18/2 20/3 +f 1/1 20/2 17/3 +f 2/1 16/2 23/3 +f 3/1 15/2 25/3 +f 4/1 19/2 27/3 +f 5/1 21/2 29/3 +f 6/1 22/2 31/3 +f 2/1 23/2 26/3 +f 3/1 25/2 28/3 +f 4/1 27/2 30/3 +f 5/1 29/2 32/3 +f 6/1 31/2 24/3 +f 7/1 33/2 38/3 +f 8/1 34/2 40/3 +f 9/1 35/2 41/3 +f 10/1 36/2 42/3 +f 11/1 37/2 39/3 +f 13/1 15/2 3/3 +f 13/1 14/2 15/3 +f 14/1 2/2 15/3 +f 16/1 17/2 6/3 +f 16/1 14/2 17/3 +f 14/1 1/2 17/3 +f 18/1 19/2 4/3 +f 18/1 13/2 19/3 +f 13/1 3/2 19/3 +f 20/1 21/2 5/3 +f 20/1 18/2 21/3 +f 18/1 4/2 21/3 +f 17/1 22/2 6/3 +f 17/1 20/2 22/3 +f 20/1 5/2 22/3 +f 23/1 24/2 11/3 +f 23/1 16/2 24/3 +f 16/1 6/2 24/3 +f 25/1 26/2 7/3 +f 25/1 15/2 26/3 +f 15/1 2/2 26/3 +f 27/1 28/2 8/3 +f 27/1 19/2 28/3 +f 19/1 3/2 28/3 +f 29/1 30/2 9/3 +f 29/1 21/2 30/3 +f 21/1 4/2 30/3 +f 31/1 32/2 10/3 +f 31/1 22/2 32/3 +f 22/1 5/2 32/3 +f 26/1 33/2 7/3 +f 26/1 23/2 33/3 +f 23/1 11/2 33/3 +f 28/1 34/2 8/3 +f 28/1 25/2 34/3 +f 25/1 7/2 34/3 +f 30/1 35/2 9/3 +f 30/1 27/2 35/3 +f 27/1 8/2 35/3 +f 32/1 36/2 10/3 +f 32/1 29/2 36/3 +f 29/1 9/2 36/3 +f 24/1 37/2 11/3 +f 24/1 31/2 37/3 +f 31/1 10/2 37/3 +f 38/1 39/2 12/3 +f 38/1 33/2 39/3 +f 33/1 11/2 39/3 +f 40/1 38/2 12/3 +f 40/1 34/2 38/3 +f 34/1 7/2 38/3 +f 41/1 40/2 12/3 +f 41/1 35/2 40/3 +f 35/1 8/2 40/3 +f 42/1 41/2 12/3 +f 42/1 36/2 41/3 +f 36/1 9/2 41/3 +f 39/1 42/2 12/3 +f 39/1 37/2 42/3 +f 37/1 10/2 42/3 diff --git a/src/main/resources/assets/draconicevolution/textures/blocks/animated/generator_front_active.png b/src/main/resources/assets/draconicevolution/textures/blocks/animated/generator_front_active.png new file mode 100644 index 00000000..d6333d9a Binary files /dev/null and b/src/main/resources/assets/draconicevolution/textures/blocks/animated/generator_front_active.png differ diff --git a/src/main/resources/assets/draconicevolution/textures/blocks/animated/generator_front_active.png.mcmeta b/src/main/resources/assets/draconicevolution/textures/blocks/animated/generator_front_active.png.mcmeta new file mode 100644 index 00000000..4f0718ac --- /dev/null +++ b/src/main/resources/assets/draconicevolution/textures/blocks/animated/generator_front_active.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/draconicevolution/textures/blocks/generator_front.png b/src/main/resources/assets/draconicevolution/textures/blocks/generator_front.png new file mode 100644 index 00000000..95566618 Binary files /dev/null and b/src/main/resources/assets/draconicevolution/textures/blocks/generator_front.png differ diff --git a/src/main/resources/assets/draconicevolution/textures/blocks/teteporter_front.png b/src/main/resources/assets/draconicevolution/textures/blocks/teteporter_front.png new file mode 100644 index 00000000..5c8b8c2d Binary files /dev/null and b/src/main/resources/assets/draconicevolution/textures/blocks/teteporter_front.png differ diff --git a/src/main/resources/assets/draconicevolution/textures/gui/Grinder.png b/src/main/resources/assets/draconicevolution/textures/gui/Grinder.png index c1a0837d..35406631 100644 Binary files a/src/main/resources/assets/draconicevolution/textures/gui/Grinder.png and b/src/main/resources/assets/draconicevolution/textures/gui/Grinder.png differ diff --git a/src/main/resources/assets/draconicevolution/textures/models/power_sphere_layer_1.png b/src/main/resources/assets/draconicevolution/textures/models/power_sphere_layer_1.png new file mode 100644 index 00000000..cfb628b8 Binary files /dev/null and b/src/main/resources/assets/draconicevolution/textures/models/power_sphere_layer_1.png differ diff --git a/src/main/resources/assets/draconicevolution/textures/models/power_sphere_layer_2.png b/src/main/resources/assets/draconicevolution/textures/models/power_sphere_layer_2.png new file mode 100644 index 00000000..cfd40691 Binary files /dev/null and b/src/main/resources/assets/draconicevolution/textures/models/power_sphere_layer_2.png differ