mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-19 11:59:21 +00:00
25/11/2014
This commit is contained in:
1 parent
f077b9205d
commit
46b464caa0
124 files changed
+1440
-840
No files matched your search
+5
-3
@@ -1,3 +1,4 @@
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -23,18 +24,19 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-v0.9.6-Beta-pre7"
|
||||
version = "1.7.10-v1.0.0-snapshot_2" //Version System A.B.C A=Minecraft version (increments with each new minecraft version) B=Major mod change (Will break saves) C=Release Number (Increments with each public release)
|
||||
group= "com.brandon3055.draconicevolution" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "Draconic-Evolution"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.0.1208"
|
||||
version = "1.7.10-10.13.2.1236"
|
||||
//assetDir = "run/assets"
|
||||
}
|
||||
|
||||
|
||||
|
||||
dependencies {
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.enchantment.Enchantment;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION, canBeDeactivated = false, guiFactory = References.GUIFACTORY, dependencies = "after:NotEnoughItems;after:NotEnoughItems;after:ThermalExpansion;after:ThermalFoundation;")
|
||||
public class DraconicEvolution {
|
||||
public class DraconicEvolution { // TODO Update Licence and add change log to github
|
||||
|
||||
@Mod.Instance(References.MODID)
|
||||
public static DraconicEvolution instance;
|
||||
@@ -24,8 +24,8 @@ public class DraconicEvolution {
|
||||
@SidedProxy(clientSide = References.CLIENTPROXYLOCATION, serverSide = References.COMMONPROXYLOCATION)
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public static CreativeTabs tolkienTabToolsWeapons = new DETab(CreativeTabs.getNextID(), References.MODID, "toolsAndWeapons", 0);
|
||||
public static CreativeTabs tolkienTabBlocksItems = new DETab(CreativeTabs.getNextID(), References.MODID, "blocksAndItems", 1);
|
||||
public static CreativeTabs tabToolsWeapons = new DETab(CreativeTabs.getNextID(), References.MODID, "toolsAndWeapons", 0);
|
||||
public static CreativeTabs tabBlocksItems = new DETab(CreativeTabs.getNextID(), References.MODID, "blocksAndItems", 1);
|
||||
|
||||
public static final String networkChannelName = "DraconicEvolution";
|
||||
public static SimpleNetworkWrapper network;
|
||||
@@ -56,7 +56,7 @@ public class DraconicEvolution {
|
||||
|
||||
/*
|
||||
public static Achievement ultimatePower;
|
||||
ultimatePower = new Achievement("achievment.ultimatePower", "Ultimate Power!!!", 1, -2, ModItems.draconicDistructionStaff, null).registerStat();
|
||||
ultimatePower = new Achievement("achievment.ultimatePower", "Ultimate Power!!!", 1, -2, ModItems.draconicDestructionStaff, null).registerStat();
|
||||
AchievementPage draconicEvolution = new AchievementPage("Draconic Evolution", ultimatePower);
|
||||
AchievementPage.registerAchievementPage(draconicEvolution);
|
||||
*/
|
||||
|
||||
@@ -10,13 +10,15 @@ import com.brandon3055.draconicevolution.client.render.block.RenderEnergyInfuser
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderParticleGen;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderDragon;
|
||||
import com.brandon3055.draconicevolution.client.render.entity.RenderDragonHeart;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderBow;
|
||||
import com.brandon3055.draconicevolution.client.render.item.RenderMobSoul;
|
||||
import com.brandon3055.draconicevolution.client.render.tile.*;
|
||||
import com.brandon3055.draconicevolution.common.CommonProxy;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.*;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon;
|
||||
@@ -88,6 +90,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
//Entitys
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCustomDragon.class, new RenderDragon());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDragonHeart.class, new RenderDragonHeart());
|
||||
}
|
||||
|
||||
public void registerRenderIDs (){
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DETab extends CreativeTabs {
|
||||
static ItemStack iconStackStaff;
|
||||
|
||||
public static void initialize() {
|
||||
iconStackStaff = ItemNBTHelper.setInteger(new ItemStack(ModItems.draconicDistructionStaff), "Energy", 100000000);
|
||||
iconStackStaff = ItemNBTHelper.setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 100000000);
|
||||
}
|
||||
|
||||
public DETab(int id, String modid, String label, int tab) {
|
||||
|
||||
+4
-3
@@ -6,10 +6,10 @@ import codechicken.nei.api.TaggedInventoryArea;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.interfaces.manual.GuiButtonAHeight;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.utills.GuiHelper;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -31,7 +31,8 @@ import java.util.List;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems")
|
||||
public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
|
||||
public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler
|
||||
{
|
||||
public EntityPlayer player;
|
||||
private TileDraconiumChest tile;
|
||||
private static final ResourceLocation textureLeft = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestLeft.png");
|
||||
|
||||
+46
-15
@@ -1,12 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.client.interfaces.manual;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,6 +18,7 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -51,15 +52,10 @@ public class CraftingInfoPage extends TitledPage {
|
||||
if (isSmelting){
|
||||
drawTexturedModalRect(offsetX + 87, offsetY + 15, 116, 202, 82, 54);
|
||||
}else {
|
||||
drawTexturedModalRect(offsetX + 70, offsetY + 15, 0, 202, 116, 54);
|
||||
if (!hasRecipe) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
drawTexturedModalRect(offsetX + 70, offsetY + 15, 198, 202, 54, 54);
|
||||
GL11.glPopMatrix();
|
||||
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 129, offsetY + 60, 0xff0000);
|
||||
if (hasRecipe) drawTexturedModalRect(offsetX + 70, offsetY + 15, 0, 202, 116, 54);
|
||||
else {
|
||||
drawTexturedModalRect(offsetX + 119, offsetY + 17, 0, 202, 18, 18);
|
||||
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 145, offsetY + 17, 0xff0000);
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
@@ -93,6 +89,11 @@ public class CraftingInfoPage extends TitledPage {
|
||||
}
|
||||
int itemX = offsetX + (isSmelting ? 148 : 165);
|
||||
int itemY = offsetY + 34;
|
||||
if (!hasRecipe){
|
||||
itemX = offsetX+120;
|
||||
itemY = offsetY+18;
|
||||
}
|
||||
|
||||
drawItemStack(result, itemX, itemY, "");
|
||||
if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize &&
|
||||
relativeMouseY > itemY - 2 && relativeMouseY < itemY - 2 + itemBoxSize) {
|
||||
@@ -105,7 +106,8 @@ public class CraftingInfoPage extends TitledPage {
|
||||
|
||||
public void addDescription(Minecraft minecraft, int offsetX, int offsetY){
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(offsetX+5, offsetY+75, 1);
|
||||
if (hasRecipe) GL11.glTranslated(offsetX+5, offsetY+75, 1);
|
||||
else GL11.glTranslated(offsetX+5, offsetY+40, 1);
|
||||
GL11.glScalef(descriptionScale, descriptionScale, descriptionScale);
|
||||
int offset = 0;
|
||||
for (String s : getFormattedText(fontRendererObj)) {
|
||||
@@ -116,14 +118,43 @@ public class CraftingInfoPage extends TitledPage {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<String> getFormattedText(FontRenderer fr) {
|
||||
if (formattedDescription == null) {
|
||||
if (Strings.isNullOrEmpty(rawDescription)) formattedDescription = ImmutableList.of();
|
||||
else formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 370));
|
||||
if (formattedDescription == null) {
|
||||
formattedDescription = new ArrayList<String>();
|
||||
|
||||
if (Strings.isNullOrEmpty(rawDescription)) {
|
||||
formattedDescription = ImmutableList.of();
|
||||
return formattedDescription;
|
||||
}
|
||||
return formattedDescription;
|
||||
if (!rawDescription.contains("\\n")) {
|
||||
formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 370));
|
||||
return formattedDescription;
|
||||
}
|
||||
|
||||
List<String> segments = new ArrayList(); //Each separate string that is separated by a \n
|
||||
String raw = rawDescription;
|
||||
|
||||
|
||||
int escape = 0;
|
||||
while (raw.contains("\\n")) {
|
||||
segments.add(raw.substring(0, raw.indexOf("\\n")));
|
||||
raw = raw.substring(raw.indexOf("\\n") + 2);
|
||||
if (!raw.contains("\\n")) segments.add(raw);
|
||||
|
||||
escape++;
|
||||
if (escape > 100) {
|
||||
LogHelper.error("Bailing Out!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (String s : segments)
|
||||
formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370)));
|
||||
}
|
||||
return formattedDescription;
|
||||
}
|
||||
|
||||
protected void drawItemStackTooltip(ItemStack stack, int x, int y) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
+6
-6
@@ -109,7 +109,7 @@ public class EnergyCoreTutorialPage extends TutorialPage {
|
||||
int yOffset = (int)((minecraft.getSystemTime()/2000 % 2)*22);
|
||||
drawTexturedModalRect((int)((offsetX+49)*scaleMult), (int)((offsetY+15)*scaleMult), 180, 0+yOffset, 30, 20);
|
||||
GL11.glPopMatrix();
|
||||
drawCenteredString(fontRendererObj, "Tier 2", offsetX+128, offsetY+107, 0xff0000);
|
||||
drawCenteredString(fontRendererObj, "Tier 1", offsetX+128, offsetY+107, 0xff0000);
|
||||
addDescription(minecraft, offsetX, offsetY+45, getFormattedText(fontRendererObj, ttl("manual.de.ectdpage2.txt"), 4));
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class EnergyCoreTutorialPage extends TutorialPage {
|
||||
int yOffset = (int)((minecraft.getSystemTime()/2000 % 2)*22);
|
||||
drawTexturedModalRect((int)((offsetX+54)*scaleMult), (int)((offsetY+15)*scaleMult), 151, 0+yOffset, 28, 20);
|
||||
GL11.glPopMatrix();
|
||||
drawCenteredString(fontRendererObj, "Tier 3", offsetX+128, offsetY+107, 0xff0000);
|
||||
drawCenteredString(fontRendererObj, "Tier 2", offsetX+128, offsetY+107, 0xff0000);
|
||||
addDescription(minecraft, offsetX, offsetY+45, getFormattedText(fontRendererObj, ttl("manual.de.ectdpage3.txt"), 5));
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ public class EnergyCoreTutorialPage extends TutorialPage {
|
||||
int yOffset = (int)((minecraft.getSystemTime()/2000 % 3)*22);
|
||||
drawTexturedModalRect((int)((offsetX+54)*scaleMult), (int)((offsetY+15)*scaleMult), 123, 0+yOffset, 28, 20);
|
||||
GL11.glPopMatrix();
|
||||
drawCenteredString(fontRendererObj, "Tier 4", offsetX+128, offsetY+107, 0xff0000);
|
||||
drawCenteredString(fontRendererObj, "Tier 3", offsetX+128, offsetY+107, 0xff0000);
|
||||
addDescription(minecraft, offsetX, offsetY+45, getFormattedText(fontRendererObj, ttl("manual.de.ectdpage4.txt"), 6));
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class EnergyCoreTutorialPage extends TutorialPage {
|
||||
int yOffset = (int)((minecraft.getSystemTime()/2000 % 4)*22);
|
||||
drawTexturedModalRect((int)((offsetX+60)*scaleMult), (int)((offsetY+15)*scaleMult), 98, 0+yOffset, 25, 20);
|
||||
GL11.glPopMatrix();
|
||||
drawCenteredString(fontRendererObj, "Tier 5", offsetX+128, offsetY+107, 0xff0000);
|
||||
drawCenteredString(fontRendererObj, "Tier 4", offsetX+128, offsetY+107, 0xff0000);
|
||||
addDescription(minecraft, offsetX, offsetY+45, getFormattedText(fontRendererObj, ttl("manual.de.ectdpage5.txt"), 7));
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class EnergyCoreTutorialPage extends TutorialPage {
|
||||
int yOffset = (int)((minecraft.getSystemTime()/2000 % 5)*43 );
|
||||
drawTexturedModalRect((int)((offsetX+60)*scaleMult), (int)((offsetY+15)*scaleMult), 53, 0+yOffset, 44, 41);
|
||||
GL11.glPopMatrix();
|
||||
drawCenteredString(fontRendererObj, "Tier 6", offsetX+128, offsetY+130, 0xff0000);
|
||||
drawCenteredString(fontRendererObj, "Tier 5", offsetX+128, offsetY+130, 0xff0000);
|
||||
addDescription(minecraft, offsetX, offsetY+65, getFormattedText(fontRendererObj, ttl("manual.de.ectdpage6.txt"), 8));
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public class EnergyCoreTutorialPage extends TutorialPage {
|
||||
int yOffset = (int)((minecraft.getSystemTime()/2000 % 6)*43 );
|
||||
drawTexturedModalRect((int)((offsetX+49)*scaleMult), (int)((offsetY+15)*scaleMult), 0, 0+yOffset, 52, 41);
|
||||
GL11.glPopMatrix();
|
||||
drawCenteredString(fontRendererObj, "Tier 7", offsetX+128, offsetY+130, 0xff0000);
|
||||
drawCenteredString(fontRendererObj, "Tier 6", offsetX+128, offsetY+130, 0xff0000);
|
||||
addDescription(minecraft, offsetX, offsetY+65, getFormattedText(fontRendererObj, ttl("manual.de.ectdpage7.txt"), 9));
|
||||
}
|
||||
|
||||
|
||||
+11
-7
@@ -48,15 +48,18 @@ public class GuiManual extends GuiScreen {
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconiumBlend), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconiumIngot, 2), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicCore), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.infusedCompound), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernCore), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.dragonHeart), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicCompound, 2), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.sunFocus), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.awakenedCore), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, ModItems.wyvernEnergyCore, ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, ModItems.draconicEnergyCore, ""));
|
||||
// pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.sunFocus), ""));
|
||||
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernPickaxe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernShovel), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernSword), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernBow), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, ModItems.wyvernFluxCapacitor, ""));
|
||||
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicPickaxe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicShovel), ""));
|
||||
@@ -64,7 +67,8 @@ public class GuiManual extends GuiScreen {
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicAxe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicSword), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicBow), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicDistructionStaff), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.draconicDestructionStaff), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, ModItems.draconicFluxCapacitor, ""));
|
||||
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernHelm), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.wyvernChest), ""));
|
||||
@@ -97,11 +101,11 @@ public class GuiManual extends GuiScreen {
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.xRayBlock), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.potentiometer), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.rainSensor), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.draconium), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.draconiumBlock), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.energyStorageCore), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.energyPylon), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.draconium, 1, 1), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.draconium, 1, 2), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.draconiumBlock, 1, 1), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.draconiumBlock, 1, 2), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.longRangeDislocator, 1, 1), ""));
|
||||
|
||||
pageCollection.addPage(new EnergyCoreTutorialPage("TUTORIAL."+getNextPageIndex(), pageCollection).setIndexName(StatCollector.translateToLocal("manual.de.ecth.txt")));
|
||||
|
||||
+3
-3
@@ -69,19 +69,19 @@ public class TutorialPage extends TitledPage {
|
||||
List<String> modified = new ArrayList();
|
||||
for (int i = 0; i < formattedDescription[descriptionIndex].size(); i++){
|
||||
String line = formattedDescription[descriptionIndex].get(i);
|
||||
if (!line.contains("/n")) modified.add(line);
|
||||
if (!line.contains("\\n")) modified.add(line);
|
||||
else {
|
||||
String joinedLine = "";
|
||||
for (i=i; i < formattedDescription[descriptionIndex].size(); i++) joinedLine = joinedLine + formattedDescription[descriptionIndex].get(i);
|
||||
int escape = 0;
|
||||
while (!joinedLine.isEmpty() && escape < 20) {
|
||||
int index = 0;
|
||||
if (joinedLine.contains("/n")) index = joinedLine.indexOf("/n");
|
||||
if (joinedLine.contains("\\n")) index = joinedLine.indexOf("\\n");
|
||||
else index = joinedLine.length();
|
||||
String s = joinedLine.substring(0, index);
|
||||
modified.add(s);
|
||||
joinedLine = joinedLine.substring(index);
|
||||
joinedLine = joinedLine.replaceFirst("/n", "");
|
||||
joinedLine = joinedLine.replaceFirst("\\n", "");
|
||||
escape++;
|
||||
}
|
||||
break;
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.brandon3055.draconicevolution.client.render.entity;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 21/11/2014.
|
||||
*/
|
||||
public class RenderDragonHeart extends Render {
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.RESOURCESPREFIX + "textures/items/dragonHeart.png");
|
||||
|
||||
private void doRender(EntityDragonHeart entity, double x, double y, double z, float f) {
|
||||
|
||||
float sine = (float)Math.abs(Math.cos(ClientEventHandler.elapsedTicks / 1000D));
|
||||
|
||||
{ //Draw Item
|
||||
//GL11.glRotatef((((float) ClientEventHandler.elapsedTicks) + f) * entity.rotationSpeed, 0f, 1f, 0f);
|
||||
GL11.glRotatef(entity.rotation + f*entity.rotationInc, 0f, 1f, 0f);
|
||||
EntityItem itemEntity = new EntityItem(entity.worldObj, 0, 0, 0, new ItemStack(ModItems.dragonHeart));
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
GL11.glScalef(2F, 2F, 2F);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, sine * 100f, sine * 100f);
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(itemEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
RenderItem.renderInFrame = false;
|
||||
}
|
||||
|
||||
|
||||
{ //Draw Outer Layers
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200f, 200f);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
bindTexture(texture);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glScalef(0.55f, 0.55f, 0.55f);
|
||||
GL11.glTranslated(-0.5, -0.15, 0.05);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glColor4f(2f - sine * 1.3f, 1f - sine / 1.5f, 1f - sine / 1.8f, 1F - sine / 1.6f);
|
||||
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(0, 1, 0, 0, 0);
|
||||
tess.addVertexWithUV(0, 0, 0, 0, 1);
|
||||
tess.addVertexWithUV(1, 0, 0, 1, 1);
|
||||
tess.addVertexWithUV(1, 1, 0, 1, 0);
|
||||
tess.draw();
|
||||
|
||||
GL11.glTranslated(0, 0, -0.12);
|
||||
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(0, 1, 0, 0, 0);
|
||||
tess.addVertexWithUV(0, 0, 0, 0, 1);
|
||||
tess.addVertexWithUV(1, 0, 0, 1, 1);
|
||||
tess.addVertexWithUV(1, 1, 0, 1, 0);
|
||||
tess.draw();
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float f1, float f2) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
doRender((EntityDragonHeart) entity, x, y, z, f2);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -6,6 +6,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
@@ -35,7 +36,7 @@ public class RenderMobSoul implements IItemRenderer {
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
Entity mob = EntityList.createEntityByName(ItemNBTHelper.getString(item, "Name", "Pig"), mc.theWorld);
|
||||
if (ItemNBTHelper.getString(item, "Name", "Pig").equals("Any")) mob = randomEntity;
|
||||
|
||||
if (mob instanceof EntitySkeleton) ((EntitySkeleton)mob).setSkeletonType(ItemNBTHelper.getInteger(item, "SkeletonType", 0));
|
||||
randomEntity = EntityList.createEntityByName(randomEntitys[(int)((mc.getSystemTime() / 1000) % 18)], mc.theWorld);
|
||||
|
||||
if (mob == null) {
|
||||
|
||||
+52
-44
@@ -321,7 +321,12 @@ public final class Particles {
|
||||
break;
|
||||
case 3:
|
||||
behaviour3();
|
||||
break;}
|
||||
break;
|
||||
case 4:
|
||||
behaviour4();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**Fade Out*/
|
||||
@@ -336,49 +341,6 @@ public final class Particles {
|
||||
timer++;
|
||||
}
|
||||
|
||||
/**Go to target and expand with timer*/
|
||||
private void behaviour3(){
|
||||
if (this.getDistanceSq(targetX, targetY, targetZ) < 0.1 && particleAge < particleMaxAge - 40) particleAge = particleMaxAge - 40;
|
||||
if (particleAge > particleMaxAge) setDead();
|
||||
particleAge ++;
|
||||
|
||||
|
||||
|
||||
if (particleScale > 0) particleScale -= 0.02F;
|
||||
|
||||
if ((particleRed == 1F || (particleGreen == 1F && particleBlue == 0F)) && particleAge > particleMaxAge - 10){
|
||||
int t = timer - 300;
|
||||
particleScale = (float)t / (1F - (particleAge / (particleMaxAge - 10F)) * 100F);
|
||||
}else if (particleBlue == 1F && particleAge > particleMaxAge - 15){
|
||||
int t = timer - 700;
|
||||
particleScale = (float)t / (1F - (particleAge / (particleMaxAge - 10F)) * 100F);
|
||||
}
|
||||
|
||||
float motionMod = 0.001F * Math.max(1F - (float) (particleAge / 50), 0F);
|
||||
motionX += (targetX - posX) * motionMod;
|
||||
motionY += (targetY - posY) * motionMod;
|
||||
motionZ += (targetZ - posZ) * motionMod;
|
||||
|
||||
float directMotMod = 0.05F;
|
||||
float directMotT = Math.max(1F-((float)particleAge/(float)50), 0F);
|
||||
directMotMod = (directMotMod * (1F - directMotT));
|
||||
motionX = (motionX * directMotT) + (targetX - posX) * directMotMod;
|
||||
motionY = (motionY * directMotT) + (targetY - posY) * directMotMod;
|
||||
motionZ = (motionZ * directMotT) + (targetZ - posZ) * directMotMod;
|
||||
|
||||
if (particleMaxAge - particleAge < 40 && timer > 2300 && (particleRed == 1F || (particleGreen == 1f && particleBlue == 1f))){
|
||||
double yChange = (double)(timer - 2300);
|
||||
//setPosition(posX, targetY + yChange, posZ);
|
||||
if (posY < targetY + 60)motionY = yChange * 0.05F;
|
||||
}
|
||||
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
moveEntity(motionX, motionY, motionZ);
|
||||
timer++;
|
||||
}
|
||||
|
||||
/**Goes to target and Expand*/
|
||||
private void behaviour2(){
|
||||
if (particleAge > particleMaxAge) setDead();
|
||||
@@ -410,6 +372,52 @@ public final class Particles {
|
||||
timer++;
|
||||
}
|
||||
|
||||
/**Go to target and expand with timer*/
|
||||
private void behaviour3(){
|
||||
if (this.getDistanceSq(targetX, targetY, targetZ) < 0.1 && particleAge < particleMaxAge - 40) particleAge = particleMaxAge - 40;
|
||||
if (particleAge > particleMaxAge) setDead();
|
||||
particleAge ++;
|
||||
|
||||
if (particleScale > 0) particleScale -= 0.02F;
|
||||
|
||||
if ((particleRed == 1F || (particleGreen == 1F && particleBlue == 0F)) && particleAge > particleMaxAge - 10){
|
||||
int t = timer - 300;
|
||||
if (timer > 0) particleScale = (float)t / (1F - (particleAge / (particleMaxAge - 10F)) * 100F);
|
||||
}else if (particleBlue == 1F && particleAge > particleMaxAge - 15){
|
||||
int t = timer - 700;
|
||||
if (timer > 0) particleScale = (float)t / (1F - (particleAge / (particleMaxAge - 10F)) * 100F);
|
||||
}
|
||||
|
||||
float motionMod = 0.001F * Math.max(1F - (float) (particleAge / 50), 0F);
|
||||
motionX += (targetX - posX) * motionMod;
|
||||
motionY += (targetY - posY) * motionMod;
|
||||
motionZ += (targetZ - posZ) * motionMod;
|
||||
|
||||
float directMotMod = 0.05F;
|
||||
float directMotT = Math.max(1F-((float)particleAge/(float)50), 0F);
|
||||
directMotMod = (directMotMod * (1F - directMotT));
|
||||
motionX = (motionX * directMotT) + (targetX - posX) * directMotMod;
|
||||
motionY = (motionY * directMotT) + (targetY - posY) * directMotMod;
|
||||
motionZ = (motionZ * directMotT) + (targetZ - posZ) * directMotMod;
|
||||
|
||||
if (particleMaxAge - particleAge < 40 && timer > 2300 && (particleRed == 1F || (particleGreen == 1f && particleBlue == 1f))){
|
||||
double yChange = (double)(timer - 2300);
|
||||
//setPosition(posX, targetY + yChange, posZ);
|
||||
if (posY < targetY + 60)motionY = yChange * 0.05F;
|
||||
}
|
||||
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
moveEntity(motionX, motionY, motionZ);
|
||||
timer++;
|
||||
}
|
||||
|
||||
/**Go to target and shrink out of existence*/
|
||||
private void behaviour4(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import org.lwjgl.opengl.GL12;
|
||||
/**
|
||||
* Created by Brandon on 25/10/2014.
|
||||
*/
|
||||
public class RenderTileTeleporterStand extends TileEntitySpecialRenderer{
|
||||
public class RenderTileTeleporterStand extends TileEntitySpecialRenderer{//TODO Render name abouve stand
|
||||
|
||||
|
||||
ModelTeleporterStand model = new ModelTeleporterStand();
|
||||
|
||||
@@ -4,23 +4,22 @@ import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.creativetab.DETab;
|
||||
import com.brandon3055.draconicevolution.client.interfaces.GuiHandler;
|
||||
import com.brandon3055.draconicevolution.common.achievements.Achievements;
|
||||
import com.brandon3055.draconicevolution.common.entity.*;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.CraftingHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.FMLEventHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.MinecraftForgeEventHandler;
|
||||
import com.brandon3055.draconicevolution.common.network.*;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.common.entity.*;
|
||||
import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.magic.EnchantmentReaper;
|
||||
import com.brandon3055.draconicevolution.common.magic.PotionHandler;
|
||||
import com.brandon3055.draconicevolution.common.network.*;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.*;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnderResurrection;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileInvisibleMultiblock;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -119,7 +118,6 @@ public class CommonProxy {
|
||||
GameRegistry.registerTileEntity(TileEnergyStorageCore.class, References.RESOURCESPREFIX + "TileEnergyStorageCore");
|
||||
GameRegistry.registerTileEntity(TileInvisibleMultiblock.class, References.RESOURCESPREFIX + "TileInvisibleMultiblock");
|
||||
GameRegistry.registerTileEntity(TileEnergyPylon.class, References.RESOURCESPREFIX + "TileEnergyPylon");
|
||||
GameRegistry.registerTileEntity(Utills.TileBlockChanger.class, References.RESOURCESPREFIX + "TileBlockChanger");
|
||||
GameRegistry.registerTileEntity(TileEnderResurrection.class, References.RESOURCESPREFIX + "TileEnderResurrection");
|
||||
GameRegistry.registerTileEntity(TilePlacedItem.class, References.RESOURCESPREFIX + "TilePlacedItem");
|
||||
GameRegistry.registerTileEntity(TileCKeyStone.class, References.RESOURCESPREFIX + "TileCKeyStone");
|
||||
@@ -149,7 +147,8 @@ public class CommonProxy {
|
||||
EntityRegistry.registerModEntity(EntityCustomDragon.class, "EnderDragon", 0, DraconicEvolution.instance, 500, 3, true);
|
||||
EntityRegistry.registerModEntity(EntityPersistentItem.class, "Persistent Item", 1, DraconicEvolution.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityDraconicArrow.class, "Arrow", 2, DraconicEvolution.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityEnderArrow.class, "Ender Arrow", 2, DraconicEvolution.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityChaosDrill.class, "Chaos Drill", 3, DraconicEvolution.instance, 10, 5, false);
|
||||
EntityRegistry.registerModEntity(EntityEnderArrow.class, "Ender Arrow", 3, DraconicEvolution.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityChaosDrill.class, "Chaos Drill", 4, DraconicEvolution.instance, 10, 5, false);
|
||||
EntityRegistry.registerModEntity(EntityDragonHeart.class, "Dragon Heart Item", 5, DraconicEvolution.instance, 32, 5, true);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.brandon3055.draconicevolution.common;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.blocks.*;
|
||||
import com.brandon3055.draconicevolution.common.blocks.machine.*;
|
||||
import com.brandon3055.draconicevolution.common.blocks.multiblock.EnergyPylon;
|
||||
import com.brandon3055.draconicevolution.common.blocks.multiblock.EnergyStorageCore;
|
||||
import com.brandon3055.draconicevolution.common.blocks.multiblock.InvisibleMultiblock;
|
||||
import com.brandon3055.draconicevolution.common.utills.Utills;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@GameRegistry.ObjectHolder(References.MODID)
|
||||
public class ModBlocks {
|
||||
@@ -31,7 +31,7 @@ public class ModBlocks {
|
||||
public static BlockDE longRangeDislocator;
|
||||
public static BlockDE generator;
|
||||
public static BlockDE energyStorageCore;
|
||||
public static BlockDE draconium;
|
||||
public static BlockDE draconiumBlock;
|
||||
public static BlockDE invisibleMultiblock;
|
||||
public static BlockDE energyPylon;
|
||||
public static BlockDE placedItem;
|
||||
@@ -40,8 +40,11 @@ public class ModBlocks {
|
||||
public static BlockDE dissEnchanter;
|
||||
public static BlockDE teleporterStand;
|
||||
public static BlockDE draconiumChest;
|
||||
public static BlockDE draconicBlock;
|
||||
public static Block safetyFlame;
|
||||
|
||||
public static ItemStack resurrectionStone;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
if(ConfigHandler.disableXrayBlock < 2) xRayBlock = new XRayBlock();
|
||||
@@ -58,7 +61,7 @@ public class ModBlocks {
|
||||
customSpawner = new CustomSpawner();
|
||||
generator = new Generator();
|
||||
energyStorageCore = new EnergyStorageCore();
|
||||
draconium = new Draconium();
|
||||
draconiumBlock = new DraconiumBlock();
|
||||
invisibleMultiblock = new InvisibleMultiblock();
|
||||
energyPylon = new EnergyPylon();
|
||||
placedItem = new PlacedItem();
|
||||
@@ -67,6 +70,7 @@ public class ModBlocks {
|
||||
dissEnchanter = new DissEnchanter();
|
||||
teleporterStand = new TeleporterStand();
|
||||
draconiumChest = new DraconiumChest();
|
||||
draconicBlock = new DraconicBlock();
|
||||
|
||||
if(ConfigHandler.disable_LRD < 2) longRangeDislocator = new LongRangeDislocator();
|
||||
|
||||
@@ -75,18 +79,7 @@ public class ModBlocks {
|
||||
containerTemplate = new BlockContainerTemplate();
|
||||
}
|
||||
|
||||
if (ConfigHandler.updateFix)
|
||||
{
|
||||
Block changer1 = new Utills.BlockChanger("tile.particleGenerator", particleGenerator);
|
||||
Block changer2 = new Utills.BlockChanger("tile.customSpawner", customSpawner);
|
||||
Block changer3 = new Utills.BlockChanger("tile.generator", generator);
|
||||
Block changer4 = new Utills.BlockChanger("tile.playerDetectorAdvanced", playerDetectorAdvanced);
|
||||
Block changer5 = new Utills.BlockChanger("tile.energyInfuser", energyInfuser);
|
||||
Block changer6 = new Utills.BlockChanger("tile.draconiumOre", draconiumOre);
|
||||
Block changer7 = new Utills.BlockChanger("tile.weatherController", weatherController);
|
||||
Block changer8 = new Utills.BlockChanger("tile.longRangeDislocator", longRangeDislocator);
|
||||
Block changer9 = new Utills.BlockChanger("tile.grinder", grinder);
|
||||
}
|
||||
resurrectionStone = new ItemStack(ModBlocks.draconiumBlock, 1, 1);
|
||||
}
|
||||
|
||||
public static void register(BlockDE block)
|
||||
|
||||
@@ -14,6 +14,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
@GameRegistry.ObjectHolder(References.MODID)
|
||||
@@ -34,6 +35,7 @@ public class ModItems {
|
||||
public static Item draconicChest;
|
||||
public static Item draconicLeggs;
|
||||
public static Item draconicBoots;
|
||||
public static Item draconicDestructionStaff;
|
||||
|
||||
public static Item wyvernPickaxe;
|
||||
public static Item wyvernShovel;
|
||||
@@ -44,13 +46,12 @@ public class ModItems {
|
||||
public static Item wyvernLeggs;
|
||||
public static Item wyvernBoots;
|
||||
|
||||
public static ItemDE infusedCompound;
|
||||
public static ItemDE wyvernCore;
|
||||
public static ItemDE draconiumDust;
|
||||
public static ItemDE draconiumIngot;
|
||||
public static ItemDE draconiumBlend;
|
||||
public static ItemDE dragonHeart;
|
||||
public static Item draconicDistructionStaff;
|
||||
public static ItemDE draconicCompound;
|
||||
public static ItemDE awakenedCore;
|
||||
public static ItemDE tclogo;
|
||||
public static ItemDE draconicCore;
|
||||
public static ItemDE sunFocus;
|
||||
@@ -61,15 +62,22 @@ public class ModItems {
|
||||
public static ItemDE creativeStructureSpawner;
|
||||
public static ItemDE adminSpawnEgg;
|
||||
public static ItemDE infoTablet;
|
||||
//public static ItemDE obliterationCatalyst;
|
||||
public static ItemDE draconicIngot;
|
||||
public static ItemDE draconiumEnergyCore;
|
||||
public static ItemDE draconiumFluxCapacitor;
|
||||
|
||||
public static ItemDE teleporterMKI;
|
||||
public static ItemDE teleporterMKII;
|
||||
|
||||
public static ItemStack wyvernFluxCapacitor;
|
||||
public static ItemStack draconicFluxCapacitor;
|
||||
public static ItemStack wyvernEnergyCore;
|
||||
public static ItemStack draconicEnergyCore;
|
||||
|
||||
|
||||
public static void init()
|
||||
{
|
||||
draconicDistructionStaff = new DraconicDistructionStaff();
|
||||
draconicDestructionStaff = new DraconicDistructionStaff();
|
||||
draconicPickaxe = new DraconicPickaxe();
|
||||
draconicAxe = new DraconicAxe();
|
||||
draconicShovel = new DraconicShovel();
|
||||
@@ -90,13 +98,13 @@ public class ModItems {
|
||||
wyvernLeggs = new WyvernArmor(DRACONIUMARMOR_T1, 2, Strings.wyvernLeggsName);
|
||||
wyvernBoots = new WyvernArmor(DRACONIUMARMOR_T1, 3, Strings.wyvernBootsName);
|
||||
|
||||
infusedCompound = new InfusedCompound();
|
||||
wyvernCore = new WyvernCore();
|
||||
draconiumDust = new DraconiumDust();
|
||||
draconiumIngot = new DraconiumIngot();
|
||||
draconiumBlend = new DraconiumBlend();
|
||||
dragonHeart = new DragonHeart();
|
||||
draconicCompound = new DraconicCompound();
|
||||
teleporterMKI = (ItemDE)new TeleporterMKI();
|
||||
awakenedCore = new AwakenedCore();
|
||||
teleporterMKI = new TeleporterMKI();
|
||||
teleporterMKII = new TeleporterMKII();
|
||||
tclogo = new Tclogo();
|
||||
draconicCore = new DraconicCore();
|
||||
@@ -108,8 +116,15 @@ public class ModItems {
|
||||
creativeStructureSpawner = new CreativeStructureSpawner();
|
||||
adminSpawnEgg = new AdminSpawnEgg();
|
||||
infoTablet = new InfoTablet();
|
||||
//obliterationCatalyst = new ObliterationCatalyst();
|
||||
draconicIngot = new DraconicIngot();
|
||||
draconiumEnergyCore = new DraconiumEnergyCore();
|
||||
draconiumFluxCapacitor = new DraconiumFluxCapacitor();
|
||||
|
||||
//Custom ItemStacks
|
||||
wyvernEnergyCore = new ItemStack(ModItems.draconiumEnergyCore, 1, 0);
|
||||
draconicEnergyCore = new ItemStack(ModItems.draconiumEnergyCore, 1, 1);
|
||||
wyvernFluxCapacitor = new ItemStack(ModItems.draconiumFluxCapacitor, 1, 0);
|
||||
draconicFluxCapacitor = new ItemStack(ModItems.draconiumFluxCapacitor, 1, 1);
|
||||
}
|
||||
|
||||
public static void register(final ItemDE item)
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class BlockContainerTemplate extends BlockContainerDE {
|
||||
public BlockContainerTemplate() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.containerTemplateName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setHardness(1f);
|
||||
this.setResistance(200.0f);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class CKeyStone extends BlockDE {
|
||||
private IIcon blockIcon1;
|
||||
public CKeyStone(){
|
||||
this.setBlockUnbreakable();
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockName(Strings.cKeyStoneName);
|
||||
ModBlocks.register(this, CKeyStoneItemBlock.class);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class CustomSpawner extends BlockDE{
|
||||
public CustomSpawner()
|
||||
{
|
||||
this.setBlockName(Strings.customSpawnerName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setHardness(10F);
|
||||
this.setResistance(2000F);
|
||||
this.setHarvestLevel("pickaxe", 3);
|
||||
@@ -54,6 +54,7 @@ public class CustomSpawner extends BlockDE{
|
||||
if (name.equals(spawner.getBaseLogic().entityName)){return false;}
|
||||
spawner.getBaseLogic().entityName = name;
|
||||
spawner.isSetToSpawn = true;
|
||||
spawner.getBaseLogic().skeletonType = ItemNBTHelper.getInteger(item, "SkeletonType", 0);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
item.splitStack(1);
|
||||
return true;
|
||||
@@ -62,12 +63,12 @@ public class CustomSpawner extends BlockDE{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
item.splitStack(1);
|
||||
return true;
|
||||
}else if (item != null && item.getItem().equals(ModItems.infusedCompound) && spawner.getBaseLogic().spawnSpeed == 0){
|
||||
}else if (item != null && item.getItem().equals(ModItems.wyvernCore) && spawner.getBaseLogic().spawnSpeed == 0){
|
||||
spawner.getBaseLogic().setSpawnRate(1);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
item.splitStack(1);
|
||||
return true;
|
||||
}else if (item != null && item.getItem().equals(ModItems.draconicCompound) && spawner.getBaseLogic().spawnSpeed == 1){
|
||||
}else if (item != null && item.getItem().equals(ModItems.awakenedCore) && spawner.getBaseLogic().spawnSpeed == 1){
|
||||
spawner.getBaseLogic().setSpawnRate(2);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
item.splitStack(1);
|
||||
@@ -188,7 +189,7 @@ public class CustomSpawner extends BlockDE{
|
||||
}
|
||||
if (spawner.getBaseLogic().spawnSpeed > 0)
|
||||
{
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.infusedCompound));
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.wyvernCore));
|
||||
item.motionX = (-0.5F + world.rand.nextFloat()) * multiplyer;
|
||||
item.motionY = (4 + world.rand.nextFloat()) * multiplyer;
|
||||
item.motionZ = (-0.5F + world.rand.nextFloat()) * multiplyer;
|
||||
@@ -196,7 +197,7 @@ public class CustomSpawner extends BlockDE{
|
||||
}
|
||||
if (spawner.getBaseLogic().spawnSpeed > 1)
|
||||
{
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.draconicCompound));
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.awakenedCore));
|
||||
item.motionX = (-0.5F + world.rand.nextFloat()) * multiplyer;
|
||||
item.motionY = (4 + world.rand.nextFloat()) * multiplyer;
|
||||
item.motionZ = (-0.5F + world.rand.nextFloat()) * multiplyer;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.brandon3055.draconicevolution.common.blocks;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 21/11/2014.
|
||||
*/
|
||||
public class DraconicBlock extends BlockDE{//todo new description
|
||||
IIcon top;
|
||||
public DraconicBlock() {
|
||||
this.setHardness(20F);
|
||||
this.setResistance(40F);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockName(Strings.draconicBlockName);
|
||||
this.setHarvestLevel("pickaxe", 4);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconic_block");
|
||||
top = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconic_block_blank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int p_149691_2_) {
|
||||
if (side == 0 || side == 1) return top;
|
||||
else return blockIcon;
|
||||
}
|
||||
}
|
||||
+5
-6
@@ -23,16 +23,17 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Brandon on 25/07/2014.
|
||||
*/
|
||||
public class Draconium extends BlockDE {
|
||||
public class DraconiumBlock extends BlockDE {//todo new description
|
||||
private final int DRACONIUM_META = 0;
|
||||
private final int SUMMON_BLOCK_META = 1;
|
||||
private final int CHARGED_DRACONIUM_META = 2;
|
||||
IIcon icons[] = new IIcon[3];
|
||||
public Draconium() {
|
||||
public DraconiumBlock() {
|
||||
this.setHardness(10F);
|
||||
this.setResistance(20F);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setBlockName(Strings.draconiumName);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockName(Strings.draconiumBlockName);
|
||||
this.setHarvestLevel("pickaxe", 4);
|
||||
ModBlocks.register(this, DraconiumItemBlock.class);
|
||||
}
|
||||
|
||||
@@ -42,13 +43,11 @@ public class Draconium extends BlockDE {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
icons[i] = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconium_block_" + i);
|
||||
}
|
||||
blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconium_block_blank");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if ((meta == DRACONIUM_META || meta == CHARGED_DRACONIUM_META) && (side == 0 || side == 1)) return blockIcon;
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class DraconiumChest extends BlockCustomDrop {
|
||||
public DraconiumChest() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.draconiumChestName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||
this.setResistance(2000.0f);
|
||||
|
||||
@@ -22,10 +22,10 @@ public class DraconiumOre extends BlockDE {
|
||||
public IIcon iconEnd;
|
||||
public IIcon iconNether;
|
||||
|
||||
protected DraconiumOre() {
|
||||
public DraconiumOre() {
|
||||
super(Material.rock);
|
||||
this.setBlockName(Strings.draconiumOreName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setHardness(10f);
|
||||
this.setResistance(20.0f);
|
||||
this.setHarvestLevel("pickaxe", 4);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class ParticleGenerator extends BlockDE
|
||||
|
||||
public ParticleGenerator() {
|
||||
this.setBlockName(Strings.particleGeneratorName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setLightOpacity(0);
|
||||
ModBlocks.register(this);
|
||||
|
||||
@@ -25,9 +25,9 @@ public class Potentiometer extends BlockDE
|
||||
{
|
||||
IIcon icons[] = new IIcon[16];
|
||||
|
||||
protected Potentiometer() {
|
||||
public Potentiometer() {
|
||||
super(Material.circuits);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setHardness(0.3f);
|
||||
this.setResistance(0.1f);
|
||||
this.setLightLevel(0.3F);
|
||||
|
||||
@@ -21,9 +21,9 @@ public class RainSensor extends BlockDE
|
||||
IIcon icon_active;
|
||||
IIcon icon_side;
|
||||
|
||||
protected RainSensor() {
|
||||
public RainSensor() {
|
||||
super(Material.circuits);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockBounds(0, 0, 0, 1, 0.125F, 1);
|
||||
this.setHardness(0.3f);
|
||||
this.setResistance(0.5f);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class TeleporterStand extends BlockCustomDrop {
|
||||
public TeleporterStand() {
|
||||
super(Material.rock);
|
||||
this.setBlockName(Strings.teleporterStandName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setHardness(1.5f);
|
||||
this.setResistance(10.0f);
|
||||
|
||||
@@ -23,10 +23,10 @@ import java.util.Random;
|
||||
|
||||
public class TestBlock extends BlockDE {
|
||||
|
||||
protected TestBlock() {
|
||||
public TestBlock() {
|
||||
super(Material.rock);
|
||||
this.setBlockName("testBlock");
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setHardness(5f);
|
||||
this.setResistance(200.0f);
|
||||
//this.setBlockBounds(0.4f, 0f, 0.4f, 0.6f, 1f, 0.6f);
|
||||
|
||||
@@ -20,9 +20,9 @@ import java.util.Random;
|
||||
|
||||
public class XRayBlock extends BlockDE {
|
||||
|
||||
protected XRayBlock() {
|
||||
public XRayBlock() {
|
||||
this.setBlockName(Strings.xrayBlockName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockBounds(0.4F, 0.4F, 0.4F, 0.6F, 0.6F, 0.6F);
|
||||
this.setHardness(10f);
|
||||
this.setHarvestLevel("pickaxe", 4);
|
||||
@@ -85,7 +85,7 @@ public class XRayBlock extends BlockDE {
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
ItemStack tool = player.getCurrentEquippedItem();
|
||||
if (tool != null && (player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.draconicDistructionStaff)) || player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.draconicPickaxe))))
|
||||
if (tool != null && (player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.draconicDestructionStaff)) || player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.draconicPickaxe))))
|
||||
{
|
||||
EntityItem item = new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(Item.getItemFromBlock(ModBlocks.xRayBlock)));
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
+3
-3
@@ -50,12 +50,12 @@ public class DraconiumItemBlock extends ItemBlock implements IEnergyContainerIte
|
||||
if (container.stackTagCompound == null) {
|
||||
container.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("EnergyHelper");
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
container.stackTagCompound.setInteger("EnergyHelper", energy);
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
if (getEnergyStored(container) == getMaxEnergyStored(container)) container.setItemDamage(2);
|
||||
return energyReceived;
|
||||
@@ -68,7 +68,7 @@ public class DraconiumItemBlock extends ItemBlock implements IEnergyContainerIte
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("EnergyHelper")) {
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
return container.stackTagCompound.getInteger("Energy");
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class DissEnchanter extends BlockCustomDrop {
|
||||
public DissEnchanter() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.dissEnchanterName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
|
||||
ModBlocks.register(this);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class EnergyInfuser extends BlockCustomDrop {
|
||||
public EnergyInfuser() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.energyInfuserName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setBlockBounds(0f, 0f, 0f, 1f, 0.375f, 1f);
|
||||
ModBlocks.register(this);
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class Generator extends BlockCustomDrop {
|
||||
public Generator() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.generatorName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
ModBlocks.register(this);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Grinder extends BlockCustomDrop
|
||||
public Grinder() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.grinderName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setResistance(2000.0f);
|
||||
ModBlocks.register(this);
|
||||
@@ -183,10 +183,23 @@ public class Grinder extends BlockCustomDrop
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float prx, float pry, float prz)
|
||||
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_GRINDER, world, x, y, z);
|
||||
TileEntity tile = world.getTileEntity(X, Y, Z);
|
||||
if (!(tile instanceof TileGrinder))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!world.isRemote && ! player.isSneaking()) {
|
||||
FMLNetworkHandler.openGui(player, DraconicEvolution.instance, GuiHandler.GUIID_GRINDER, world, X, Y, Z);
|
||||
} else if (player.isSneaking()){
|
||||
for (double x = ((TileGrinder)tile).centreX - 4; x <= ((TileGrinder)tile).centreX + 4; x++) {
|
||||
for (double y = ((TileGrinder)tile).centreY - 4; y <= ((TileGrinder)tile).centreY + 4; y++) {
|
||||
for (double z = ((TileGrinder)tile).centreZ - 4; z <= ((TileGrinder)tile).centreZ + 4; z++) {
|
||||
world.spawnParticle("flame", x, y, z, 0D, 0D, 0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class LongRangeDislocator extends BlockDE {
|
||||
|
||||
public LongRangeDislocator() {
|
||||
this.setBlockName(Strings.longRangeDislocatorName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModBlocks.register(this, LRDItemBlock.class);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class PlayerDetector extends BlockDE
|
||||
|
||||
public PlayerDetector() {
|
||||
this.setBlockName(Strings.playerDetectorName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class PlayerDetectorAdvanced extends BlockCustomDrop
|
||||
public PlayerDetectorAdvanced() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.playerDetectorAdvancedName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SunDial extends BlockDE {
|
||||
|
||||
public SunDial() {
|
||||
this.setBlockName(Strings.blockSunDialName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class WeatherController extends BlockCustomDrop {
|
||||
public WeatherController() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.blockWeatherControllerName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
+7
-2
@@ -25,7 +25,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
/**
|
||||
* Created by Brandon on 28/07/2014.
|
||||
*/
|
||||
public class EnergyPylon extends BlockDE {
|
||||
public class EnergyPylon extends BlockDE {//todo fix sphere renderer
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon icon_active_face;
|
||||
public IIcon icon_input;
|
||||
@@ -35,7 +35,7 @@ public class EnergyPylon extends BlockDE {
|
||||
super(Material.iron);
|
||||
this.setHardness(10F);
|
||||
this.setResistance(20F);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockName(Strings.energyPylonName);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
@@ -74,6 +74,11 @@ public class EnergyPylon extends BlockDE {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 1 && side == 1)
|
||||
return icon_active_face;
|
||||
if (meta == 2 && side == 0)
|
||||
return icon_active_face;
|
||||
TileEnergyPylon thisTile = (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEnergyPylon) ? (TileEnergyPylon) world.getTileEntity(x, y, z) : null;
|
||||
if (thisTile == null) return icon_input;
|
||||
return thisTile.input ? icon_output : icon_input;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class EnergyStorageCore extends BlockDE {
|
||||
super(Material.iron);
|
||||
this.setHardness(10F);
|
||||
this.setResistance(20f);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setBlockName(Strings.energyStorageCoreName);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
+4
-4
@@ -44,7 +44,7 @@ public class InvisibleMultiblock extends BlockDE {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconium_block");
|
||||
blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconium_block_0");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,7 +78,7 @@ public class InvisibleMultiblock extends BlockDE {
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random p_149650_2_, int var2) {
|
||||
if (meta == 0)
|
||||
return Item.getItemFromBlock(ModBlocks.draconium);
|
||||
return Item.getItemFromBlock(ModBlocks.draconiumBlock);
|
||||
else if (meta == 1)
|
||||
return Item.getItemFromBlock(Blocks.redstone_block);
|
||||
else
|
||||
@@ -144,7 +144,7 @@ public class InvisibleMultiblock extends BlockDE {
|
||||
private void revert(World world, int x, int y, int z){
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 0)
|
||||
world.setBlock(x, y, z, ModBlocks.draconium);
|
||||
world.setBlock(x, y, z, ModBlocks.draconiumBlock);
|
||||
else if (meta == 1)
|
||||
world.setBlock(x, y, z, Blocks.redstone_block);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class InvisibleMultiblock extends BlockDE {
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
if (world.getBlockMetadata(x, y, z) == 0)
|
||||
return new ItemStack(ModBlocks.draconium);
|
||||
return new ItemStack(ModBlocks.draconiumBlock);
|
||||
else if (world.getBlockMetadata(x, y, z) == 1)
|
||||
return new ItemStack(Blocks.redstone_block);
|
||||
else
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.brandon3055.draconicevolution.common.entity;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.render.particle.Particles;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.blocks.DraconiumBlock;
|
||||
import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation;
|
||||
import com.brandon3055.draconicevolution.common.handler.ParticleHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.Utills;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 21/11/2014.
|
||||
*/
|
||||
public class EntityDragonHeart extends Entity {
|
||||
|
||||
public int age = 0;
|
||||
public float rotation = 0f;
|
||||
public float rotationInc = 0.5f;
|
||||
public int opPhase = 0;
|
||||
private double yStop;
|
||||
private int coresConsumed = 0;
|
||||
private List<TileLocation> blocks = new ArrayList<TileLocation>();
|
||||
|
||||
public EntityDragonHeart(World world)
|
||||
{
|
||||
super(world);
|
||||
this.setSize(0.25F, 0.25F);
|
||||
}
|
||||
|
||||
public EntityDragonHeart(World par1World, double x, double y, double z) {
|
||||
super(par1World);
|
||||
this.setPosition(x, y, z);
|
||||
this.motionX = 0;
|
||||
this.motionY = 0;
|
||||
this.motionZ = 0;
|
||||
this.setSize(0.25F, 0.25F);
|
||||
this.yStop = y + 1.5D;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
getDataWatcher().addObject(11, (float) yStop);
|
||||
getDataWatcher().addObject(12, rotationInc);
|
||||
getDataWatcher().addObject(13, coresConsumed);
|
||||
getDataWatcher().addObject(14, opPhase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource damageSource, float dmg) {
|
||||
setDead();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if(!worldObj.isRemote)getDataWatcher().updateObject(14, opPhase);
|
||||
if(!worldObj.isRemote)getDataWatcher().updateObject(13, coresConsumed);
|
||||
if(!worldObj.isRemote)getDataWatcher().updateObject(12, rotationInc);
|
||||
if(!worldObj.isRemote)getDataWatcher().updateObject(11, (float)yStop);
|
||||
yStop = getDataWatcher().getWatchableObjectFloat(11);
|
||||
rotationInc = getDataWatcher().getWatchableObjectFloat(12);
|
||||
coresConsumed = getDataWatcher().getWatchableObjectInt(13);
|
||||
opPhase = getDataWatcher().getWatchableObjectInt(14);
|
||||
|
||||
|
||||
age++;
|
||||
rotation += rotationInc;
|
||||
super.onUpdate();
|
||||
|
||||
switch (opPhase) {
|
||||
case 0: { //Rises with particle ring
|
||||
motionY = 0.01f;
|
||||
rotationInc+=0.1f;
|
||||
if (posY > yStop){
|
||||
opPhase = 1;
|
||||
motionY = 0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: { //Particle ring retracts
|
||||
opPhase = 2;
|
||||
break;
|
||||
}
|
||||
case 2: { //Particle field accepting items
|
||||
if (coresConsumed == 16 || age > 1240) {
|
||||
age = 1240;
|
||||
opPhase = 3;
|
||||
if (coresConsumed < 4){
|
||||
if (!worldObj.isRemote) worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.dragonHeart)));
|
||||
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
this.setDead();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX-5, posY-5, posZ-5, posX+5, posY+5, posZ+5));
|
||||
for (EntityItem item : items){
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if (Utills.getDistanceAtoB(posX, posY+0.5, posZ, item.posX, item.posY, item.posZ) < 1) {
|
||||
if (coresConsumed == 16 || worldObj.isRemote) break;
|
||||
if (stack.getItem() != ModItems.draconicCore) {
|
||||
item.motionX=1;
|
||||
item.motionY=6;
|
||||
item.motionZ=1;
|
||||
continue;
|
||||
}
|
||||
int needed = 16 - coresConsumed;
|
||||
if (stack.stackSize >= needed) {
|
||||
coresConsumed = 16;
|
||||
stack.stackSize -= needed;
|
||||
} else {
|
||||
coresConsumed += stack.stackSize;
|
||||
stack.stackSize = 0;
|
||||
item.setDead();
|
||||
}
|
||||
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
}
|
||||
else{
|
||||
item.motionX = ((posX - item.posX))*0.1;
|
||||
item.motionY = ((posY+0.5 - item.posY))*0.1;
|
||||
item.motionZ = ((posZ - item.posZ))*0.1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
rotationInc += 0.2f;
|
||||
int maxBlocks = coresConsumed/4;
|
||||
if(age % 10 == 0){
|
||||
blocks = new ArrayList<TileLocation>();
|
||||
for (int x = (int)posX-5; x <= (int)posX+5; x++){
|
||||
for (int y = (int)posY-5; y <= (int)posY+5; y++){
|
||||
for (int z = (int)posZ-5; z <= (int)posZ+5; z++){
|
||||
if (worldObj.getBlock(x, y, z) instanceof DraconiumBlock && worldObj.getBlockMetadata(x, y, z) == 2){
|
||||
TileLocation block = new TileLocation(x, y, z);
|
||||
if (!blocks.contains(block) && blocks.size() < maxBlocks) blocks.add(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (age > 1600) opPhase = 4;
|
||||
break;
|
||||
}
|
||||
case 4:{
|
||||
if (blocks.size() == 0){
|
||||
if (!worldObj.isRemote) worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.dragonHeart)));
|
||||
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
this.setDead();
|
||||
break;
|
||||
}
|
||||
for (TileLocation tile : blocks) {
|
||||
if (!worldObj.isRemote) worldObj.setBlock(tile.getXCoord(), tile.getYCoord(), tile.getZCoord(), ModBlocks.draconicBlock, 0, 2);
|
||||
worldObj.createExplosion(null, tile.getXCoord(), tile.getYCoord(), tile.getZCoord(), 4, false);
|
||||
}
|
||||
worldObj.createExplosion(null, posX, posY, posZ, 4, false);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.isRemote) spawnParticles();
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnParticles(){
|
||||
if (opPhase == 0){
|
||||
double correctY = posY + 0.5;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int nextFloat = rand.nextInt();
|
||||
double offsetX = Math.sin(nextFloat);
|
||||
double offsetZ = Math.cos(nextFloat);
|
||||
EntityFX particle = new Particles.AdvancedSeekerParticle(worldObj, posX + offsetX, correctY, posZ + offsetZ, posX, correctY, posZ, 1, 1f, 1f, 1f, 10);
|
||||
ParticleHandler.spawnCustomParticle(particle, 16);
|
||||
}
|
||||
}
|
||||
if (opPhase == 1){
|
||||
double correctY = posY + 0.5;
|
||||
for (int i = 0; i < 100; i++) {
|
||||
int nextFloat = rand.nextInt();
|
||||
double offsetX = Math.sin(nextFloat);
|
||||
double offsetZ = Math.cos(nextFloat);
|
||||
EntityFX particle = new Particles.AdvancedSeekerParticle(worldObj, posX + offsetX, correctY, posZ + offsetZ, posX, correctY, posZ, 3, 1f, 1f, 1f, 100, -100);
|
||||
ParticleHandler.spawnCustomParticle(particle, 16);
|
||||
}
|
||||
}
|
||||
if (opPhase == 2){
|
||||
double correctY = posY + 0.5;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int nextFloat = rand.nextInt();
|
||||
double offsetX = Math.sin(nextFloat)*(rand.nextFloat()*10);
|
||||
double offsetZ = Math.cos(nextFloat)*(rand.nextFloat()*10);
|
||||
EntityFX particle = new Particles.AdvancedSeekerParticle(worldObj, posX + offsetX, correctY, posZ + offsetZ, posX, correctY, posZ, 3, 1f, 1f, 1f, 100, -100);
|
||||
ParticleHandler.spawnCustomParticle(particle, 50);
|
||||
}
|
||||
}
|
||||
if (opPhase == 3){
|
||||
|
||||
float colourMod = (float)(age-1240)/360f;
|
||||
double correctY = posY + 0.5;
|
||||
int nextFloat = rand.nextInt();
|
||||
double offsetX = Math.sin(nextFloat)*(rand.nextFloat()*10);
|
||||
double offsetZ = Math.cos(nextFloat)*(rand.nextFloat()*10);
|
||||
EntityFX particle = new Particles.AdvancedSeekerParticle(worldObj, posX, correctY, posZ, posX + offsetX, correctY, posZ + offsetZ, 3, 1f, 1f-colourMod, 1f-colourMod, 100, -100);
|
||||
ParticleHandler.spawnCustomParticle(particle, 50);
|
||||
|
||||
for (TileLocation tile : blocks){
|
||||
particle = new Particles.AdvancedSeekerParticle(worldObj, posX, correctY, posZ, tile.getXCoord()+rand.nextDouble(), tile.getYCoord()+rand.nextDouble(), tile.getZCoord()+rand.nextDouble(), 3, 1f, 1f-(colourMod*0.5f), 1f-colourMod, 100, -100);
|
||||
ParticleHandler.spawnCustomParticle(particle, 50);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCollideWithPlayer(EntityPlayer player) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound compound)
|
||||
{
|
||||
compound.setInteger("Age", age);
|
||||
compound.setInteger("Phase", opPhase);
|
||||
compound.setFloat("RotationSpeed", rotationInc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound compound)
|
||||
{
|
||||
age = compound.getInteger("Age");
|
||||
opPhase = compound.getInteger("Phase");
|
||||
rotationInc = compound.getFloat("RotationSpeed");
|
||||
}
|
||||
}
|
||||
+7
-3
@@ -1,5 +1,6 @@
|
||||
package com.brandon3055.draconicevolution.common.entity;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.items.DragonHeart;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -46,9 +47,12 @@ public class EntityPersistentItem extends EntityItem {
|
||||
@Override
|
||||
public boolean attackEntityFrom (DamageSource par1DamageSource, float par2)
|
||||
{
|
||||
if (par1DamageSource.getDamageType().equals("outOfWorld"))
|
||||
return true;
|
||||
return false;
|
||||
if (getEntityItem().getItem() instanceof DragonHeart && par1DamageSource.isExplosion() && par2 > 35f){
|
||||
worldObj.spawnEntityInWorld(new EntityDragonHeart(worldObj, posX, posY, posZ));
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
return par1DamageSource.getDamageType().equals("outOfWorld");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,6 @@ public class ConfigHandler {
|
||||
public static boolean generateEnderComets;
|
||||
public static boolean generateChaosIslands;
|
||||
public static boolean pigmenBloodRage;
|
||||
public static boolean updateFix;
|
||||
public static boolean bowBlockDamage;
|
||||
public static boolean showUnlocalizedNames;
|
||||
public static boolean disableLore;
|
||||
@@ -66,7 +65,6 @@ public class ConfigHandler {
|
||||
showUnlocalizedNames = config.get(Configuration.CATEGORY_GENERAL, "Show Unlocalized Names", false, "If set to true the unlocalized name of every block and item will be displayed in its tool tip").getBoolean(false);
|
||||
soulDropChance = config.get(Configuration.CATEGORY_GENERAL, "soulDropChance", 1000, "Mobs have a 1 in this number chance to drop a soul", 1, Integer.MAX_VALUE).getInt(1000);
|
||||
passiveSoulDropChance = config.get(Configuration.CATEGORY_GENERAL, "passiveSoulDropChance", 800, "Passive (Animals) Mobs have a 1 in this number chance to drop a soul", 1, Integer.MAX_VALUE).getInt(800);
|
||||
updateFix = config.get(Configuration.CATEGORY_GENERAL, "Update Fix", false, "Convert blocks from v0.9.2 to the v0.2.3+ format (set to false if you are not updating from v0.9.2 or earlier)").getBoolean(false);
|
||||
cometRarity = config.get(Configuration.CATEGORY_GENERAL, "Ender Comet Rarity", 10000, "Ender Comet has a 1 in {this number} chance to spawn in each chunk").getInt(10000);
|
||||
generateEnderComets = config.get(Configuration.CATEGORY_GENERAL, "Generate Ender Comets", true, "Should Ender comets be generated").getBoolean(true);
|
||||
generateChaosIslands = config.get(Configuration.CATEGORY_GENERAL, "Generate Chaos Islands", true, "Should Chaos Islands be generated").getBoolean(true);
|
||||
@@ -87,7 +85,7 @@ public class ConfigHandler {
|
||||
// potionFlightID = config.get("magic id's", "potionFlightID", 50).getInt(50);
|
||||
|
||||
//Enchantments
|
||||
reaperEnchantID = config.get("magic id's", "Reaper Enchant id", 220).getInt(220);
|
||||
reaperEnchantID = config.get("magic id's", "Reaper Enchant id", 180).getInt(180);
|
||||
}
|
||||
catch (Exception e) {
|
||||
LogHelper.error("Unable to load Config");
|
||||
|
||||
+105
-91
@@ -1,122 +1,136 @@
|
||||
package com.brandon3055.draconicevolution.common.handler;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.DraconicArmor;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.WyvernArmor;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.*;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.DraconicBow;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.DraconicSword;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.WyvernBow;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.WyvernSword;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class CraftingHandler {
|
||||
public static void init()
|
||||
{
|
||||
registerShapedRecipes();
|
||||
registerSmeltingRecipes();
|
||||
registerShapelessRecipes();
|
||||
registerRemoteRecipes();
|
||||
}
|
||||
|
||||
private static void registerRemoteRecipes()
|
||||
{
|
||||
DraconicPickaxe.registerRecipe();
|
||||
DraconicAxe.registerRecipe();
|
||||
DraconicDistructionStaff.registerRecipe();
|
||||
DraconicShovel.registerRecipe();
|
||||
DraconicHoe.registerRecipe();
|
||||
DraconicSword.registerRecipe();
|
||||
DraconicBow.registerRecipe();
|
||||
WyvernPickaxe.registerRecipe();
|
||||
WyvernShovel.registerRecipe();
|
||||
WyvernSword.registerRecipe();
|
||||
WyvernBow.registerRecipe();
|
||||
TeleporterMKI.registerRecipe();
|
||||
TeleporterMKII.registerRecipe();
|
||||
DraconicArmor.registerRecipe();
|
||||
WyvernArmor.registerRecipe();
|
||||
}
|
||||
|
||||
public static void registerShapedRecipes()
|
||||
{
|
||||
ItemStack mobSoul = new ItemStack(ModItems.mobSoul);
|
||||
ItemNBTHelper.setString(mobSoul, "Name", "Any");
|
||||
|
||||
ItemStack chest;
|
||||
boolean isIronChestsInstalled = Loader.isModLoaded("IronChest");
|
||||
if (isIronChestsInstalled){
|
||||
chest = new ItemStack(GameRegistry.findBlock("IronChest", "BlockIronChest"), 1, 6);
|
||||
LogHelper.info("Added Iron Chests Integration");
|
||||
}else {
|
||||
chest = new ItemStack(Blocks.chest);
|
||||
LogHelper.info("Iron Chests was not detected! using fallback chest recipe");
|
||||
}
|
||||
//Components Key[C=Corner, S=Side, M=Middle ]
|
||||
addOre(ModItems.draconicCore, "CSC", "SMS", "CSC", 'C', "ingotGold", 'S', ModItems.draconiumIngot, 'M', "gemDiamond");
|
||||
add(ModItems.wyvernCore, "CSC", "SMS", "CSC", 'C', ModItems.draconiumIngot, 'S', ModItems.draconicCore, 'M', Items.nether_star);
|
||||
add(ModItems.awakenedCore, "CSC", "SCS", "CSC", 'C', ModItems.draconicIngot, 'S', ModItems.wyvernCore);
|
||||
add(ModItems.wyvernEnergyCore, "CSC", "SMS", "CSC", 'C', ModItems.draconiumIngot, 'S', Blocks.redstone_block, 'M', ModItems.draconicCore);
|
||||
add(ModItems.draconicEnergyCore, "CSC", "SMS", "CSC", 'C', ModItems.draconicIngot, 'S', ModItems.wyvernEnergyCore, 'M', ModItems.wyvernCore);
|
||||
addOre(ModItems.draconiumBlend, " D ", "DID", " D ", 'I', "ingotIron", 'D', ModItems.draconiumDust);
|
||||
|
||||
CraftingManager.getInstance().addShapelessRecipe(new ItemStack(ModItems.draconicIngot, 9), Item.getItemFromBlock(ModBlocks.draconicBlock));
|
||||
CraftingManager.getInstance().addShapelessRecipe(new ItemStack(ModItems.draconiumIngot, 9), Item.getItemFromBlock(ModBlocks.draconiumBlock));
|
||||
GameRegistry.addSmelting(ModItems.draconiumBlend, new ItemStack(ModItems.draconiumIngot, 2), 1.0f);
|
||||
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.draconicCore), "GIG", "ISI", "GIG", 'S', "gemDiamond", 'G', "ingotGold", 'I', ModItems.draconiumIngot));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.infusedCompound, 2), "IDI", "DSD", "IDI", 'S', Items.nether_star, 'D', "gemDiamond", 'I', ModItems.draconiumIngot));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.draconiumBlend), " D ", "DID", " D ", 'I', "ingotIron", 'D', ModItems.draconiumDust));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.safetyMatch, 1, 1000), " O ", " S ", " ", 'O', "dyeOrange", 'S', "stickWood"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.infoTablet), "SSS", "SDS", "SSS", 'S', "stone", 'D', ModItems.draconiumDust));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.grinder, 1, 3), "IXI", "DCD", "IFI", 'I', "ingotIron", 'X', ModItems.draconiumIngot, 'D', Items.diamond_sword, 'C', ModItems.draconicCore, 'F', Blocks.furnace));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.weatherController), "RSR", "TPT", "IEI", 'R', Items.blaze_rod, 'S', ModItems.sunFocus, 'T', Blocks.tnt, 'P', ModItems.draconicCore, 'I', "ingotIron", 'E', Blocks.enchanting_table));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.potentiometer), "ITI", "QCQ", "IRI", 'I', "ingotIron", 'T', Blocks.redstone_torch, 'Q', "gemQuartz", 'C', Items.comparator, 'R', Blocks.redstone_block));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.rainSensor), " ", "RBR", "SPS", 'R', "dustRedstone", 'B', Items.bucket, 'S', Blocks.stone_slab, 'P', Blocks.heavy_weighted_pressure_plate));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.playerDetector), "ITI", "CEC", "IDI", 'I', "ingotIron", 'E', Items.ender_eye, 'T', Blocks.redstone_torch, 'C', Items.comparator, 'D', ModItems.draconicCore));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.generator, 1, 3), "NIN", "IFI", "NCN", 'N', Items.netherbrick, 'I', "ingotIron", 'F', Blocks.furnace, 'C', ModItems.draconicCore));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.energyPylon, 2), "IEI", "MCM", "IDI", 'I', ModItems.draconiumIngot, 'E', Items.ender_eye, 'C', ModItems.draconicCore, 'D', "gemDiamond", 'M', "gemEmerald"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.dissEnchanter), "PIP", "ETE", "CBC", 'P', Items.ender_eye, 'I', Items.enchanted_book, 'E', "gemEmerald", 'T', Blocks.enchanting_table, 'C', ModItems.draconicCore, 'B', Items.book));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.teleporterStand), " P ", " S ", "HBH", 'P', Blocks.stone_pressure_plate, 'S', "stone", 'H', new ItemStack(Blocks.stone_slab, 1, 0), 'B', Items.blaze_powder));
|
||||
//Wyvern tools
|
||||
add(ModItems.wyvernFluxCapacitor, "CSC", "SMS", "CSC", 'C', ModItems.draconiumIngot, 'S', ModItems.wyvernEnergyCore, 'M', ModItems.wyvernCore);
|
||||
//tool
|
||||
add(ModItems.wyvernPickaxe, " W ", "ITI", " E ", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'T', Items.diamond_pickaxe, 'E', ModItems.wyvernEnergyCore);
|
||||
add(ModItems.wyvernShovel, " W ", "ITI", " E ", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'T', Items.diamond_shovel, 'E', ModItems.wyvernEnergyCore);
|
||||
add(ModItems.wyvernSword, " W ", "ITI", " E ", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'T', Items.diamond_sword, 'E', ModItems.wyvernEnergyCore);
|
||||
add(ModItems.wyvernBow, " W ", "ITI", " E ", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'T', Items.bow, 'E', ModItems.wyvernEnergyCore);
|
||||
//armor
|
||||
add(ModItems.wyvernHelm, "IWI", "IAI", "IEI", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'A', Items.diamond_helmet, 'E', ModItems.wyvernEnergyCore);
|
||||
add(ModItems.wyvernChest, "IWI", "IAI", "IEI", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'A', Items.diamond_chestplate, 'E', ModItems.wyvernEnergyCore);
|
||||
add(ModItems.wyvernLeggs, "IWI", "IAI", "IEI", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'A', Items.diamond_leggings, 'E', ModItems.wyvernEnergyCore);
|
||||
add(ModItems.wyvernBoots, "IWI", "IAI", "IEI", 'W', ModItems.wyvernCore, 'I', ModItems.draconiumIngot, 'A', Items.diamond_boots, 'E', ModItems.wyvernEnergyCore);
|
||||
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.sunFocus), "RIR", "ISI", "RIR", 'S', Items.nether_star, 'R', Items.blaze_rod, 'I', ModItems.draconiumIngot);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicCompound, 2), " C ", "CHC", " C ", 'C', ModItems.infusedCompound, 'H', ModItems.dragonHeart);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.safetyMatch, 0), "MMM", "MMM", "MMM", 'M', new ItemStack(ModItems.safetyMatch, 1, 1000));
|
||||
|
||||
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.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.energyInfuser), "IPI", "CEC", "ICI", 'I', ModItems.draconiumIngot, 'P', ModBlocks.particleGenerator, 'C', ModItems.draconicCore, 'E', Blocks.enchanting_table);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.draconium), "III", "III", "III", 'I', ModItems.draconiumIngot);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.energyStorageCore), "SRS", "DCD", "SRS", 'S', Items.nether_star, 'R', Blocks.redstone_block, 'C', ModItems.draconicCore, 'D', new ItemStack(ModBlocks.draconium, 1, 0));
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.draconium, 1, 1), "CSC", "SDS", "CSC", 'C', mobSoul, 'S', ModItems.sunFocus, 'D', new ItemStack(ModBlocks.draconium, 1, 0));
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.draconiumChest), "IFI", "SCS", "IWI", 'I', ModItems.draconiumIngot, 'C', ModItems.draconicCore, 'S', chest, 'W', Blocks.crafting_table, 'F', Blocks.furnace);
|
||||
//Draconic Tools
|
||||
add(ModItems.draconicFluxCapacitor, "CMC", "SPS", "CSC", 'C', ModItems.draconicIngot, 'S', ModItems.draconicEnergyCore, 'M', ModItems.awakenedCore, 'P', ModItems.wyvernFluxCapacitor);
|
||||
//tools
|
||||
add(ModItems.draconicPickaxe, " C ", "ITI", " E ", 'C', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'T', ModItems.wyvernPickaxe, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicShovel, " C ", "ITI", " E ", 'C', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'T', ModItems.wyvernShovel, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicAxe, " C ", "ITI", " E ", 'C', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'T', Items.diamond_axe, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicHoe, " C ", "ITI", " E ", 'C', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'T', Items.diamond_hoe, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicSword, " C ", "ITI", " E ", 'C', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'T', ModItems.wyvernSword, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicBow, " C ", "ITI", " E ", 'C', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'T', ModItems.wyvernBow, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicDestructionStaff, "IAI", "PIS", "IWI", 'I', ModItems.draconicIngot, 'A', ModItems.awakenedCore, 'P', ModItems.draconicPickaxe, 'S', ModItems.draconicShovel, 'W', ModItems.draconicSword);
|
||||
//armor
|
||||
add(ModItems.draconicHelm, "IWI", "IAI", "IEI", 'W', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'A', ModItems.wyvernHelm, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicChest, "IWI", "IAI", "IEI", 'W', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'A', ModItems.wyvernChest, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicLeggs, "IWI", "IAI", "IEI", 'W', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'A', ModItems.wyvernLeggs, 'E', ModItems.draconicEnergyCore);
|
||||
add(ModItems.draconicBoots, "IWI", "IAI", "IEI", 'W', ModItems.awakenedCore, 'I', ModItems.draconicIngot, 'A', ModItems.wyvernBoots, 'E', ModItems.draconicEnergyCore);
|
||||
|
||||
|
||||
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);
|
||||
if(ConfigHandler.disableXrayBlock == 0)
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.xRayBlock, 4), "SGS", "GDG", "SGS", 'S', Items.nether_star, 'G', "blockGlassColorless", 'D', "gemDiamond"));
|
||||
//CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.xRayBlock, 4), "SGS", "GDG", "SGS", 'S', Items.nether_star, 'G', "blockGlassColorless", 'D', "gemDiamond");
|
||||
}
|
||||
|
||||
public static void registerSmeltingRecipes()
|
||||
{
|
||||
FurnaceRecipes.smelting().func_151396_a(ModItems.draconiumBlend, new ItemStack(ModItems.draconiumIngot, 2), 1.0f);
|
||||
}
|
||||
//Blocks
|
||||
//storage
|
||||
add(ModBlocks.draconiumBlock, "III", "III", "III", 'I', ModItems.draconiumIngot);
|
||||
add(ModBlocks.draconicBlock, "III", "III", "III", 'I', ModItems.draconicIngot);
|
||||
|
||||
public static void registerShapelessRecipes()
|
||||
{
|
||||
//aesthetic
|
||||
add(ModBlocks.particleGenerator, "RBR", "BCB", "RBR", 'R', Blocks.redstone_block, 'B', Items.blaze_rod, 'C', ModItems.draconicCore);
|
||||
|
||||
//machines
|
||||
addOre(ModBlocks.potentiometer, "ITI", "QCQ", "IRI", 'I', "ingotIron", 'T', Blocks.redstone_torch, 'Q', "gemQuartz", 'C', Items.comparator, 'R', Blocks.redstone_block);
|
||||
addOre(ModBlocks.rainSensor, " ", "RBR", "SPS", 'R', "dustRedstone", 'B', Items.bucket, 'S', Blocks.stone_slab, 'P', Blocks.heavy_weighted_pressure_plate);
|
||||
addOre(ModBlocks.teleporterStand, " P ", " S ", "HBH", 'P', Blocks.stone_pressure_plate, 'S', "stone", 'H', new ItemStack(Blocks.stone_slab, 1, 0), 'B', Items.blaze_powder);
|
||||
|
||||
|
||||
//machines adv
|
||||
add(ModBlocks.resurrectionStone, "CSC", "SMS", "CSC", 'C', mobSoul, 'S', ModItems.wyvernCore, 'M', new ItemStack(ModBlocks.draconiumBlock, 1, 0));
|
||||
add(ModBlocks.energyStorageCore, "CSC", "SMS", "CSC", 'C', ModItems.draconiumIngot, 'S', ModItems.wyvernEnergyCore, 'M', ModItems.wyvernCore);
|
||||
add(ModBlocks.weatherController, "RIR", "TPT", "IEI", 'R', Items.blaze_rod, 'T', Blocks.tnt, 'P', ModItems.draconicCore, 'I', ModItems.draconiumIngot, 'E', Blocks.enchanting_table);
|
||||
add(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);
|
||||
add(ModBlocks.energyInfuser, "IPI", "CEC", "ICI", 'I', ModItems.draconiumIngot, 'P', ModBlocks.particleGenerator, 'C', ModItems.draconicCore, 'E', Blocks.enchanting_table);
|
||||
add(ModBlocks.draconiumChest, "IFI", "SCS", "IWI", 'I', ModItems.draconiumIngot, 'C', ModItems.draconicCore, 'S', getChest(), 'W', Blocks.crafting_table, 'F', Blocks.furnace);
|
||||
addOre(new ItemStack(ModBlocks.energyPylon, 2), "IEI", "MCM", "IDI", 'I', ModItems.draconiumIngot, 'E', Items.ender_eye, 'C', ModItems.draconicCore, 'D', "gemDiamond", 'M', "gemEmerald");
|
||||
addOre(new ItemStack(ModBlocks.grinder, 1, 3), "IXI", "DCD", "IFI", 'I', "ingotIron", 'X', ModItems.draconiumIngot, 'D', Items.diamond_sword, 'C', ModItems.draconicCore, 'F', Blocks.furnace);
|
||||
addOre(ModBlocks.playerDetector, "ITI", "CEC", "IDI", 'I', "ingotIron", 'E', Items.ender_eye, 'T', Blocks.redstone_torch, 'C', Items.comparator, 'D', ModItems.draconicCore);
|
||||
addOre(new ItemStack(ModBlocks.generator, 1, 3), "NIN", "IFI", "NCN", 'N', Items.netherbrick, 'I', "ingotIron", 'F', Blocks.furnace, 'C', ModItems.draconicCore);
|
||||
addOre(ModBlocks.dissEnchanter, "PIP", "ETE", "CBC", 'P', Items.ender_eye, 'I', Items.enchanted_book, 'E', "gemEmerald", 'T', Blocks.enchanting_table, 'C', ModItems.draconicCore, 'B', Items.book);
|
||||
|
||||
|
||||
//Tools
|
||||
add(ModItems.teleporterMKII, "IEI", "ETE", "IWI", 'I', ModItems.draconiumIngot, 'E', Items.ender_pearl, 'T', ModItems.teleporterMKI, 'W', ModItems.wyvernCore);
|
||||
add(ModItems.teleporterMKI, "CSC", "SMS", "CSC", 'C', Items.blaze_powder, 'S', ModItems.draconiumDust, 'M', Items.ender_eye);
|
||||
addOre(new ItemStack(ModItems.safetyMatch, 1, 1000), " O ", " S ", " ", 'O', "dyeOrange", 'S', "stickWood");
|
||||
add(ModItems.safetyMatch, "MMM", "MMM", "MMM", 'M', new ItemStack(ModItems.safetyMatch, 1, 1000));
|
||||
|
||||
|
||||
//Other
|
||||
addOre(ModItems.infoTablet, "SSS", "SDS", "SSS", 'S', "stone", 'D', ModItems.draconiumDust);
|
||||
CraftingManager.getInstance().addShapelessRecipe(new ItemStack(ModItems.enderArrow), Items.arrow, Items.ender_pearl);
|
||||
|
||||
|
||||
//Disable able
|
||||
if(ConfigHandler.disableSunDial == 0)
|
||||
add(ModBlocks.sunDial, "IAI", "CDC", "IEI", 'I', ModItems.draconiumIngot, 'A', ModItems.awakenedCore, 'C', ModItems.draconicCore, 'E', Blocks.enchanting_table, 'D', Blocks.dragon_egg);
|
||||
if(ConfigHandler.disableXrayBlock == 0)
|
||||
addOre(new ItemStack(ModBlocks.xRayBlock, 4), "SGS", "GDG", "SGS", 'S', Items.nether_star, 'G', "blockGlassColorless", 'D', "gemDiamond");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
//turns dirt into enchanted diamond sword
|
||||
ItemStack manipulation = new ItemStack(Items.diamond_sword);
|
||||
manipulation.addEnchantment(Enchantment.efficiency, 2);
|
||||
CraftingManager.getInstance().addShapelessRecipe(manipulation, Blocks.dirt);
|
||||
private static ItemStack getChest(){
|
||||
if (Loader.isModLoaded("IronChest")){
|
||||
LogHelper.info("Adding Iron Chests Integration");
|
||||
return new ItemStack(GameRegistry.findBlock("IronChest", "BlockIronChest"), 1, 6);
|
||||
}else
|
||||
|
||||
ItemStack manipulation2 = new ItemStack(Items.diamond_sword);
|
||||
manipulation2.damageItem(10, null);
|
||||
CraftingManager.getInstance().addShapelessRecipe(manipulation2, Blocks.end_portal_frame); */
|
||||
LogHelper.info("Iron Chests was not detected! using fallback chest recipe");
|
||||
return new ItemStack(Blocks.chest);
|
||||
}
|
||||
|
||||
private static void addOre(Block result, Object... recipe){ addOre(new ItemStack(result), recipe); }
|
||||
private static void addOre(Item result, Object... recipe){ addOre(new ItemStack(result), recipe); }
|
||||
private static void addOre(ItemStack result, Object... recipe){
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(result, recipe));
|
||||
}
|
||||
private static void add(Block result, Object... recipe){ add(new ItemStack(result), recipe); }
|
||||
private static void add(Item result, Object... recipe){ add(new ItemStack(result), recipe); }
|
||||
private static void add(ItemStack result, Object... recipe){
|
||||
GameRegistry.addRecipe(result, recipe);
|
||||
}
|
||||
}
|
||||
+20
-4
@@ -1,22 +1,27 @@
|
||||
package com.brandon3055.draconicevolution.common.handler;
|
||||
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorEffectHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerCapabilities;
|
||||
|
||||
import java.util.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
public class FMLEventHandler {
|
||||
|
||||
public static Map<EntityPlayer, Boolean> playersWithFlight = new WeakHashMap<EntityPlayer, Boolean>();
|
||||
public static List<String> playersWithUphillStep = new ArrayList<String>();
|
||||
public static Field walkSpeed;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
|
||||
@@ -31,7 +36,18 @@ public class FMLEventHandler {
|
||||
if (event.phase != TickEvent.Phase.START)return;
|
||||
EntityPlayer player = event.player;
|
||||
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, player.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
if (walkSpeed == null){
|
||||
walkSpeed = ReflectionHelper.findField(PlayerCapabilities.class, "walkSpeed", "g", "field_75097_g");
|
||||
walkSpeed.setAccessible(true);
|
||||
}
|
||||
if (walkSpeed != null) {
|
||||
try {
|
||||
walkSpeed.setFloat(player.capabilities, 0.1f);
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
LogHelper.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
boolean highStepListed = playersWithUphillStep.contains(player.getDisplayName()) && player.stepHeight >= 1f;
|
||||
|
||||
+16
-24
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.handler;
|
||||
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
|
||||
import com.brandon3055.draconicevolution.common.entity.ExtendedPlayer;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorEffectHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -27,7 +28,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
@@ -35,7 +35,6 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -65,6 +64,15 @@ public class MinecraftForgeEventHandler {
|
||||
event.setCanceled(true);
|
||||
event.entityLiving.extinguish();
|
||||
}
|
||||
|
||||
if (event.source.damageType.equals("fall") && ArmorEffectHandler.getHasJumpBoost(player)) {
|
||||
if (event.ammount < (ArmorEffectHandler.getJumpLevel(player)+1)*2) event.setCanceled(true);
|
||||
}
|
||||
|
||||
if ((event.source.damageType.equals("inWall") || event.source.damageType.equals("drown")) && (ArmorEffectHandler.isWyvernArmor(player, 4) || ArmorEffectHandler.isDraconicArmor(player, 4))) {
|
||||
if (event.ammount <= 2f) event.setCanceled(true);
|
||||
LogHelper.info("drown"+event.ammount);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -105,11 +113,12 @@ public class MinecraftForgeEventHandler {
|
||||
int rand = random.nextInt(Math.max(ConfigHandler.soulDropChance / dropChanceModifier, 1));
|
||||
int rand2 = random.nextInt(Math.max(ConfigHandler.passiveSoulDropChance / dropChanceModifier, 1));
|
||||
boolean isAnimal = entity instanceof EntityAnimal;
|
||||
LogHelper.info(dropChanceModifier+" "+rand);
|
||||
|
||||
if ((rand == 0 && !isAnimal) || (rand2 == 0 && isAnimal)) {
|
||||
ItemStack soul = new ItemStack(ModItems.mobSoul);
|
||||
String name = EntityList.getEntityString(entity);
|
||||
ItemNBTHelper.setString(soul, "Name", name);
|
||||
if (entity instanceof EntitySkeleton) ItemNBTHelper.setInteger(soul, "SkeletonType", ((EntitySkeleton)entity).getSkeletonType());
|
||||
world.spawnEntityInWorld(new EntityItem(world, entity.posX, entity.posY, entity.posZ, soul));
|
||||
}
|
||||
}
|
||||
@@ -119,7 +128,7 @@ public class MinecraftForgeEventHandler {
|
||||
if (stack == null) return 0;
|
||||
if (stack.getItem().equals(ModItems.wyvernBow) || stack.getItem().equals(ModItems.wyvernSword)) chance++;
|
||||
if (stack.getItem().equals(ModItems.draconicSword) || stack.getItem().equals(ModItems.draconicBow)) chance+=2;
|
||||
if (stack.getItem().equals(ModItems.draconicDistructionStaff)) chance+=3;
|
||||
if (stack.getItem().equals(ModItems.draconicDestructionStaff)) chance+=3;
|
||||
|
||||
chance += EnchantmentHelper.getEnchantmentLevel(ConfigHandler.reaperEnchantID, stack);
|
||||
return chance;
|
||||
@@ -143,23 +152,6 @@ public class MinecraftForgeEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void ChunkEvent(ChunkEvent event) {
|
||||
if (!ConfigHandler.updateFix) return;
|
||||
Chunk chunk = event.getChunk();
|
||||
for (ExtendedBlockStorage storage : chunk.getBlockStorageArray()) {
|
||||
if (storage != null) {
|
||||
for (int x = 0; x < 16; ++x) {
|
||||
for (int y = 0; y < 16; ++y) {
|
||||
for (int z = 0; z < 16; ++z) {
|
||||
if (changeBlock(storage, x, y, z)) chunk.isModified = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean changeBlock(ExtendedBlockStorage storage, int x, int y, int z) {
|
||||
|
||||
if (storage.getBlockByExtId(x, y, z).getUnlocalizedName().equals("tile.tile.particleGenerator"))
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.brandon3055.draconicevolution.common.items;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AwakenedCore extends ItemDE {//todo new description
|
||||
public AwakenedCore() {
|
||||
this.setUnlocalizedName(Strings.draconicCompoundName);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class DraconicCompound extends ItemDE {
|
||||
public DraconicCompound() {
|
||||
this.setUnlocalizedName(Strings.draconicCompoundName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean extraInformation)
|
||||
{
|
||||
list.add("Imbued with the power of the dragon heart");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,10 +15,10 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DraconicCore extends ItemDE {
|
||||
public class DraconicCore extends ItemDE {//todo new description
|
||||
public DraconicCore() {
|
||||
this.setUnlocalizedName(Strings.draconicCoreName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.brandon3055.draconicevolution.common.items;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 21/11/2014.
|
||||
*/
|
||||
public class DraconicIngot extends ItemDE {//todo new description
|
||||
public DraconicIngot() {
|
||||
this.setUnlocalizedName(Strings.draconicIngotName);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
public class DraconiumBlend extends ItemDE {
|
||||
public DraconiumBlend() {
|
||||
this.setUnlocalizedName(Strings.draconiumBlendName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
public class DraconiumDust extends ItemDE {
|
||||
public DraconiumDust() {
|
||||
this.setUnlocalizedName(Strings.draconiumDustName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.brandon3055.draconicevolution.common.items;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
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.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 24/11/2014.
|
||||
*/
|
||||
public class DraconiumEnergyCore extends ItemDE {
|
||||
IIcon[] icons = new IIcon[2];
|
||||
public DraconiumEnergyCore()
|
||||
{
|
||||
this.setUnlocalizedName(Strings.draconiumEnergyCoreName);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setHasSubtypes(true);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icons[0] = iconRegister.registerIcon(getUnwrappedUnlocalizedName(super.getUnlocalizedName())+0);
|
||||
icons[1] = iconRegister.registerIcon(getUnwrappedUnlocalizedName(super.getUnlocalizedName())+1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
return super.getUnlocalizedName(itemStack)+itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
public class DraconiumIngot extends ItemDE {
|
||||
public DraconiumIngot() {
|
||||
this.setUnlocalizedName(Strings.draconiumIngotName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,28 @@ package com.brandon3055.draconicevolution.common.items;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DragonHeart extends ItemDE {//todo new description
|
||||
|
||||
public class DragonHeart extends ItemDE {
|
||||
public DragonHeart() {
|
||||
this.setUnlocalizedName(Strings.dragonHeartName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World world, Entity location, ItemStack itemstack) {
|
||||
return new EntityPersistentItem(world, location, itemstack);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class InfoTablet extends ItemDE {
|
||||
|
||||
public InfoTablet() {
|
||||
this.setUnlocalizedName(Strings.infoTabletName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@@ -15,13 +15,11 @@ public class ItemDE extends Item {
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(){
|
||||
//return String.format("item.%s", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
return String.format("item.%s%s", References.MODID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack itemStack){
|
||||
//return String.format("item.%s", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
public class Key extends ItemDE {
|
||||
public Key() {
|
||||
this.setUnlocalizedName(Strings.keyName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
public class SunFocus extends ItemDE {
|
||||
public SunFocus() {
|
||||
this.setUnlocalizedName(Strings.sunFocusName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,21 @@ package com.brandon3055.draconicevolution.common.items;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.achievements.Achievements;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
@@ -75,6 +81,38 @@ public class Tclogo extends ItemDE {
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
|
||||
if (world.isRemote) return stack;
|
||||
|
||||
if (1 == 1) return stack;
|
||||
|
||||
int x = (int)player.posX;
|
||||
int y = (int)player.posY;
|
||||
int z = (int)player.posZ;
|
||||
world.setBlock(x, y, z, Blocks.mob_spawner);
|
||||
TileEntity spawner = world.getTileEntity(x, y, z);
|
||||
if (spawner instanceof TileEntityMobSpawner){
|
||||
MobSpawnerBaseLogic logic = ((TileEntityMobSpawner)spawner).func_145881_a();
|
||||
logic.setEntityName("Zombie");
|
||||
|
||||
EntityZombie zombie = new EntityZombie(world);
|
||||
zombie.setChild(true);
|
||||
zombie.setCurrentItemOrArmor(0, new ItemStack(Items.diamond_axe));
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
zombie.writeEntityToNBT(compound);
|
||||
|
||||
NBTTagCompound compound2 = new NBTTagCompound();
|
||||
logic.writeToNBT(compound2);
|
||||
compound2.setTag("SpawnData", compound);
|
||||
|
||||
logic.readFromNBT(compound2);
|
||||
|
||||
LogHelper.info(compound2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if (!world.isRemote)OreDoublingRegistry.getOreResult(GameRegistry.findItemStack("ThermalFoundation", "oreCopper", 1));
|
||||
|
||||
player.triggerAchievement(Achievements.getAchievement("Draconium Ore"));
|
||||
@@ -117,19 +155,19 @@ public class Tclogo extends ItemDE {
|
||||
int zi = (int)player.posZ;
|
||||
int rad = 1000;
|
||||
|
||||
Block block;
|
||||
for (int x = xi-rad; x < xi+rad; x++){
|
||||
for (int y = yi-10; y < yi+30; y++){
|
||||
for (int z = zi-rad; z < zi+rad; z++){
|
||||
// block = world.getBlock(x, y, z);
|
||||
//if (block.getMaterial().equals(Material.vine) || block.getMaterial().equals(Material.plants)){
|
||||
//world.setBlockToAir(x, y, z);
|
||||
//}
|
||||
|
||||
//world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Block block;
|
||||
// for (int x = xi-rad; x < xi+rad; x++){
|
||||
// for (int y = yi-10; y < yi+30; y++){
|
||||
// for (int z = zi-rad; z < zi+rad; z++){
|
||||
// // block = world.getBlock(x, y, z);
|
||||
// //if (block.getMaterial().equals(Material.vine) || block.getMaterial().equals(Material.plants)){
|
||||
// //world.setBlockToAir(x, y, z);
|
||||
// //}
|
||||
//
|
||||
// //world.markBlockForUpdate(x, y, z);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//world.markBlockRangeForRenderUpdate(xi-rad, yi-rad, zi-rad, xi+rad, yi+rad, zi+rad);
|
||||
|
||||
+3
-3
@@ -4,10 +4,10 @@ import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
|
||||
public class InfusedCompound extends ItemDE {
|
||||
public InfusedCompound() {
|
||||
public class WyvernCore extends ItemDE {//todo new description
|
||||
public WyvernCore() {
|
||||
this.setUnlocalizedName(Strings.infusedCompoundName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class ArmorEffectHandler {
|
||||
}
|
||||
|
||||
public static boolean getHasJumpBoost(EntityPlayer player){
|
||||
return (isDraconicArmor(player, 1) || isWyvernArmor(player, 1)) && extractEnergy(player, (getJumpLevel(player)+1)*1000, 1);
|
||||
return (isDraconicArmor(player, 1) || isWyvernArmor(player, 1)) && extractEnergy(player, (getJumpLevel(player)+1)*80, 1);
|
||||
}
|
||||
|
||||
public static int getJumpLevel(EntityPlayer player){
|
||||
|
||||
+4
-16
@@ -2,11 +2,11 @@ package com.brandon3055.draconicevolution.common.items.armor;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -48,7 +47,7 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
|
||||
public DraconicArmor(ArmorMaterial material, int armorType, String name) {
|
||||
super(material, 0, armorType);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, name);
|
||||
}
|
||||
|
||||
@@ -257,15 +256,4 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void registerRecipe() {
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicHelm), "ISI", "DAD", "CIC", 'I', ModItems.draconiumIngot, 'S', ModItems.sunFocus, 'D', ModItems.draconicCompound, 'C', ModItems.draconicCore, 'A', ModItems.wyvernHelm);
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicChest), "ISI", "DAD", "CDC", 'I', ModItems.draconiumIngot, 'S', ModItems.sunFocus, 'D', ModItems.draconicCompound, 'C', ModItems.draconicCore, 'A', ModItems.wyvernChest);
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicLeggs), "ISI", "DAD", "CIC", 'I', ModItems.draconiumIngot, 'S', ModItems.sunFocus, 'D', ModItems.draconicCompound, 'C', ModItems.draconicCore, 'A', ModItems.wyvernLeggs);
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicBoots), "ISI", "DAD", "CIC", 'I', ModItems.draconiumIngot, 'S', ModItems.sunFocus, 'D', ModItems.draconicCompound, 'C', ModItems.draconicCore, 'A', ModItems.wyvernBoots);
|
||||
}
|
||||
|
||||
}
|
||||
+5
-34
@@ -2,11 +2,11 @@ package com.brandon3055.draconicevolution.common.items.armor;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -15,13 +15,10 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
@@ -32,7 +29,7 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Brandon on 3/07/2014.
|
||||
*/
|
||||
public class WyvernArmor extends ItemArmor implements ISpecialArmor, IEnergyContainerItem{
|
||||
public class WyvernArmor extends ItemArmor implements ISpecialArmor, IEnergyContainerItem{//TODO reconsider fall damage energy adjust fall damage from jumping and jump energy usage
|
||||
private IIcon helmIcon;
|
||||
private IIcon chestIcon;
|
||||
private IIcon leggsIcon;
|
||||
@@ -46,7 +43,7 @@ public class WyvernArmor extends ItemArmor implements ISpecialArmor, IEnergyCont
|
||||
public WyvernArmor(ArmorMaterial material, int armorType, String name) {
|
||||
super(material, 0, armorType);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, name);
|
||||
}
|
||||
|
||||
@@ -180,32 +177,6 @@ public class WyvernArmor extends ItemArmor implements ISpecialArmor, IEnergyCont
|
||||
InfoHelper.addEnergyAndLore(stack, list);
|
||||
}
|
||||
|
||||
public static void registerRecipe(){
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernHelm),
|
||||
" I ",
|
||||
"IDI",
|
||||
" C ",
|
||||
'I', ModItems.infusedCompound, 'D', Items.diamond_helmet, 'C', ModItems.draconicCore);
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernChest),
|
||||
"PIP",
|
||||
"IDI",
|
||||
"ICI",
|
||||
'I', ModItems.infusedCompound, 'D', Items.diamond_chestplate, 'C', ModItems.draconicCore, 'P', new ItemStack(Items.potionitem, 1, 8259));
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernLeggs),
|
||||
"PIP",
|
||||
"IDI",
|
||||
" C ",
|
||||
'I', ModItems.infusedCompound, 'D', Items.diamond_leggings, 'C', ModItems.draconicCore, 'P', new ItemStack(Items.potionitem, 1, 8258));
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernBoots),
|
||||
" I ",
|
||||
"IDI",
|
||||
"PCP",
|
||||
'I', ModItems.infusedCompound, 'D', Items.diamond_boots, 'C', ModItems.draconicCore, 'P', Blocks.piston);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import java.util.List;
|
||||
public class AdminSpawnEgg extends ItemDE {
|
||||
public AdminSpawnEgg() {
|
||||
this.setUnlocalizedName(Strings.adminSpawnEggName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -26,6 +26,7 @@ public class CreativeStructureSpawner extends ItemDE {
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List list) {
|
||||
@@ -72,7 +73,7 @@ public class CreativeStructureSpawner extends ItemDE {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("all")
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) {
|
||||
if (stack.getItemDamage() == 1) list.add("Warning this will take between 5-10 minutes (maby longer) to generate");
|
||||
|
||||
+6
-11
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -17,12 +17,10 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
@@ -38,7 +36,7 @@ public class DraconicAxe extends ItemAxe implements IEnergyContainerItem{
|
||||
public DraconicAxe() {
|
||||
super(ModItems.DRACONIUM_T1);
|
||||
this.setUnlocalizedName(Strings.draconicAxeName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.draconicAxeName);
|
||||
}
|
||||
|
||||
@@ -47,7 +45,8 @@ public class DraconicAxe extends ItemAxe implements IEnergyContainerItem{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 0));
|
||||
@@ -192,10 +191,6 @@ public class DraconicAxe extends ItemAxe implements IEnergyContainerItem{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
public static void registerRecipe() {
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicAxe), "DFD", "CAC", "DTD", 'F', ModItems.sunFocus, 'C', ModItems.draconicCompound, 'D', ModItems.draconiumIngot, 'T', ModItems.draconicCore, 'A', Items.diamond_axe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+6
-10
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -26,7 +26,6 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -39,7 +38,7 @@ public class DraconicDistructionStaff extends ItemTool implements IEnergyContain
|
||||
public IIcon itemIcon0;
|
||||
public IIcon itemIcon1;
|
||||
public IIcon itemIcon2;
|
||||
protected int capacity = References.DRACONICCAPACITY * 10;
|
||||
protected int capacity = References.DRACONICCAPACITY * 3;
|
||||
protected int maxReceive = References.DRACONICTRANSFER;
|
||||
protected int maxExtract = References.DRACONICTRANSFER * 50;
|
||||
|
||||
@@ -65,7 +64,7 @@ public class DraconicDistructionStaff extends ItemTool implements IEnergyContain
|
||||
public DraconicDistructionStaff() {
|
||||
super(0F, ModItems.DRACONIUM_T3, minableBlocks);
|
||||
this.setUnlocalizedName(Strings.draconicDStaffName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setHarvestLevel("pickaxe", 4);
|
||||
this.setHarvestLevel("shovel", 4);
|
||||
this.setHarvestLevel("axe", 4);
|
||||
@@ -77,6 +76,7 @@ public class DraconicDistructionStaff extends ItemTool implements IEnergyContain
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
@@ -188,10 +188,6 @@ public class DraconicDistructionStaff extends ItemTool implements IEnergyContain
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
public static void registerRecipe() {
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicDistructionStaff), "DFD", "PTS", "DWD", 'F', ModItems.sunFocus, 'D', ModItems.draconicCompound, 'T', ModItems.draconicCore, 'P', ModItems.draconicPickaxe, 'S', ModItems.draconicShovel, 'W', ModItems.draconicSword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+5
-10
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -20,11 +20,9 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -41,7 +39,7 @@ public class DraconicHoe extends ItemHoe implements IEnergyContainerItem{
|
||||
public DraconicHoe() {
|
||||
super(ModItems.DRACONIUM_T1);
|
||||
this.setUnlocalizedName(Strings.draconicHoeName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.draconicHoeName);
|
||||
}
|
||||
|
||||
@@ -50,6 +48,7 @@ public class DraconicHoe extends ItemHoe implements IEnergyContainerItem{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
@@ -167,10 +166,6 @@ public class DraconicHoe extends ItemHoe implements IEnergyContainerItem{
|
||||
InfoHelper.addEnergyAndLore(stack, list);
|
||||
}
|
||||
|
||||
public static void registerRecipe() {
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicHoe), "ISI", "DHD", "ITI", 'H', Items.diamond_hoe, 'T', ModItems.draconicCore, 'S', ModItems.sunFocus, 'D', ModItems.draconiumIngot, 'I', Items.diamond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+5
-10
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -41,7 +40,7 @@ public class DraconicPickaxe extends ItemPickaxe implements IEnergyContainerItem
|
||||
public DraconicPickaxe() {
|
||||
super(ModItems.DRACONIUM_T2);
|
||||
this.setUnlocalizedName(Strings.draconicPickaxeName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.draconicPickaxeName);
|
||||
}
|
||||
|
||||
@@ -50,6 +49,7 @@ public class DraconicPickaxe extends ItemPickaxe implements IEnergyContainerItem
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
@@ -147,11 +147,6 @@ public class DraconicPickaxe extends ItemPickaxe implements IEnergyContainerItem
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicPickaxe), "ISI", "DPD", "ITI", 'P', ModItems.wyvernPickaxe, 'D', ModItems.draconicCompound, 'S', ModItems.sunFocus, 'T', ModItems.draconicCore, 'I', ModItems.draconiumIngot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+6
-11
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -41,7 +40,7 @@ public class DraconicShovel extends ItemSpade implements IEnergyContainerItem{
|
||||
public DraconicShovel() {
|
||||
super(ModItems.DRACONIUM_T2);
|
||||
this.setUnlocalizedName(Strings.draconicShovelName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.draconicShovelName);
|
||||
}
|
||||
|
||||
@@ -50,7 +49,8 @@ public class DraconicShovel extends ItemSpade implements IEnergyContainerItem{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 0));
|
||||
@@ -152,11 +152,6 @@ public class DraconicShovel extends ItemSpade implements IEnergyContainerItem{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicShovel), "ISI", "DPD", "ITI", 'P', ModItems.wyvernShovel, 'D', ModItems.draconicCompound, 'S', ModItems.sunFocus, 'T', ModItems.draconicCore, 'I', ModItems.draconiumIngot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.items.ItemDE;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 24/11/2014.
|
||||
*/
|
||||
public class DraconiumFluxCapacitor extends ItemDE implements IEnergyContainerItem{
|
||||
IIcon[] icons = new IIcon[2];
|
||||
public DraconiumFluxCapacitor()
|
||||
{
|
||||
this.setUnlocalizedName(Strings.draconiumFluxCapacitorName);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icons[0] = iconRegister.registerIcon(getUnwrappedUnlocalizedName(super.getUnlocalizedName())+0);
|
||||
icons[1] = iconRegister.registerIcon(getUnwrappedUnlocalizedName(super.getUnlocalizedName())+1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 0));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", getCapacity(0)));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 1), "Energy", 0));
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 1), "Energy", getCapacity(1)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
return super.getUnlocalizedName(itemStack)+itemStack.getItemDamage();
|
||||
}
|
||||
|
||||
private int getCapacity(int damage){
|
||||
return damage == 0 ? 80000000 : damage == 1 ? 250000000 : 0;
|
||||
}
|
||||
|
||||
private int getTransfer(int damage){
|
||||
return damage == 0 ? 100000 : damage == 1 ? 1000000 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack container, World world, Entity entity, int var1, boolean b) {
|
||||
if (!(entity instanceof EntityPlayer)) return;
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
|
||||
int mode = ItemNBTHelper.getShort(container, "Mode", (short)0);
|
||||
|
||||
if (mode == 1 || mode == 3){ //Charge Hotbar
|
||||
for (int i = 0; i < 9; i++){
|
||||
int max = Math.min(getEnergyStored(container), getTransfer(container.getItemDamage()));
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
|
||||
if (stack != null && stack.getItem() instanceof IEnergyContainerItem && stack.getItem() != ModItems.draconiumFluxCapacitor) {
|
||||
IEnergyContainerItem item = (IEnergyContainerItem)stack.getItem();
|
||||
extractEnergy(container, item.receiveEnergy(stack, max, false), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == 2 || mode == 3){ //Charge Armor and held item
|
||||
for (int i = mode == 3 ? 1 : 0; i < 5; i++){
|
||||
int max = Math.min(getEnergyStored(container), getTransfer(container.getItemDamage()));
|
||||
ItemStack stack = player.getEquipmentInSlot(i);
|
||||
|
||||
if (stack != null && stack.getItem() instanceof IEnergyContainerItem && stack.getItem() != ModItems.draconiumFluxCapacitor) {
|
||||
IEnergyContainerItem item = (IEnergyContainerItem)stack.getItem();
|
||||
extractEnergy(container, item.receiveEnergy(stack, max, false), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack, int pass) {
|
||||
return ItemNBTHelper.getShort(stack, "Mode", (short)0) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (player.isSneaking()){
|
||||
int mode = ItemNBTHelper.getShort(stack, "Mode", (short)0);
|
||||
int newMode = mode == 3 ? 0 : mode + 1;
|
||||
ItemNBTHelper.setShort(stack, "Mode", (short) newMode);
|
||||
if (world.isRemote) player.addChatComponentMessage(new ChatComponentTranslation(InfoHelper.ITC()+StatCollector.translateToLocal("info.de.capacitorMode.txt")+": "+InfoHelper.HITC()+StatCollector.translateToLocal("info.de.capacitorMode"+ItemNBTHelper.getShort(stack, "Mode", (short)0)+".txt")));
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null) {
|
||||
container.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyReceived = Math.min(getCapacity(container.getItemDamage()) - energy, Math.min(getTransfer(container.getItemDamage()), maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyExtracted = Math.min(energy, Math.min(getTransfer(container.getItemDamage()), maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
return container.stackTagCompound.getInteger("Energy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
return getCapacity(container.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return !(getEnergyStored(stack) == getMaxEnergyStored(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
return 1D - ((double)getEnergyStored(stack) / (double)getMaxEnergyStored(stack));
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean extraInformation)
|
||||
{
|
||||
if (InfoHelper.holdShiftForDetails(list)){
|
||||
InfoHelper.addEnergyInfo(stack, list);
|
||||
list.add(StatCollector.translateToLocal("info.de.changwMode.txt"));
|
||||
list.add(InfoHelper.ITC()+StatCollector.translateToLocal("info.de.capacitorMode.txt")+": "+InfoHelper.HITC()+StatCollector.translateToLocal("info.de.capacitorMode"+ItemNBTHelper.getShort(stack, "Mode", (short)0)+".txt"));
|
||||
InfoHelper.addLore(stack, list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World world, Entity location, ItemStack itemstack) {
|
||||
return new EntityPersistentItem(world, location, itemstack);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
public class EnderArrow extends ItemDE {
|
||||
public EnderArrow(){
|
||||
this.setUnlocalizedName(Strings.enderArrowName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import net.minecraft.world.World;
|
||||
public class ObliterationCatalyst extends ItemDE {
|
||||
public ObliterationCatalyst(){
|
||||
this.setUnlocalizedName(Strings.obliterationCatalystName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SafetyMatch extends ItemDE {
|
||||
public SafetyMatch()
|
||||
{
|
||||
this.setUnlocalizedName(Strings.safetyMatchName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setHasSubtypes(true);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
+5
-12
@@ -1,23 +1,21 @@
|
||||
package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.Teleporter;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.items.ItemDE;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.Teleporter;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@@ -32,7 +30,7 @@ public class TeleporterMKI extends ItemDE
|
||||
|
||||
public TeleporterMKI() {
|
||||
this.setUnlocalizedName(Strings.teleporterMKIName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setMaxDamage(19);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
@@ -125,7 +123,7 @@ public class TeleporterMKI extends ItemDE
|
||||
player.setHealth(player.getHealth() - 2);
|
||||
|
||||
travelEffect(world, player);
|
||||
Teleporter.teleport(player, x, y, z, yaw, pitch, dim);
|
||||
Teleporter.teleport(player, x, y+0.3, z, yaw, pitch, dim);
|
||||
travelEffect(world, player);
|
||||
|
||||
} else if (world.isRemote && player.getHealth() <= 2 && !player.capabilities.isCreativeMode)
|
||||
@@ -181,11 +179,6 @@ public class TeleporterMKI extends ItemDE
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.teleporterMKI), "BDB", "DED", "BDB", 'D', ModItems.draconiumDust, 'E', Items.ender_eye, 'B', Items.blaze_powder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
|
||||
+7
-15
@@ -3,13 +3,14 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.handler.ToolHudHandler;
|
||||
import com.brandon3055.draconicevolution.client.interfaces.GuiHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.Teleporter.TeleportLocation;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.items.ItemDE;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.Teleporter.TeleportLocation;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -19,14 +20,12 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,7 +34,7 @@ public class TeleporterMKII extends ItemDE
|
||||
|
||||
public TeleporterMKII() {
|
||||
this.setUnlocalizedName(Strings.teleporterMKIIName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setMaxStackSize(1);
|
||||
ModItems.register(this);
|
||||
//GameRegistry.registerItem(this, Strings.teleporterMKIIName);
|
||||
@@ -149,10 +148,8 @@ public class TeleporterMKII extends ItemDE
|
||||
String selectedDest = list.getCompoundTagAt(selected+selrctionOffset).getString("Name");
|
||||
|
||||
list2.add(EnumChatFormatting.GOLD + "" + selectedDest);
|
||||
if ((!Keyboard.isKeyDown(42)) && (!Keyboard.isKeyDown(54))) {
|
||||
list2.add(EnumChatFormatting.DARK_GREEN + "Hold shift for information");
|
||||
}
|
||||
else {
|
||||
if (InfoHelper.holdShiftForDetails(list2))
|
||||
{
|
||||
list2.add(EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.teleporterInfFuel.txt") + " " + ItemNBTHelper.getInteger(teleporter, "Fuel", 0));
|
||||
list2.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("info.teleporterInfGUI.txt"));
|
||||
list2.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("info.teleporterInfScroll.txt"));
|
||||
@@ -165,11 +162,6 @@ public class TeleporterMKII extends ItemDE
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.teleporterMKII), "BIB", "DED", "BIB", 'D', ModItems.draconicCore, 'E', ModItems.teleporterMKI, 'B', ModItems.draconiumIngot, 'I', ModItems.infusedCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
|
||||
+6
-12
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -18,12 +18,10 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -41,7 +39,7 @@ public class WyvernPickaxe extends ItemPickaxe implements IEnergyContainerItem{
|
||||
public WyvernPickaxe() {
|
||||
super(ModItems.DRACONIUM_T1);
|
||||
this.setUnlocalizedName(Strings.wyvernPickaxeName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.wyvernPickaxeName);
|
||||
}
|
||||
|
||||
@@ -50,7 +48,8 @@ public class WyvernPickaxe extends ItemPickaxe implements IEnergyContainerItem{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
list.add(ItemNBTHelper.setInteger(new ItemStack(item, 1, 0), "Energy", 0));
|
||||
@@ -139,11 +138,6 @@ public class WyvernPickaxe extends ItemPickaxe implements IEnergyContainerItem{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernPickaxe), " C ", "CPC", " C ", 'C', ModItems.infusedCompound, 'P', Items.diamond_pickaxe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+5
-11
@@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -18,12 +18,10 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -41,7 +39,7 @@ public class WyvernShovel extends ItemSpade implements IEnergyContainerItem{
|
||||
public WyvernShovel() {
|
||||
super(ModItems.DRACONIUM_T1);
|
||||
this.setUnlocalizedName(Strings.wyvernShovelName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.wyvernShovelName);
|
||||
}
|
||||
|
||||
@@ -50,6 +48,7 @@ public class WyvernShovel extends ItemSpade implements IEnergyContainerItem{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("all")
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
@@ -138,11 +137,6 @@ public class WyvernShovel extends ItemSpade implements IEnergyContainerItem{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernShovel), " C ", "CDC", " C ", 'C', ModItems.infusedCompound, 'D', Items.diamond_shovel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+4
-10
@@ -1,12 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -36,7 +35,7 @@ public class DraconicBow extends ItemBow
|
||||
public DraconicBow() {
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(-1);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setUnlocalizedName(Strings.draconicBowName);
|
||||
GameRegistry.registerItem(this, Strings.draconicBowName);
|
||||
}
|
||||
@@ -209,11 +208,6 @@ public class DraconicBow extends ItemBow
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicBow), "ISI", "DBD", "ICI", 'B', ModItems.wyvernBow, 'D', ModItems.draconicCompound, 'S', ModItems.sunFocus, 'C', ModItems.draconicCore, 'I', ModItems.draconiumIngot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
|
||||
+4
-10
@@ -2,13 +2,13 @@ package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
@@ -35,7 +34,7 @@ public class DraconicSword extends ItemSword implements IEnergyContainerItem{
|
||||
public DraconicSword() {
|
||||
super(ModItems.DRACONIUM_T2);
|
||||
this.setUnlocalizedName(Strings.draconicSwordName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.draconicSwordName);
|
||||
}
|
||||
|
||||
@@ -94,11 +93,6 @@ public class DraconicSword extends ItemSword implements IEnergyContainerItem{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicSword), "ISI", "DPD", "ITI", 'P', ModItems.wyvernSword, 'D', ModItems.draconicCompound, 'S', ModItems.sunFocus, 'T', ModItems.draconicCore, 'I', ModItems.draconiumIngot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
|
||||
+4
-10
@@ -1,12 +1,12 @@
|
||||
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -35,7 +34,7 @@ public class WyvernBow extends ItemBow {
|
||||
public WyvernBow() {
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(-1);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
this.setUnlocalizedName(Strings.wyvernBowName);
|
||||
GameRegistry.registerItem(this, Strings.wyvernBowName);
|
||||
}
|
||||
@@ -176,11 +175,6 @@ public class WyvernBow extends ItemBow {
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernBow), " I ", "CBC", " I ", 'C', ModItems.infusedCompound, 'B', Items.bow, 'I', ModItems.draconiumIngot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack) {
|
||||
return true;
|
||||
|
||||
+4
-11
@@ -2,13 +2,13 @@ package com.brandon3055.draconicevolution.common.items.weapons;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -17,12 +17,10 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
@@ -38,7 +36,7 @@ public class WyvernSword extends ItemSword implements IEnergyContainerItem{
|
||||
public WyvernSword() {
|
||||
super(ModItems.DRACONIUM_T1);
|
||||
this.setUnlocalizedName(Strings.wyvernSwordName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setCreativeTab(DraconicEvolution.tabToolsWeapons);
|
||||
GameRegistry.registerItem(this, Strings.wyvernSwordName);
|
||||
}
|
||||
|
||||
@@ -100,11 +98,6 @@ public class WyvernSword extends ItemSword implements IEnergyContainerItem{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
public static void registerRecipe()
|
||||
{
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.wyvernSword), " C ", "CSC", " C ", 'C', ModItems.infusedCompound, 'S', Items.diamond_sword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.brandon3055.draconicevolution.common.lib;
|
||||
public final class References {
|
||||
public static final String MODID = "DraconicEvolution";
|
||||
public static final String MODNAME = "Draconic Evolution";
|
||||
public static final String VERSION = "0.9.5-Beta";
|
||||
public static final String VERSION = "1.0.0";
|
||||
public static final String MCVERSION = "1.7.10";
|
||||
public static final String CLIENTPROXYLOCATION = "com.brandon3055.draconicevolution.client.ClientProxy";
|
||||
public static final String COMMONPROXYLOCATION = "com.brandon3055.draconicevolution.common.CommonProxy";
|
||||
@@ -13,11 +13,11 @@ public final class References {
|
||||
|
||||
//======================Tools & Weapons========================//
|
||||
public static final int WYVERNCAPACITY = 1000000;
|
||||
public static final int WYVERNTRANSFER = 1000;
|
||||
public static final int WYVERNTRANSFER = 5000;
|
||||
public static final int DRACONICCAPACITY = 10000000;
|
||||
public static final int DRACONICTRANSFER = 10000;
|
||||
public static final int ENERGYPERBLOCK = 450;
|
||||
public static final int ENERGYPERATTACK = 1000;
|
||||
public static final int DRACONICTRANSFER = 50000;
|
||||
public static final int ENERGYPERBLOCK = 80;
|
||||
public static final int ENERGYPERATTACK = 250;
|
||||
|
||||
//======================Render IDs========================//
|
||||
public static int idTeleporterStand = -1;
|
||||
|
||||
@@ -9,7 +9,7 @@ public class Strings {// public sta
|
||||
public static final String draconicCoreName = "draconicCore";
|
||||
public static final String draconicPickaxeName = "draconicPickaxe";
|
||||
public static final String draconicSwordName = "draconicSword";
|
||||
public static final String infusedCompoundName = "infusedCompound";
|
||||
public static final String infusedCompoundName = "wyvernCore";
|
||||
public static final String draconiumDustName = "draconiumDust";
|
||||
public static final String draconiumIngotName = "draconiumIngot";
|
||||
public static final String draconiumBlendName = "draconiumBlend";
|
||||
@@ -18,7 +18,7 @@ public class Strings {// public sta
|
||||
public static final String wyvernShovelName = "wyvernShovel";
|
||||
public static final String wyvernPickaxeName = "wyvernPickaxe";
|
||||
public static final String draconicDStaffName = "draconicDistructionStaff";
|
||||
public static final String draconicCompoundName = "draconicCompound";
|
||||
public static final String draconicCompoundName = "awakenedCore";
|
||||
public static final String wyvernSwordName = "wyvernSword";
|
||||
public static final String wyvernBowName = "wyvernBow";
|
||||
public static final String draconicBowName = "draconicBow";
|
||||
@@ -30,7 +30,6 @@ public class Strings {// public sta
|
||||
public static final String grinderName = "grinder";
|
||||
public static final String potentiometerName = "potentiometer";
|
||||
public static final String rainSensorName = "rainSensor";
|
||||
public static final String readerName = "reader";
|
||||
public static final String particleGeneratorName = "particleGenerator";
|
||||
public static final String playerDetectorName = "playerDetector";
|
||||
public static final String playerDetectorAdvancedName = "playerDetectorAdvanced";
|
||||
@@ -48,7 +47,7 @@ public class Strings {// public sta
|
||||
public static final String longRangeDislocatorName = "longRangeDislocator";
|
||||
public static final String generatorName = "generator";
|
||||
public static final String energyStorageCoreName = "energyStorageCore";
|
||||
public static final String draconiumName = "draconium";
|
||||
public static final String draconiumBlockName = "draconium";
|
||||
public static final String invisibleMultiblockName = "invisibleMultiblock";
|
||||
public static final String energyPylonName = "energyPylon";
|
||||
public static final String placedItemName = "placedItem";
|
||||
@@ -65,4 +64,8 @@ public class Strings {// public sta
|
||||
public static final String dissEnchanterName = "dissEnchanter";
|
||||
public static final String teleporterStandName = "teleporterStand";
|
||||
public static final String draconiumChestName = "draconiumChest";
|
||||
public static final String draconicIngotName = "draconicIngot";
|
||||
public static final String draconicBlockName = "draconicBlock";
|
||||
public static final String draconiumEnergyCoreName = "draconiumEnergyCore";
|
||||
public static final String draconiumFluxCapacitorName = "draconiumFluxCapacitor";
|
||||
}
|
||||
+6
@@ -1,5 +1,11 @@
|
||||
package com.brandon3055.draconicevolution.common.plugins.nei;
|
||||
|
||||
//import codechicken.lib.inventory.InventoryUtils;
|
||||
//import codechicken.nei.FastTransferManager;
|
||||
//import codechicken.nei.PositionedStack;
|
||||
//import codechicken.nei.api.IOverlayHandler;
|
||||
//import codechicken.nei.recipe.IRecipeHandler;
|
||||
|
||||
import codechicken.lib.inventory.InventoryUtils;
|
||||
import codechicken.nei.FastTransferManager;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
+3
-2
@@ -4,15 +4,16 @@ import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import com.brandon3055.draconicevolution.client.interfaces.GUIDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 30/10/2014.
|
||||
*/
|
||||
public class NEIDraconicevolutionConfig implements IConfigureNEI {
|
||||
public class NEIDraconicevolutionConfig implements IConfigureNEI
|
||||
{
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
|
||||
+12
-3
@@ -10,8 +10,10 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
@@ -60,6 +62,7 @@ public abstract class CustomSpawnerBaseLogic {
|
||||
* The range coefficient for spawning entities around.
|
||||
*/
|
||||
private int spawnRange = 4;
|
||||
public int skeletonType = 0;
|
||||
/**
|
||||
* Gets the entity name that should be spawned.
|
||||
*/
|
||||
@@ -155,8 +158,11 @@ public abstract class CustomSpawnerBaseLogic {
|
||||
|
||||
public Entity spawnEntity(Entity par1Entity) {
|
||||
if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null) {
|
||||
|
||||
((EntityLiving) par1Entity).onSpawnWithEgg((IEntityLivingData) null);
|
||||
if (par1Entity instanceof EntitySkeleton) {
|
||||
((EntitySkeleton)par1Entity).setSkeletonType(skeletonType);
|
||||
par1Entity.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword));
|
||||
((EntitySkeleton) par1Entity).setEquipmentDropChance(0, 0f);
|
||||
} else ((EntityLiving) par1Entity).onSpawnWithEgg(null);
|
||||
this.getSpawnerWorld().spawnEntityInWorld(par1Entity);
|
||||
}
|
||||
|
||||
@@ -181,6 +187,7 @@ public abstract class CustomSpawnerBaseLogic {
|
||||
spawnSpeed = par1NBTTagCompound.getShort("Speed");
|
||||
requiresPlayer = par1NBTTagCompound.getBoolean("RequiresPlayer");
|
||||
ignoreSpawnRequirements = par1NBTTagCompound.getBoolean("IgnoreSpawnRequirements");
|
||||
skeletonType = par1NBTTagCompound.getInteger("SkeletonType");
|
||||
|
||||
if (par1NBTTagCompound.hasKey("MinSpawnDelay", 99)) {
|
||||
this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay");
|
||||
@@ -215,6 +222,7 @@ public abstract class CustomSpawnerBaseLogic {
|
||||
par1NBTTagCompound.setShort("Speed", (short) spawnSpeed);
|
||||
par1NBTTagCompound.setBoolean("RequiresPlayer", requiresPlayer);
|
||||
par1NBTTagCompound.setBoolean("IgnoreSpawnRequirements", ignoreSpawnRequirements);
|
||||
par1NBTTagCompound.setInteger("SkeletonType", skeletonType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,6 +242,7 @@ public abstract class CustomSpawnerBaseLogic {
|
||||
if (this.renderedEntity == null) {
|
||||
Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World) null);
|
||||
entity = this.spawnEntity(entity);
|
||||
if (entity instanceof EntitySkeleton) ((EntitySkeleton)entity).setSkeletonType(skeletonType);
|
||||
this.renderedEntity = entity;
|
||||
}
|
||||
|
||||
|
||||
-55
@@ -1,11 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.common.tileentities;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergy;
|
||||
import com.brandon3055.draconicevolution.common.handler.ParticleHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -13,20 +7,12 @@ 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.world.World;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class TileCustomSpawner extends TileEntity
|
||||
{
|
||||
public boolean isSetToSpawn = false;
|
||||
public boolean trySet = false;
|
||||
public EntityPlayer owner;
|
||||
private EntityLivingBase target;
|
||||
private int setTick = 0;
|
||||
boolean foundTarget = false;
|
||||
|
||||
private final CustomSpawnerBaseLogic spawnerBaseLogic = new CustomSpawnerBaseLogic(){
|
||||
public void blockEvent(int par1)
|
||||
@@ -125,45 +111,4 @@ public class TileCustomSpawner extends TileEntity
|
||||
{
|
||||
return spawnerBaseLogic;
|
||||
}
|
||||
|
||||
private boolean findTargetEntity(){
|
||||
List<EntityLivingBase> candidates = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord+0.5 - 2.5, yCoord+0.5 - 1, zCoord+0.5 - 2.5, xCoord+0.5 + 2.5, yCoord+0.5 + 2, zCoord+0.5 + 2.5));
|
||||
|
||||
if (candidates.isEmpty())
|
||||
return false;
|
||||
|
||||
Iterator<EntityLivingBase> i = candidates.iterator();
|
||||
while(i.hasNext())
|
||||
{
|
||||
EntityLivingBase ent = i.next();
|
||||
if (!(ent instanceof EntityPlayer))
|
||||
{
|
||||
target = ent;
|
||||
LogHelper.info(target);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnParticles(boolean flag){
|
||||
if (!flag) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
float rotation = worldObj.rand.nextFloat() * 6.5F;
|
||||
double x = (double) xCoord + 0.5 + (Math.sin(rotation) * 3);
|
||||
double y = (double) yCoord - 1 + worldObj.rand.nextInt(4);
|
||||
double z = (double) zCoord + 0.5 + (Math.cos(rotation) * 3);
|
||||
ParticleEnergy particle = new ParticleEnergy(worldObj, x, y, z, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 0, false);
|
||||
ParticleHandler.spawnCustomParticle(particle, 20);
|
||||
}
|
||||
}else
|
||||
{
|
||||
double x = (double) xCoord + (worldObj.rand.nextDouble());
|
||||
double y = (double) yCoord + (double)target.getEyeHeight() + worldObj.rand.nextDouble();
|
||||
double z = (double) zCoord + (worldObj.rand.nextDouble());
|
||||
ParticleEnergy particle = new ParticleEnergy(worldObj, x, y, z, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 0);
|
||||
ParticleHandler.spawnCustomParticle(particle, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-16
@@ -22,7 +22,7 @@ import java.util.Random;
|
||||
/**
|
||||
* Created by Brandon on 27/06/2014.
|
||||
*/
|
||||
public class TileEnergyInfuser extends TileObjectSync implements IEnergyHandler, ISidedInventory {
|
||||
public class TileEnergyInfuser extends TileObjectSync implements IEnergyHandler, ISidedInventory {//todo fix display not working when buffer is empty
|
||||
ItemStack[] items = new ItemStack[1];
|
||||
public EnergyStorage energy = new EnergyStorage(1000000);
|
||||
public int maxInput = 81920;
|
||||
@@ -44,6 +44,9 @@ public class TileEnergyInfuser extends TileObjectSync implements IEnergyHandler,
|
||||
return;
|
||||
}
|
||||
|
||||
if(worldObj.isRemote) return;
|
||||
|
||||
|
||||
if (tick % 100 == 0) tryStartOrStop();
|
||||
if (tick % 400 == 0) detectAndSendChanges(true);
|
||||
|
||||
@@ -51,11 +54,8 @@ public class TileEnergyInfuser extends TileObjectSync implements IEnergyHandler,
|
||||
if(running && tryStartOrStop())
|
||||
{
|
||||
IEnergyContainerItem item = (IEnergyContainerItem)items[0].getItem();
|
||||
// if (energy.extractEnergy(item.receiveEnergy(items[0], energy.getEnergyStored(), false), false) > 0 && !transfer)
|
||||
// setTransfer(true);
|
||||
// else if (energy.extractEnergy(item.receiveEnergy(items[0], energy.getEnergyStored(), false), false) <= 0 && transfer)
|
||||
setTransfer(energy.extractEnergy(item.receiveEnergy(items[0], energy.getEnergyStored(), false), false) > 0);
|
||||
}
|
||||
setTransfer(energy.extractEnergy(item.receiveEnergy(items[0], energy.getEnergyStored(), false), false) > 0);
|
||||
}else setTransfer(false);
|
||||
|
||||
detectAndSendChanges(false);
|
||||
tick++;
|
||||
@@ -65,20 +65,12 @@ public class TileEnergyInfuser extends TileObjectSync implements IEnergyHandler,
|
||||
if (items[0] != null && items[0].stackSize == 1 && items[0] != null && items[0].getItem() instanceof IEnergyContainerItem) {
|
||||
IEnergyContainerItem item = (IEnergyContainerItem)items[0].getItem();
|
||||
if (item.getEnergyStored(items[0]) < item.getMaxEnergyStored(items[0])) {
|
||||
|
||||
running = true;
|
||||
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
}else{
|
||||
|
||||
running = false;
|
||||
//worldObj.markBlockForUpdate(xCoord, yCoord ,zCoord);
|
||||
|
||||
}
|
||||
}else {
|
||||
|
||||
running = false;
|
||||
//worldObj.markBlockForUpdate(xCoord, yCoord ,zCoord);
|
||||
}
|
||||
|
||||
return running;
|
||||
@@ -182,8 +174,12 @@ public class TileEnergyInfuser extends TileObjectSync implements IEnergyHandler,
|
||||
}
|
||||
|
||||
public void detectAndSendChanges(boolean sendAnyway){
|
||||
if (runningCach != running || sendAnyway) runningCach = (Boolean)sendObject(ObjectPacket.BOOLEAN, 0, running);
|
||||
if (transferCach != transfer || sendAnyway) transferCach = (Boolean)sendObject(ObjectPacket.BOOLEAN, 1, transfer);
|
||||
if (runningCach != running || sendAnyway) {
|
||||
runningCach = (Boolean)sendObject(ObjectPacket.BOOLEAN, 0, running);
|
||||
}
|
||||
if (transferCach != transfer || sendAnyway) {
|
||||
transferCach = (Boolean)sendObject(ObjectPacket.BOOLEAN, 1, transfer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+38
-13
@@ -3,6 +3,7 @@ package com.brandon3055.draconicevolution.common.tileentities;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import com.brandon3055.draconicevolution.common.network.ObjectPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.EnergyStorage;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -25,6 +26,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
public class TileGrinder extends TileObjectSync implements ISidedInventory, IEnergyHandler {
|
||||
@@ -33,9 +35,9 @@ public class TileGrinder extends TileObjectSync implements ISidedInventory, IEne
|
||||
List<EntityLiving> killList;
|
||||
AxisAlignedBB killBox;
|
||||
int tick = 0;
|
||||
double centreX;
|
||||
double centreY = -1;
|
||||
double centreZ;
|
||||
public double centreX;
|
||||
public double centreY = -1;
|
||||
public double centreZ;
|
||||
private ItemStack[] items;
|
||||
public int burnTime = 1;
|
||||
public int burnTimeRemaining = 0;
|
||||
@@ -47,6 +49,7 @@ public class TileGrinder extends TileObjectSync implements ISidedInventory, IEne
|
||||
public EnergyStorage internalGenBuffer = new EnergyStorage(20000, 32000, 0);
|
||||
public EnergyStorage externalInputBuffer = new EnergyStorage(100000, 32000, 0);
|
||||
public int energyPerKill = 1000;
|
||||
private static Field recentlyHit;
|
||||
|
||||
public void updateVariables() {
|
||||
if (meta == -1) meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
@@ -55,20 +58,20 @@ public class TileGrinder extends TileObjectSync implements ISidedInventory, IEne
|
||||
case 0:
|
||||
centreX = xCoord + 0.5;
|
||||
centreY = yCoord + 0.5;
|
||||
centreZ = zCoord + 0.5 - 4;
|
||||
centreZ = zCoord + 0.5 - 5;
|
||||
break;
|
||||
case 1:
|
||||
centreX = xCoord + 0.5 + 4;
|
||||
centreX = xCoord + 0.5 + 5;
|
||||
centreY = yCoord + 0.5;
|
||||
centreZ = zCoord + 0.5;
|
||||
break;
|
||||
case 2:
|
||||
centreX = xCoord + 0.5;
|
||||
centreY = yCoord + 0.5;
|
||||
centreZ = zCoord + 0.5 + 4;
|
||||
centreZ = zCoord + 0.5 + 5;
|
||||
break;
|
||||
case 3:
|
||||
centreX = xCoord + 0.5 - 4;
|
||||
centreX = xCoord + 0.5 - 5;
|
||||
centreY = yCoord + 0.5;
|
||||
centreZ = zCoord + 0.5;
|
||||
break;
|
||||
@@ -84,9 +87,11 @@ public class TileGrinder extends TileObjectSync implements ISidedInventory, IEne
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (worldObj.isRemote) return;
|
||||
|
||||
updateVariables();
|
||||
if (worldObj.isRemote) return;
|
||||
|
||||
|
||||
int burnSpeed = 2;
|
||||
int EPBT = 10;
|
||||
|
||||
@@ -138,16 +143,26 @@ public class TileGrinder extends TileObjectSync implements ISidedInventory, IEne
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean killNextEntity() {
|
||||
if (worldObj.isRemote) return false;
|
||||
killBox = AxisAlignedBB.getBoundingBox(centreX - 3.5, centreY - 1, centreZ - 3.5, centreX + 3.5, centreY + 3, centreZ + 3.5);
|
||||
killBox = AxisAlignedBB.getBoundingBox(centreX - 4.5, centreY - 4.5, centreZ - 4.5, centreX + 4.5, centreY + 4.5, centreZ + 4.5);
|
||||
|
||||
killList = worldObj.getEntitiesWithinAABB(EntityLiving.class, killBox);
|
||||
|
||||
if (killList.size() > 0) {
|
||||
EntityLiving mob = killList.get(worldObj.rand.nextInt(killList.size()));
|
||||
if (mob instanceof EntityCreature) {
|
||||
if (mob.isEntityAlive()) {
|
||||
ReflectionHelper.setPrivateValue(EntityLivingBase.class, mob, 60, new String[]{"recentlyHit", "field_70718_bc"});
|
||||
if (recentlyHit == null) {
|
||||
recentlyHit = ReflectionHelper.findField(EntityLivingBase.class, "recentlyHit", "field_70718_bc");
|
||||
recentlyHit.setAccessible(true);
|
||||
}
|
||||
try {
|
||||
recentlyHit.setInt(mob, 60);
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
LogHelper.error(e);
|
||||
}
|
||||
|
||||
mob.attackEntityFrom(DamageSource.generic, 50000F);
|
||||
//mob.attackEntityFrom(DamageSource.causePlayerDamage(DEFakePlayerFactory.getPlayer((WorldServer) mob.worldObj)), 50000F);
|
||||
readyNext = true;
|
||||
return true;
|
||||
}
|
||||
@@ -155,9 +170,19 @@ public class TileGrinder extends TileObjectSync implements ISidedInventory, IEne
|
||||
return false;
|
||||
} else {
|
||||
if (mob.isEntityAlive()) {
|
||||
ReflectionHelper.setPrivateValue(EntityLivingBase.class, mob, 60, new String[]{"recentlyHit", "field_70718_bc"});
|
||||
if (recentlyHit == null) {
|
||||
recentlyHit = ReflectionHelper.findField(EntityLivingBase.class, "recentlyHit", "field_70718_bc");
|
||||
recentlyHit.setAccessible(true);
|
||||
}
|
||||
try {
|
||||
recentlyHit.setInt(mob, 60);
|
||||
LogHelper.info(recentlyHit.getInt(mob));
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
LogHelper.error(e);
|
||||
}
|
||||
|
||||
mob.attackEntityFrom(DamageSource.generic, 50000F);
|
||||
//mob.attackEntityFrom(DamageSource.causePlayerDamage(DEFakePlayerFactory.getPlayer((WorldServer) mob.worldObj)), 50000F);
|
||||
readyNext = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
/**
|
||||
* Created by Brandon on 27/06/2014.
|
||||
*/
|
||||
public class TileTeleporterStand extends TileEntity implements IInventory {
|
||||
public class TileTeleporterStand extends TileEntity implements IInventory {//todo Create IRotatable Tile and gui
|
||||
ItemStack[] items = new ItemStack[1];
|
||||
public int rotation = 0;
|
||||
|
||||
|
||||
+3
-3
@@ -205,7 +205,7 @@ public class TileEnderResurrection extends TileEntity{
|
||||
if (spawnInProgress) {
|
||||
for (int i = 0; i < draconiumPillars.length; i++){
|
||||
if (draconiumPillars[i] == null || !arePillarsValid()) return false;
|
||||
worldObj.setBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord(), draconiumPillars[i].getZCoord(), ModBlocks.draconium);
|
||||
worldObj.setBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord(), draconiumPillars[i].getZCoord(), ModBlocks.draconiumBlock);
|
||||
}
|
||||
flag = false;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class TileEnderResurrection extends TileEntity{
|
||||
}
|
||||
for (int i = 0; i < draconiumPillars.length; i++){
|
||||
if (draconiumPillars[i] == null) return false;
|
||||
if ((worldObj.getBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord(), draconiumPillars[i].getZCoord()) != ModBlocks.draconium && worldObj.getBlockMetadata(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord(), draconiumPillars[i].getZCoord()) != 2) || worldObj.getBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord()-1, draconiumPillars[i].getZCoord()) != Blocks.quartz_block || worldObj.getBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord()-2, draconiumPillars[i].getZCoord()) != Blocks.quartz_block) return false;
|
||||
if ((worldObj.getBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord(), draconiumPillars[i].getZCoord()) != ModBlocks.draconiumBlock && worldObj.getBlockMetadata(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord(), draconiumPillars[i].getZCoord()) != 2) || worldObj.getBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord()-1, draconiumPillars[i].getZCoord()) != Blocks.quartz_block || worldObj.getBlock(draconiumPillars[i].getXCoord(), draconiumPillars[i].getYCoord()-2, draconiumPillars[i].getZCoord()) != Blocks.quartz_block) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public class TileEnderResurrection extends TileEntity{
|
||||
for (int x = xCoord - xzRange; x < xCoord + xzRange; x++){
|
||||
for (int y = yCoord +2; y < yCoord + 5; y++){
|
||||
for (int z = zCoord - xzRange; z < zCoord + xzRange; z++){
|
||||
if (worldObj.getBlock(x, y, z) == ModBlocks.draconium && isPillarValid(0, x, y, z) && worldObj.getBlockMetadata(x, y, z) == 2 && draconiumCount < 4){
|
||||
if (worldObj.getBlock(x, y, z) == ModBlocks.draconiumBlock && isPillarValid(0, x, y, z) && worldObj.getBlockMetadata(x, y, z) == 2 && draconiumCount < 4){
|
||||
draconiumPillars[draconiumCount] = new MultiblockHelper.TileLocation(x, y, z);
|
||||
draconiumCount++;
|
||||
}
|
||||
|
||||
+3
-2
@@ -21,7 +21,7 @@ import java.util.Random;
|
||||
/**
|
||||
* Created by Brandon on 28/07/2014.
|
||||
*/
|
||||
public class TileEnergyPylon extends TileEntity implements IEnergyHandler {
|
||||
public class TileEnergyPylon extends TileEntity implements IEnergyHandler {//todo optimize packets
|
||||
|
||||
protected EnergyStorage storage = new EnergyStorage(500000, 0, 0);
|
||||
public boolean active = false;
|
||||
@@ -85,6 +85,7 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
updateDelay = 20;
|
||||
}
|
||||
if (worldObj.isRemote) return;
|
||||
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);
|
||||
@@ -100,7 +101,7 @@ public class TileEnergyPylon extends TileEntity implements IEnergyHandler {
|
||||
if (updateDelay > 0){
|
||||
updateDelay--;
|
||||
if (particleRate > 0) particleRate--;
|
||||
}else if (storage.getEnergyStored() > 0 && getMaster().isOnline() && getMaster().getEnergyStored() < getMaster().getMaxEnergyStored()){
|
||||
}else if (storage.getEnergyStored() > 0 && getMaster().getEnergyStored() < getMaster().getMaxEnergyStored()){
|
||||
int maxSent = (int)Math.min(getMaster().getMaxEnergyStored() - getMaster().getEnergyStored(), storage.getEnergyStored());
|
||||
storage.modifyEnergyStored(-maxSent);
|
||||
getMaster().receiveEnergy(maxSent, false);
|
||||
|
||||
+38
-38
@@ -92,7 +92,7 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
for (int z = zCoord - 1; z <= zCoord + 1; z++) {
|
||||
if (worldObj.getBlock(x, y, z) == ModBlocks.invisibleMultiblock)
|
||||
{
|
||||
if (worldObj.getBlockMetadata(x, y, z) == 0) worldObj.setBlock(x, y, z, ModBlocks.draconium);
|
||||
if (worldObj.getBlockMetadata(x, y, z) == 0) worldObj.setBlock(x, y, z, ModBlocks.draconiumBlock);
|
||||
else if (worldObj.getBlockMetadata(x, y, z) == 1) worldObj.setBlock(x, y, z, Blocks.redstone_block);
|
||||
}
|
||||
}
|
||||
@@ -226,33 +226,33 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
if (!isAir(xCoord+1, yCoord+1, zCoord+1, setBlocks) || !isAir(xCoord-1, yCoord+1, zCoord-1, setBlocks) || !isAir(xCoord+1, yCoord+1, zCoord-1, setBlocks) || !isAir(xCoord-1, yCoord+1, zCoord+1, setBlocks) || !isAir(xCoord+1, yCoord-1, zCoord+1, setBlocks) || !isAir(xCoord-1, yCoord-1, zCoord-1, setBlocks) || !isAir(xCoord+1, yCoord-1, zCoord-1, setBlocks) || !isAir(xCoord-1, yCoord-1, zCoord+1, setBlocks)) return false;
|
||||
break;
|
||||
case 2:
|
||||
if (!testOrActivateRect(1, 1, 1, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(1, 1, 1, "draconiumBlock", setBlocks, activate)) return false;
|
||||
break;
|
||||
case 3:
|
||||
if (!testOrActivateSides(1, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateSides(1, "draconiumBlock", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(1, 1, 1, "redstone", setBlocks, activate)) return false;
|
||||
break;
|
||||
case 4:
|
||||
if (!testOrActivateSides(2, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateSides(2, "draconiumBlock", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(2, 1, 1, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(1, 2, 1, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(1, 1, 2, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(2, 2, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(2, 2, "draconiumBlock", setBlocks, activate)) return false;
|
||||
break;
|
||||
case 5:
|
||||
if (!testOrActivateSides(3, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateSides(3, "draconiumBlock", setBlocks, activate)) return false;
|
||||
if (!testOrActivateSides(2, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(2, 2, 2, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(2, 3, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(2, 3, "draconiumBlock", setBlocks, activate)) return false;
|
||||
break;
|
||||
case 6:
|
||||
if (!testOrActivateSides(4, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateSides(4, "draconiumBlock", setBlocks, activate)) return false;
|
||||
if (!testOrActivateSides(3, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(3, 2, 2, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(2, 3, 2, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRect(2, 2, 3, "redstone", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(2, 4, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(3, 3, "draconium", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(2, 4, "draconiumBlock", setBlocks, activate)) return false;
|
||||
if (!testOrActivateRings(3, 3, "draconiumBlock", setBlocks, activate)) return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -269,10 +269,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && y == yCoord && z == zCoord) && !testForOrActivateRedstone(x, y, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && y == yCoord && z == zCoord) && !testForOrActivateDraconium(x, y, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -293,10 +293,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
} else if (block.equals("redstone")) {
|
||||
if (!(xCoord + dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateRedstone(xCoord + dist, y, z, set, activate))
|
||||
return false;
|
||||
} else if (block.equals("draconium")) {
|
||||
} else if (block.equals("draconiumBlock")) {
|
||||
if (!(xCoord + dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateDraconium(xCoord + dist, y, z, set, activate))
|
||||
return false;
|
||||
} else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
} else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -313,10 +313,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
} else if (block.equals("redstone")) {
|
||||
if (!(xCoord - dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateRedstone(xCoord - dist, y, z, set, activate))
|
||||
return false;
|
||||
} else if (block.equals("draconium")) {
|
||||
} else if (block.equals("draconiumBlock")) {
|
||||
if (!(xCoord - dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateDraconium(xCoord - dist, y, z, set, activate))
|
||||
return false;
|
||||
} else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
} else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -334,10 +334,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && yCoord + dist == yCoord && z == zCoord) && !testForOrActivateRedstone(x, yCoord + dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && yCoord + dist == yCoord && z == zCoord) && !testForOrActivateDraconium(x, yCoord + dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -354,10 +354,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && yCoord - dist == yCoord && z == zCoord) && !testForOrActivateRedstone(x, yCoord - dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && yCoord - dist == yCoord && z == zCoord) && !testForOrActivateDraconium(x, yCoord - dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -375,10 +375,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord + dist == zCoord) && !testForOrActivateRedstone(x, y, zCoord + dist, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord + dist == zCoord) && !testForOrActivateDraconium(x, y, zCoord + dist, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -395,10 +395,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord - dist == zCoord) && !testForOrActivateRedstone(x, y, zCoord - dist, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord - dist == zCoord) && !testForOrActivateDraconium(x, y, zCoord - dist, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -419,10 +419,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(xCoord + dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateRedstone(xCoord + dist, y, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(xCoord + dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateDraconium(xCoord + dist, y, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -437,10 +437,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(xCoord - dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateRedstone(xCoord - dist, y, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(xCoord - dist == xCoord && y == yCoord && z == zCoord) && !testForOrActivateDraconium(xCoord - dist, y, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -456,10 +456,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && yCoord + dist == yCoord && z == zCoord) && !testForOrActivateRedstone(x, yCoord + dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && yCoord + dist == yCoord && z == zCoord) && !testForOrActivateDraconium(x, yCoord + dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -474,10 +474,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && yCoord - dist == yCoord && z == zCoord) && !testForOrActivateRedstone(x, yCoord - dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && yCoord - dist == yCoord && z == zCoord) && !testForOrActivateDraconium(x, yCoord - dist, z, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -493,10 +493,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord + dist == zCoord) && !testForOrActivateRedstone(x, y, zCoord + dist, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord + dist == zCoord) && !testForOrActivateDraconium(x, y, zCoord + dist, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -511,10 +511,10 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
else if (block.equals("redstone")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord - dist == zCoord) && !testForOrActivateRedstone(x, y, zCoord - dist, set, activate)) return false;
|
||||
}
|
||||
else if (block.equals("draconium")){
|
||||
else if (block.equals("draconiumBlock")){
|
||||
if (!(x == xCoord && y == yCoord && zCoord - dist == zCoord) && !testForOrActivateDraconium(x, y, zCoord - dist, set, activate)) return false;
|
||||
}
|
||||
else if (!block.equals("draconium") && !block.equals("redstone") && !block.equals("air")) {
|
||||
else if (!block.equals("draconiumBlock") && !block.equals("redstone") && !block.equals("air")) {
|
||||
LogHelper.error("Invalid String In Multiblock Structure Code!!!");
|
||||
return false;
|
||||
}
|
||||
@@ -527,9 +527,9 @@ public class TileEnergyStorageCore extends TileEntity {
|
||||
private boolean testForOrActivateDraconium(int x, int y, int z, boolean set, boolean activate){
|
||||
if (!activate) {
|
||||
if (set) {
|
||||
worldObj.setBlock(x, y, z, ModBlocks.draconium);
|
||||
worldObj.setBlock(x, y, z, ModBlocks.draconiumBlock);
|
||||
return true;
|
||||
} else return worldObj.getBlock(x, y, z) == ModBlocks.draconium || (worldObj.getBlock(x, y, z) == ModBlocks.invisibleMultiblock && worldObj.getBlockMetadata(x, y, z) == 0);
|
||||
} else return worldObj.getBlock(x, y, z) == ModBlocks.draconiumBlock || (worldObj.getBlock(x, y, z) == ModBlocks.invisibleMultiblock && worldObj.getBlockMetadata(x, y, z) == 0);
|
||||
}else{
|
||||
return activateDraconium(x, y, z);
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class TileInvisibleMultiblock extends TileEntity {
|
||||
private void revert(){
|
||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
if (meta == 0)
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.draconium);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.draconiumBlock);
|
||||
else if (meta == 1)
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.redstone_block);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class InfoHelper {
|
||||
if (energy < 1000)
|
||||
eS = String.valueOf(energy);
|
||||
else if (energy < 1000000)
|
||||
eS = String.valueOf(Math.round((float)energy / 10F)/100F)+"k";
|
||||
eS = String.valueOf(energy);//Math.round((float)energy / 10F)/100F)+"k";
|
||||
else
|
||||
eS = String.valueOf(Math.round((float)energy / 1000F)/1000F)+"m";
|
||||
if (maxEnergy < 1000)
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.common.utills;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.blocks.BlockDE;
|
||||
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.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 25/07/2014.
|
||||
*/
|
||||
@@ -48,75 +34,4 @@ public class Utills {
|
||||
double dz = z1-z2;
|
||||
return Math.sqrt((dx*dx + dy*dy + dz*dz ));
|
||||
}
|
||||
|
||||
public static class BlockChanger extends Block{
|
||||
|
||||
public BlockDE block;
|
||||
|
||||
public BlockChanger(String name, BlockDE block) {
|
||||
super(Material.rock);
|
||||
this.setBlockName(name);
|
||||
this.block = block;
|
||||
GameRegistry.registerBlock(this, BlockChangerItem.class ,name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
|
||||
LogHelper.info(world.getBlock(x, y, z).getUnlocalizedName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
return new TileBlockChanger(block);
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileBlockChanger extends TileEntity {
|
||||
|
||||
BlockDE block;
|
||||
public TileBlockChanger(BlockDE block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
|
||||
return;
|
||||
}
|
||||
LogHelper.info("Changing block at [X:"+xCoord+" Y:"+yCoord+" Z:"+zCoord+"] from "+worldObj.getBlock(xCoord,yCoord,zCoord).getUnlocalizedName()+" to "+block.getUnlocalizedName());
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, block);
|
||||
worldObj.removeTileEntity(xCoord,yCoord,zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockChangerItem extends ItemBlock {
|
||||
|
||||
private BlockChanger block;
|
||||
public BlockChangerItem(Block block) {
|
||||
super(block);
|
||||
if (block instanceof BlockChanger) this.block = (BlockChanger)block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean p_77663_5_) {
|
||||
if (entity instanceof EntityPlayer && block.block != null){
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
player.inventory.setInventorySlotContents(slot, new ItemStack(Item.getItemFromBlock(block.block), stack.stackSize));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean p_77624_4_) {
|
||||
list.add("This block was broken by the update");
|
||||
list.add("Place it in your inventory to fix it");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 124 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user