mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-19 11:49:33 +00:00
changes
This commit is contained in:
1 parent
084d48e1a4
commit
b5349fccbe
129 files changed
+5913
-6074
No files matched your search
@@ -32,64 +32,64 @@ public class ElectroMagicTools {
|
||||
|
||||
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
|
||||
|
||||
@SidedProxy(clientSide = ModInformation.clientProxy, serverSide = ModInformation.commonProxy)
|
||||
public static CommonProxy proxy;
|
||||
@SidedProxy(clientSide = ModInformation.clientProxy, serverSide = ModInformation.commonProxy)
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public static CreativeTabs tabEMT = new CreativeTabEMT(ModInformation.modid + ".creativeTab");
|
||||
public static Logger logger = LogManager.getLogger(ModInformation.name);
|
||||
public static CreativeTabs tabEMT = new CreativeTab(ModInformation.modid + ".creativeTab");
|
||||
public static Logger logger = LogManager.getLogger(ModInformation.name);
|
||||
|
||||
@Instance(ModInformation.modid)
|
||||
public static ElectroMagicTools instance;
|
||||
@Instance(ModInformation.modid)
|
||||
public static ElectroMagicTools instance;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
ElectroMagicTools.logger.info("Starting planning the world domination");
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
ElectroMagicTools.logger.info("Starting planning the world domination");
|
||||
|
||||
ConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||
FMLCommonHandler.instance().bus().register(new EventHandlerEMT());
|
||||
Registry.register();
|
||||
EssentiasOutputs.addPrimalOutputs();
|
||||
EssentiasOutputs.addOutputs();
|
||||
registerPackets();
|
||||
ConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
||||
Registry.register();
|
||||
EssentiasOutputs.addPrimalOutputs();
|
||||
EssentiasOutputs.addOutputs();
|
||||
registerPackets();
|
||||
|
||||
ElectroMagicTools.logger.info("Planning complete");
|
||||
}
|
||||
ElectroMagicTools.logger.info("Planning complete");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent event) {
|
||||
ElectroMagicTools.logger.info("Gathering allies");
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent event) {
|
||||
ElectroMagicTools.logger.info("Gathering allies");
|
||||
|
||||
ElectroMagicTools.logger.info("Loading the proxies");
|
||||
proxy.load();
|
||||
ElectroMagicTools.logger.info("Making mobs drop additional items");
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerEMT());
|
||||
ElectroMagicTools.logger.info("Adding dungeon loot");
|
||||
DungeonChestGenerator.generateLoot();
|
||||
ElectroMagicTools.logger.info("Loading the proxies");
|
||||
proxy.load();
|
||||
ElectroMagicTools.logger.info("Making mobs drop additional items");
|
||||
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
||||
ElectroMagicTools.logger.info("Adding dungeon loot");
|
||||
DungeonChestGenerator.generateLoot();
|
||||
|
||||
ElectroMagicTools.logger.info("Registering entities");
|
||||
EntityRegistry.registerEMTEntities();
|
||||
ElectroMagicTools.logger.info("Registering the GUI Handler");
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
ElectroMagicTools.logger.info("Registering entities");
|
||||
EntityRegistry.registerEMTEntities();
|
||||
ElectroMagicTools.logger.info("Registering the GUI Handler");
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
|
||||
ElectroMagicTools.logger.info("Allies gathered.");
|
||||
}
|
||||
ElectroMagicTools.logger.info("Allies gathered.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ElectroMagicTools.logger.info("Starting the world takeover");
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ElectroMagicTools.logger.info("Starting the world takeover");
|
||||
|
||||
Registry.registerLate();
|
||||
RegistryHandler.registerIc2PostRegistrys();
|
||||
Registry.registerLate();
|
||||
EMTResearch.register();
|
||||
|
||||
ElectroMagicTools.logger.info("World takeover complete. Enjoy!");
|
||||
}
|
||||
ElectroMagicTools.logger.info("World takeover complete. Enjoy!");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFMLServerStart(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandOutputs());
|
||||
}
|
||||
|
||||
public void registerPackets(){
|
||||
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
||||
}
|
||||
@EventHandler
|
||||
public void onFMLServerStart(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandOutputs());
|
||||
}
|
||||
|
||||
public void registerPackets() {
|
||||
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ public class ModInformation {
|
||||
|
||||
public static final String name = "Electro-Magic Tools";
|
||||
public static final String modid = "EMT";
|
||||
public static final String version = "1.2.2";
|
||||
public static final String version = "1.2.4";
|
||||
public static final String texturePath = "electromagictools";
|
||||
public static final String guiFactory = "tombenpotter.emt.client.gui.config.EMTGuiFactory";
|
||||
public static final String clientProxy = "tombenpotter.emt.proxies.ClientProxy";
|
||||
|
||||
@@ -12,16 +12,15 @@ import tombenpotter.emt.common.util.TextHelper;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
|
||||
public class EMTKeys{
|
||||
public class EMTKeys {
|
||||
public static KeyBinding keyUnequip;
|
||||
|
||||
public static void registerKeys(){
|
||||
|
||||
public static void registerKeys() {
|
||||
keyUnequip = new KeyBinding(TextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_Z, "EMT");
|
||||
ClientRegistry.registerKeyBinding(keyUnequip);
|
||||
|
||||
}
|
||||
|
||||
public static boolean keyUnequipPressed(){
|
||||
|
||||
public static boolean keyUnequipPressed() {
|
||||
return keyUnequip.getIsKeyPressed();
|
||||
}
|
||||
}
|
||||
@@ -12,23 +12,23 @@ import tombenpotter.emt.common.util.TextHelper;
|
||||
|
||||
public class GuiEtherealMacerator extends GuiContainer {
|
||||
|
||||
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) {
|
||||
super(new ContainerEtheralMacerator(inventory, te));
|
||||
xSize = 176;
|
||||
ySize = 165;
|
||||
}
|
||||
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) {
|
||||
super(new ContainerEtheralMacerator(inventory, te));
|
||||
xSize = 176;
|
||||
ySize = 165;
|
||||
}
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/etherealmacerator.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/etherealmacerator.png");
|
||||
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752);
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752);
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
@@ -12,23 +12,23 @@ import tombenpotter.emt.common.util.TextHelper;
|
||||
|
||||
public class GuiIndustrialWandRecharger extends GuiContainer {
|
||||
|
||||
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) {
|
||||
super(new ContainerIndustrialWandRecharge(inventory, te));
|
||||
xSize = 176;
|
||||
ySize = 165;
|
||||
}
|
||||
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) {
|
||||
super(new ContainerIndustrialWandRecharge(inventory, te));
|
||||
xSize = 176;
|
||||
ySize = 165;
|
||||
}
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/wandcharger.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/wandcharger.png");
|
||||
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752);
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752);
|
||||
this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
@@ -16,19 +16,19 @@ import static tombenpotter.emt.common.util.ConfigHandler.*;
|
||||
|
||||
public class EMTGuiConfig extends GuiConfig {
|
||||
|
||||
public EMTGuiConfig(GuiScreen parentScreen) {
|
||||
super(parentScreen, getConfigElements(parentScreen), ModInformation.modid, false, false, StatCollector.translateToLocal("gui." + ModInformation.modid + ".config.title"));
|
||||
}
|
||||
public EMTGuiConfig(GuiScreen parentScreen) {
|
||||
super(parentScreen, getConfigElements(parentScreen), ModInformation.modid, false, false, StatCollector.translateToLocal("gui." + ModInformation.modid + ".config.title"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RANDOM.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(VALUES.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RESEARCH.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(OUTPUTS.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RANDOM.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(VALUES.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RESEARCH.toLowerCase(Locale.US))));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(OUTPUTS.toLowerCase(Locale.US))));
|
||||
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -8,23 +8,23 @@ import java.util.Set;
|
||||
|
||||
public class EMTGuiFactory implements IModGuiFactory {
|
||||
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||
return EMTGuiConfig.class;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||
return EMTGuiConfig.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+63
-58
@@ -12,72 +12,77 @@ import tombenpotter.emt.common.tile.TileEntityEtherealMacerator;
|
||||
|
||||
public class ContainerEtheralMacerator extends Container {
|
||||
|
||||
TileEntityEtherealMacerator te;
|
||||
TileEntityEtherealMacerator te;
|
||||
|
||||
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) {
|
||||
this.te = ((TileEntityEtherealMacerator)te);
|
||||
addSlotToContainer(new Slot(this.te, 0, 56, 26));
|
||||
addSlotToContainer(new SlotOutput(this.te, 2, 116, 26));
|
||||
addSlotToContainer(new SlotOutput(this.te, 1, 116, 53));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 9; i++) {
|
||||
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) {
|
||||
this.te = ((TileEntityEtherealMacerator) te);
|
||||
addSlotToContainer(new Slot(this.te, 0, 56, 26));
|
||||
addSlotToContainer(new SlotOutput(this.te, 2, 116, 26));
|
||||
addSlotToContainer(new SlotOutput(this.te, 1, 116, 53));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 9; i++) {
|
||||
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return this.te.isUseableByPlayer(player);
|
||||
}
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return this.te.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(par2);
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if (par2 == 1) {
|
||||
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
|
||||
return null;
|
||||
}
|
||||
if (par2 == 1) {
|
||||
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
} else if (par2 != 0) {
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (par2 >= 2 && par2 < 29) {
|
||||
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(itemstack1, 3, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
else if (par2 != 0) {
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (par2 >= 2 && par2 < 29) {
|
||||
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 3, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
if (itemstack1.stackSize == itemstack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
|
||||
}
|
||||
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
+61
-56
@@ -10,73 +10,78 @@ import tombenpotter.emt.common.tile.TileEntityIndustrialWandRecharge;
|
||||
|
||||
public class ContainerIndustrialWandRecharge extends Container {
|
||||
|
||||
TileEntityIndustrialWandRecharge charger;
|
||||
TileEntityIndustrialWandRecharge charger;
|
||||
|
||||
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) {
|
||||
this.charger = entity;
|
||||
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) {
|
||||
this.charger = entity;
|
||||
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142));
|
||||
}
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142));
|
||||
}
|
||||
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
|
||||
}
|
||||
}
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
|
||||
}
|
||||
}
|
||||
|
||||
this.addSlotToContainer(new Slot(charger, 0, 80, 35));
|
||||
}
|
||||
this.addSlotToContainer(new Slot(charger, 0, 80, 35));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return charger.isUseableByPlayer(player);
|
||||
}
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return charger.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(par2);
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if (par2 == 1) {
|
||||
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
|
||||
return null;
|
||||
}
|
||||
if (par2 == 1) {
|
||||
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
} else if (par2 != 0) {
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (par2 >= 2 && par2 < 29) {
|
||||
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(itemstack1, 2, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
else if (par2 != 0) {
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (par2 >= 2 && par2 < 29) {
|
||||
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 2, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
if (itemstack1.stackSize == itemstack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
|
||||
}
|
||||
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
@@ -14,227 +14,213 @@ import net.minecraft.util.MathHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelCpecialArmor extends ModelBiped
|
||||
{
|
||||
public ModelRenderer bipedHead;
|
||||
public ModelRenderer bipedBody;
|
||||
public ModelRenderer bipedRightArm;
|
||||
public ModelRenderer bipedLeftArm;
|
||||
|
||||
public ModelRenderer rightWing;
|
||||
public ModelRenderer leftWing;
|
||||
public ModelRenderer center;
|
||||
|
||||
public ModelRenderer jetpack;
|
||||
|
||||
public boolean isJumping;
|
||||
|
||||
public int type = 0;//0 - nothing, 1 - jetpack, 2 - wings
|
||||
public int heldItemLeft;
|
||||
public int heldItemRight;
|
||||
public boolean isSneak;
|
||||
public boolean aimedBow;
|
||||
public class ModelCpecialArmor extends ModelBiped {
|
||||
public ModelRenderer bipedHead;
|
||||
public ModelRenderer bipedBody;
|
||||
public ModelRenderer bipedRightArm;
|
||||
public ModelRenderer bipedLeftArm;
|
||||
|
||||
public ModelCpecialArmor()
|
||||
{
|
||||
this(0.0F, 0);
|
||||
}
|
||||
public ModelRenderer rightWing;
|
||||
public ModelRenderer leftWing;
|
||||
public ModelRenderer center;
|
||||
|
||||
public ModelCpecialArmor(float p_i1148_1_, int type)
|
||||
{
|
||||
this(p_i1148_1_, 0.0F, 64, 32, type);
|
||||
}
|
||||
public ModelRenderer jetpack;
|
||||
|
||||
public ModelCpecialArmor(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_, int type)
|
||||
{
|
||||
|
||||
this.type = type;
|
||||
switch(this.type){
|
||||
case 1 :
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 96;
|
||||
this.jetpack = new ModelRenderer(this, 16, 69);
|
||||
this.jetpack.setTextureSize(64, 48);
|
||||
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, p_i1149_1_ * 2);
|
||||
this.jetpack.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
rightWing = new ModelRenderer(this, 24, 0 + 32);
|
||||
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
public boolean isJumping;
|
||||
|
||||
leftWing = new ModelRenderer(this, 0, 0 + 32);
|
||||
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
public int type = 0;// 0 - nothing, 1 - jetpack, 2 - wings
|
||||
public int heldItemLeft;
|
||||
public int heldItemRight;
|
||||
public boolean isSneak;
|
||||
public boolean aimedBow;
|
||||
|
||||
center = new ModelRenderer(this, 0, 14 + 32);
|
||||
center.addBox(0F, 0F, 1F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
break;
|
||||
}
|
||||
|
||||
this.bipedHead = new ModelRenderer(this, 0, 0);
|
||||
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_);
|
||||
this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
|
||||
this.bipedBody = new ModelRenderer(this, 16, 16);
|
||||
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_);
|
||||
this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
|
||||
this.bipedRightArm = new ModelRenderer(this, 40, 16);
|
||||
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_);
|
||||
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F);
|
||||
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
|
||||
this.bipedLeftArm.mirror = true;
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F);
|
||||
}
|
||||
|
||||
private void setRotation (ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
public ModelCpecialArmor() {
|
||||
this(0.0F, 0);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
|
||||
{
|
||||
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, entity);
|
||||
public ModelCpecialArmor(float p_i1148_1_, int type) {
|
||||
this(p_i1148_1_, 0.0F, 64, 32, type);
|
||||
}
|
||||
|
||||
this.bipedBody.render(p_78088_7_);
|
||||
this.bipedRightArm.render(p_78088_7_);
|
||||
this.bipedLeftArm.render(p_78088_7_);
|
||||
switch(this.type){
|
||||
case 1 :
|
||||
this.jetpack.render(p_78088_7_);
|
||||
break;
|
||||
case 2 :
|
||||
this.center.render(p_78088_7_);
|
||||
this.leftWing.render(p_78088_7_);
|
||||
this.rightWing.render(p_78088_7_);
|
||||
}
|
||||
|
||||
}
|
||||
public ModelCpecialArmor(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_, int type) {
|
||||
|
||||
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
if(player.inventory.getCurrentItem() != null)
|
||||
this.heldItemRight = 1;
|
||||
else
|
||||
this.heldItemRight = 0;
|
||||
this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
|
||||
this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
|
||||
this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F;
|
||||
this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F;
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.type = type;
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 96;
|
||||
this.jetpack = new ModelRenderer(this, 16, 69);
|
||||
this.jetpack.setTextureSize(64, 48);
|
||||
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, p_i1149_1_ * 2);
|
||||
this.jetpack.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
|
||||
break;
|
||||
|
||||
if (entity.isRiding())
|
||||
{
|
||||
this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
|
||||
this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
|
||||
}
|
||||
|
||||
if(isJumping){
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
}
|
||||
case 2:
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
rightWing = new ModelRenderer(this, 24, 0 + 32);
|
||||
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
|
||||
if (this.heldItemLeft != 0)
|
||||
{
|
||||
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft;
|
||||
}
|
||||
leftWing = new ModelRenderer(this, 0, 0 + 32);
|
||||
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
|
||||
if (this.heldItemRight != 0)
|
||||
{
|
||||
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight;
|
||||
}
|
||||
center = new ModelRenderer(this, 0, 14 + 32);
|
||||
center.addBox(0F, 0F, 1F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
break;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
float f6;
|
||||
float f7;
|
||||
this.bipedHead = new ModelRenderer(this, 0, 0);
|
||||
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_);
|
||||
this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
|
||||
this.bipedBody = new ModelRenderer(this, 16, 16);
|
||||
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_);
|
||||
this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F);
|
||||
this.bipedRightArm = new ModelRenderer(this, 40, 16);
|
||||
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_);
|
||||
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F);
|
||||
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
|
||||
this.bipedLeftArm.mirror = true;
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F);
|
||||
}
|
||||
|
||||
if (this.onGround > -9990.0F)
|
||||
{
|
||||
f6 = this.onGround;
|
||||
this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI * 2.0F) * 0.2F;
|
||||
this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
|
||||
f6 = 1.0F - this.onGround;
|
||||
f6 *= f6;
|
||||
f6 *= f6;
|
||||
f6 = 1.0F - f6;
|
||||
f7 = MathHelper.sin(f6 * (float)Math.PI);
|
||||
float f8 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
|
||||
this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8));
|
||||
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
|
||||
this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F;
|
||||
}
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
if (entity.isSneaking())
|
||||
{
|
||||
this.bipedBody.rotateAngleX = 0.5F;
|
||||
switch(this.type){
|
||||
case 1 :
|
||||
this.jetpack.rotateAngleX = 0.5F;
|
||||
break;
|
||||
case 2 :
|
||||
this.center.offsetY -= 0.1;
|
||||
this.rightWing.offsetY -= 0.1;
|
||||
this.leftWing.offsetY -= 0.1;
|
||||
this.center.rotateAngleX = 0.5F;
|
||||
this.rightWing.rotateAngleX = 0.5F;
|
||||
this.leftWing.rotateAngleX = 0.5F;
|
||||
break;
|
||||
}
|
||||
this.bipedRightArm.rotateAngleX += 0.4F;
|
||||
this.bipedLeftArm.rotateAngleX += 0.4F;
|
||||
this.bipedHead.rotationPointY = 1.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bipedBody.rotateAngleX = 0.0F;
|
||||
this.bipedHead.rotationPointY = 0.0F;
|
||||
}
|
||||
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) {
|
||||
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, entity);
|
||||
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
this.bipedBody.render(p_78088_7_);
|
||||
this.bipedRightArm.render(p_78088_7_);
|
||||
this.bipedLeftArm.render(p_78088_7_);
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
this.jetpack.render(p_78088_7_);
|
||||
break;
|
||||
case 2:
|
||||
this.center.render(p_78088_7_);
|
||||
this.leftWing.render(p_78088_7_);
|
||||
this.rightWing.render(p_78088_7_);
|
||||
}
|
||||
|
||||
if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ItemBow && player.isUsingItem())
|
||||
{
|
||||
f6 = 0.0F;
|
||||
f7 = 0.0F;
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + this.bipedHead.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + this.bipedHead.rotateAngleY + 0.4F;
|
||||
this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
|
||||
this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
if (player.inventory.getCurrentItem() != null)
|
||||
this.heldItemRight = 1;
|
||||
else
|
||||
this.heldItemRight = 0;
|
||||
this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
|
||||
this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
|
||||
this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 2.0F * p_78087_2_ * 0.5F;
|
||||
this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F;
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
|
||||
if (entity.isRiding()) {
|
||||
this.bipedRightArm.rotateAngleX += -((float) Math.PI / 5F);
|
||||
this.bipedLeftArm.rotateAngleX += -((float) Math.PI / 5F);
|
||||
}
|
||||
|
||||
if (isJumping) {
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
}
|
||||
|
||||
if (this.heldItemLeft != 0) {
|
||||
this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F) * (float) this.heldItemLeft;
|
||||
}
|
||||
|
||||
if (this.heldItemRight != 0) {
|
||||
this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F) * (float) this.heldItemRight;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotateAngleY = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
float f6;
|
||||
float f7;
|
||||
|
||||
if (this.onGround > -9990.0F) {
|
||||
f6 = this.onGround;
|
||||
this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float) Math.PI * 2.0F) * 0.2F;
|
||||
this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
|
||||
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
|
||||
f6 = 1.0F - this.onGround;
|
||||
f6 *= f6;
|
||||
f6 *= f6;
|
||||
f6 = 1.0F - f6;
|
||||
f7 = MathHelper.sin(f6 * (float) Math.PI);
|
||||
float f8 = MathHelper.sin(this.onGround * (float) Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
|
||||
this.bipedRightArm.rotateAngleX = (float) ((double) this.bipedRightArm.rotateAngleX - ((double) f7 * 1.2D + (double) f8));
|
||||
this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
|
||||
this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float) Math.PI) * -0.4F;
|
||||
}
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
this.bipedBody.rotateAngleX = 0.5F;
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
this.jetpack.rotateAngleX = 0.5F;
|
||||
break;
|
||||
case 2:
|
||||
this.center.offsetY -= 0.1;
|
||||
this.rightWing.offsetY -= 0.1;
|
||||
this.leftWing.offsetY -= 0.1;
|
||||
this.center.rotateAngleX = 0.5F;
|
||||
this.rightWing.rotateAngleX = 0.5F;
|
||||
this.leftWing.rotateAngleX = 0.5F;
|
||||
break;
|
||||
}
|
||||
this.bipedRightArm.rotateAngleX += 0.4F;
|
||||
this.bipedLeftArm.rotateAngleX += 0.4F;
|
||||
this.bipedHead.rotationPointY = 1.0F;
|
||||
}
|
||||
else {
|
||||
this.bipedBody.rotateAngleX = 0.0F;
|
||||
this.bipedHead.rotationPointY = 0.0F;
|
||||
}
|
||||
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
|
||||
if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ItemBow && player.isUsingItem()) {
|
||||
f6 = 0.0F;
|
||||
f7 = 0.0F;
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + this.bipedHead.rotateAngleY;
|
||||
this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + this.bipedHead.rotateAngleY + 0.4F;
|
||||
this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX;
|
||||
this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
|
||||
this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,71 +8,70 @@ import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ModelWings extends ModelBiped {
|
||||
|
||||
ModelRenderer rightWing;
|
||||
ModelRenderer leftWing;
|
||||
ModelRenderer center;
|
||||
|
||||
public boolean isJumping = false;
|
||||
ModelRenderer rightWing;
|
||||
ModelRenderer leftWing;
|
||||
ModelRenderer center;
|
||||
|
||||
public ModelWings() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
public boolean isJumping = false;
|
||||
|
||||
rightWing = new ModelRenderer(this, 24, 0);
|
||||
rightWing.addBox(-11F, -1F, -1.5F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
public ModelWings() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
leftWing = new ModelRenderer(this, 0, 0);
|
||||
leftWing.addBox(0F, -1F, -1.5F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
rightWing = new ModelRenderer(this, 24, 0);
|
||||
rightWing.addBox(-11F, -1F, -1.5F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
|
||||
center = new ModelRenderer(this, 0, 14);
|
||||
center.addBox(0F, 0F, -0.5F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
leftWing = new ModelRenderer(this, 0, 0);
|
||||
leftWing.addBox(0F, -1F, -1.5F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
|
||||
this.bipedBody.addChild(rightWing);
|
||||
this.bipedBody.addChild(leftWing);
|
||||
this.bipedBody.addChild(center);
|
||||
}
|
||||
center = new ModelRenderer(this, 0, 14);
|
||||
center.addBox(0F, 0F, -0.5F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
setRotation(center, 0F, 0F, 0F);
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
rightWing.render(f5);
|
||||
leftWing.render(f5);
|
||||
center.render(f5);
|
||||
}
|
||||
this.bipedBody.addChild(rightWing);
|
||||
this.bipedBody.addChild(leftWing);
|
||||
this.bipedBody.addChild(center);
|
||||
}
|
||||
|
||||
private void setRotation (ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity){
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
rightWing.render(f5);
|
||||
leftWing.render(f5);
|
||||
center.render(f5);
|
||||
}
|
||||
|
||||
if(isJumping){
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
}
|
||||
|
||||
if(entity.isSneaking()){
|
||||
this.center.offsetY -= 0.1;
|
||||
this.rightWing.offsetY -= 0.1;
|
||||
this.leftWing.offsetY -= 0.1;
|
||||
this.center.rotateAngleX = 0.5F;
|
||||
this.rightWing.rotateAngleX = 0.5F;
|
||||
this.leftWing.rotateAngleX = 0.5F;
|
||||
}
|
||||
}
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity) {
|
||||
|
||||
if (isJumping) {
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
}
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
this.center.offsetY -= 0.1;
|
||||
this.rightWing.offsetY -= 0.1;
|
||||
this.leftWing.offsetY -= 0.1;
|
||||
this.center.rotateAngleX = 0.5F;
|
||||
this.rightWing.rotateAngleX = 0.5F;
|
||||
this.leftWing.rotateAngleX = 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,70 +11,70 @@ import tombenpotter.emt.common.entities.EntityLaser;
|
||||
|
||||
public class RenderLaser extends Render {
|
||||
|
||||
private static final ResourceLocation laserTexture = new ResourceLocation(ModInformation.texturePath, "textures/models/lasermodel.png");
|
||||
private static final ResourceLocation laserTexture = new ResourceLocation(ModInformation.texturePath, "textures/models/lasermodel.png");
|
||||
|
||||
public void renderArrow(EntityLaser entityLaser, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void renderArrow(EntityLaser entityLaser, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
this.bindEntityTexture(entityLaser);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glRotatef(entityLaser.prevRotationYaw + (entityLaser.rotationYaw - entityLaser.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(entityLaser.prevRotationPitch + (entityLaser.rotationPitch - entityLaser.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
byte b0 = 0;
|
||||
float f2 = 0.4F;
|
||||
float f3 = 0.7F;
|
||||
float f4 = (float) (0 + b0 * 10) / 32.0F;
|
||||
float f5 = (float) (5 + b0 * 10) / 32.0F;
|
||||
float f6 = 0.0F;
|
||||
float f7 = 0.15625F;
|
||||
float f8 = (float) (5 + b0 * 10) / 32.0F;
|
||||
float f9 = (float) (10 + b0 * 10) / 32.0F;
|
||||
float f10 = 0.05625F;
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
this.bindEntityTexture(entityLaser);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glRotatef(entityLaser.prevRotationYaw + (entityLaser.rotationYaw - entityLaser.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(entityLaser.prevRotationPitch + (entityLaser.rotationPitch - entityLaser.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
byte b0 = 0;
|
||||
float f2 = 0.4F;
|
||||
float f3 = 0.7F;
|
||||
float f4 = (float) (0 + b0 * 10) / 32.0F;
|
||||
float f5 = (float) (5 + b0 * 10) / 32.0F;
|
||||
float f6 = 0.0F;
|
||||
float f7 = 0.15625F;
|
||||
float f8 = (float) (5 + b0 * 10) / 32.0F;
|
||||
float f9 = (float) (10 + b0 * 10) / 32.0F;
|
||||
float f10 = 0.05625F;
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(f10, f10, f10);
|
||||
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.draw();
|
||||
GL11.glNormal3f(-f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.draw();
|
||||
GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(f10, f10, f10);
|
||||
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.draw();
|
||||
GL11.glNormal3f(-f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.draw();
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(0.0F, 0.0F, f10);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5);
|
||||
tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5);
|
||||
tessellator.draw();
|
||||
}
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(0.0F, 0.0F, f10);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5);
|
||||
tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
protected ResourceLocation getArrowTextures(EntityLaser entityLaser) {
|
||||
return laserTexture;
|
||||
}
|
||||
protected ResourceLocation getArrowTextures(EntityLaser entityLaser) {
|
||||
return laserTexture;
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return this.getArrowTextures((EntityLaser) par1Entity);
|
||||
}
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return this.getArrowTextures((EntityLaser) par1Entity);
|
||||
}
|
||||
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
this.renderArrow((EntityLaser) par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
this.renderArrow((EntityLaser) par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
}
|
||||
@@ -7,20 +7,20 @@ import tombenpotter.emt.ModInformation;
|
||||
|
||||
public abstract class BlockBase extends Block {
|
||||
|
||||
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
setBlockName(ModInformation.modid + ".block." + unlocName);
|
||||
setBlockTextureName(ModInformation.texturePath + ":" + textureName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
}
|
||||
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
setBlockName(ModInformation.modid + ".block." + unlocName);
|
||||
setBlockTextureName(ModInformation.texturePath + ":" + textureName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
}
|
||||
|
||||
public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
setBlockName(ModInformation.modid + ".block." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
}
|
||||
public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
setBlockName(ModInformation.modid + ".block." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
}
|
||||
}
|
||||
@@ -17,76 +17,80 @@ import tombenpotter.emt.common.tile.TileEntityEMT;
|
||||
|
||||
public abstract class BlockBaseContainer extends BlockContainer {
|
||||
|
||||
public IIcon[] top = new IIcon[16];
|
||||
public IIcon[] bottom = new IIcon[16];
|
||||
public IIcon[] side = new IIcon[16];
|
||||
public IIcon[] frontOff = new IIcon[16];
|
||||
public IIcon[] frontOn = new IIcon[16];
|
||||
public IIcon[] top = new IIcon[16];
|
||||
public IIcon[] bottom = new IIcon[16];
|
||||
public IIcon[] side = new IIcon[16];
|
||||
public IIcon[] frontOff = new IIcon[16];
|
||||
public IIcon[] frontOn = new IIcon[16];
|
||||
|
||||
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, float hardness) {
|
||||
super(material);
|
||||
|
||||
setBlockName(ModInformation.modid + ".module.base." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
}
|
||||
setBlockName(ModInformation.modid + ".module.base." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
setStepSound(soundType);
|
||||
setHardness(hardness);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
|
||||
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
|
||||
int i = access.getBlockMetadata(x, y, z);
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
|
||||
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
|
||||
int i = access.getBlockMetadata(x, y, z);
|
||||
|
||||
if (side == 0) {
|
||||
return this.bottom[i];
|
||||
} else if (side == 1) {
|
||||
return this.top[i];
|
||||
} else if (side != tile.facing) {
|
||||
return this.side[i];
|
||||
} else if (tile.isOn) {
|
||||
return this.frontOn[i];
|
||||
} else {
|
||||
return this.frontOff[i];
|
||||
}
|
||||
}
|
||||
if (side == 0) {
|
||||
return this.bottom[i];
|
||||
}
|
||||
else if (side == 1) {
|
||||
return this.top[i];
|
||||
}
|
||||
else if (side != tile.facing) {
|
||||
return this.side[i];
|
||||
}
|
||||
else if (tile.isOn) {
|
||||
return this.frontOn[i];
|
||||
}
|
||||
else {
|
||||
return this.frontOff[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side < 1) {
|
||||
return this.bottom[meta];
|
||||
}
|
||||
if (side == 1) {
|
||||
return this.top[meta];
|
||||
}
|
||||
if (side == 3) {
|
||||
return this.frontOff[meta];
|
||||
}
|
||||
return this.side[meta];
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side < 1) {
|
||||
return this.bottom[meta];
|
||||
}
|
||||
if (side == 1) {
|
||||
return this.top[meta];
|
||||
}
|
||||
if (side == 3) {
|
||||
return this.frontOff[meta];
|
||||
}
|
||||
return this.side[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
|
||||
|
||||
if (facing == 0)
|
||||
tile.facing = 2;
|
||||
else if (facing == 1)
|
||||
tile.facing = 5;
|
||||
else if (facing == 2)
|
||||
tile.facing = 3;
|
||||
else if (facing == 3)
|
||||
tile.facing = 4;
|
||||
}
|
||||
if (facing == 0)
|
||||
tile.facing = 2;
|
||||
else if (facing == 1)
|
||||
tile.facing = 5;
|
||||
else if (facing == 2)
|
||||
tile.facing = 3;
|
||||
else if (facing == 3)
|
||||
tile.facing = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -14,69 +14,73 @@ import net.minecraft.world.World;
|
||||
import tombenpotter.emt.common.tile.TileEntityEMT;
|
||||
|
||||
public abstract class BlockEMT extends BlockContainer {
|
||||
public IIcon[] top = new IIcon[16];
|
||||
public IIcon[] bottom = new IIcon[16];
|
||||
public IIcon[] side = new IIcon[16];
|
||||
public IIcon[] frontOff = new IIcon[16];
|
||||
public IIcon[] frontOn = new IIcon[16];
|
||||
public IIcon[] top = new IIcon[16];
|
||||
public IIcon[] bottom = new IIcon[16];
|
||||
public IIcon[] side = new IIcon[16];
|
||||
public IIcon[] frontOff = new IIcon[16];
|
||||
public IIcon[] frontOn = new IIcon[16];
|
||||
|
||||
protected BlockEMT(Material material) {
|
||||
super(material);
|
||||
}
|
||||
protected BlockEMT(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
|
||||
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
|
||||
int i = access.getBlockMetadata(x, y, z);
|
||||
if (side == 0) {
|
||||
return this.bottom[i];
|
||||
} else if (side == 1) {
|
||||
return this.top[i];
|
||||
} else if (side != tile.facing) {
|
||||
return this.side[i];
|
||||
} else if (tile.isOn) {
|
||||
return this.frontOn[i];
|
||||
} else {
|
||||
return this.frontOff[i];
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
|
||||
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
|
||||
int i = access.getBlockMetadata(x, y, z);
|
||||
if (side == 0) {
|
||||
return this.bottom[i];
|
||||
}
|
||||
else if (side == 1) {
|
||||
return this.top[i];
|
||||
}
|
||||
else if (side != tile.facing) {
|
||||
return this.side[i];
|
||||
}
|
||||
else if (tile.isOn) {
|
||||
return this.frontOn[i];
|
||||
}
|
||||
else {
|
||||
return this.frontOff[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side < 1) {
|
||||
return this.bottom[meta];
|
||||
}
|
||||
if (side == 1) {
|
||||
return this.top[meta];
|
||||
}
|
||||
if (side == 3) {
|
||||
return this.frontOff[meta];
|
||||
}
|
||||
return this.side[meta];
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side < 1) {
|
||||
return this.bottom[meta];
|
||||
}
|
||||
if (side == 1) {
|
||||
return this.top[meta];
|
||||
}
|
||||
if (side == 3) {
|
||||
return this.frontOff[meta];
|
||||
}
|
||||
return this.side[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
|
||||
if (facing == 0)
|
||||
tile.facing = 2;
|
||||
else if (facing == 1)
|
||||
tile.facing = 5;
|
||||
else if (facing == 2)
|
||||
tile.facing = 3;
|
||||
else if (facing == 3)
|
||||
tile.facing = 4;
|
||||
}
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
|
||||
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
|
||||
if (facing == 0)
|
||||
tile.facing = 2;
|
||||
else if (facing == 1)
|
||||
tile.facing = 5;
|
||||
else if (facing == 2)
|
||||
tile.facing = 3;
|
||||
else if (facing == 3)
|
||||
tile.facing = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -24,96 +24,96 @@ import java.util.Random;
|
||||
|
||||
public class BlockEMTMachines extends BlockEMT {
|
||||
|
||||
public BlockEMTMachines() {
|
||||
super(Material.iron);
|
||||
}
|
||||
public BlockEMTMachines() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
this.blockIcon = ir.registerIcon(ModInformation.texturePath + ":machines/top");
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
this.blockIcon = ir.registerIcon(ModInformation.texturePath + ":machines/top");
|
||||
|
||||
this.top[0] = ir.registerIcon(ModInformation.texturePath + ":machines/top");
|
||||
this.top[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratortop");
|
||||
this.top[0] = ir.registerIcon(ModInformation.texturePath + ":machines/top");
|
||||
this.top[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratortop");
|
||||
|
||||
this.bottom[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side");
|
||||
this.bottom[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator");
|
||||
this.bottom[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side");
|
||||
this.bottom[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator");
|
||||
|
||||
this.side[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side");
|
||||
this.side[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator");
|
||||
this.side[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side");
|
||||
this.side[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator");
|
||||
|
||||
this.frontOff[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger");
|
||||
this.frontOff[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfront");
|
||||
this.frontOff[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger");
|
||||
this.frontOff[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfront");
|
||||
|
||||
this.frontOn[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger");
|
||||
this.frontOn[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfrontactive");
|
||||
}
|
||||
this.frontOn[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger");
|
||||
this.frontOn[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfrontactive");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityIndustrialWandRecharge();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityEtherealMacerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityIndustrialWandRecharge();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityEtherealMacerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) {
|
||||
player.openGui(ElectroMagicTools.instance, 0, world, x, y, z);
|
||||
} else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) {
|
||||
player.openGui(ElectroMagicTools.instance, 1, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) {
|
||||
player.openGui(ElectroMagicTools.instance, 0, world, x, y, z);
|
||||
}
|
||||
else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) {
|
||||
player.openGui(ElectroMagicTools.instance, 1, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
dropItems(world, x, y, z);
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
dropItems(world, x, y, z);
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z) {
|
||||
Random rand = new Random();
|
||||
private void dropItems(World world, int x, int y, int z) {
|
||||
Random rand = new Random();
|
||||
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (!(tileEntity instanceof IInventory)) {
|
||||
return;
|
||||
}
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (!(tileEntity instanceof IInventory)) {
|
||||
return;
|
||||
}
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
ItemStack item = inventory.getStackInSlot(i);
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
ItemStack item = inventory.getStackInSlot(i);
|
||||
|
||||
if (item != null && item.stackSize > 0) {
|
||||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
if (item != null && item.stackSize > 0) {
|
||||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound()) {
|
||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
|
||||
}
|
||||
if (item.hasTagCompound()) {
|
||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float factor = 0.05F;
|
||||
entityItem.motionX = rand.nextGaussian() * factor;
|
||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
item.stackSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
float factor = 0.05F;
|
||||
entityItem.motionX = rand.nextGaussian() * factor;
|
||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
item.stackSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,146 +32,146 @@ import java.util.List;
|
||||
|
||||
public class BlockEMTSolars extends BlockBaseContainer {
|
||||
|
||||
public BlockEMTSolars() {
|
||||
super("solars", Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
public BlockEMTSolars() {
|
||||
super("solars", Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[5] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[6] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[7] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[8] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[9] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[10] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[11] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[12] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[13] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[14] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[15] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[5] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[6] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[7] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[8] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[9] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[10] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[11] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[12] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[13] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[14] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
this.top[15] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
|
||||
this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[5] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[6] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[7] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[8] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[9] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[10] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[11] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[12] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[13] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[14] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[15] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[5] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[6] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[7] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[8] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[9] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[10] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[11] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[12] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[13] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[14] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[15] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
|
||||
this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.side[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.side[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.side[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.side[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.side[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.side[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.side[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.side[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.side[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.side[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.side[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
}
|
||||
this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side");
|
||||
this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.side[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside");
|
||||
this.side[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.side[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.side[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside");
|
||||
this.side[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.side[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.side[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside");
|
||||
this.side[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.side[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.side[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside");
|
||||
this.side[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 15; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 15; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityCompressedSolar();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityDoubleCompressedSolar();
|
||||
}
|
||||
if (meta == 2) {
|
||||
return new TileEntityTripleCompressedSolar();
|
||||
}
|
||||
if (meta == 3) {
|
||||
return new TileEntityWaterSolar();
|
||||
}
|
||||
if (meta == 4) {
|
||||
return new TileEntityDoubleWaterSolar();
|
||||
}
|
||||
if (meta == 5) {
|
||||
return new TileEntityTripleWaterSolar();
|
||||
}
|
||||
if (meta == 6) {
|
||||
return new TileEntityDarkSolar();
|
||||
}
|
||||
if (meta == 7) {
|
||||
return new TileEntityDoubleDarkSolar();
|
||||
}
|
||||
if (meta == 8) {
|
||||
return new TileEntityTripleDarkSolar();
|
||||
}
|
||||
if (meta == 9) {
|
||||
return new TileEntityOrderSolar();
|
||||
}
|
||||
if (meta == 10) {
|
||||
return new TileEntityDoubleOrderSolar();
|
||||
}
|
||||
if (meta == 11) {
|
||||
return new TileEntityTripleOrderSolar();
|
||||
}
|
||||
if (meta == 12) {
|
||||
return new TileEntityFireSolar();
|
||||
}
|
||||
if (meta == 13) {
|
||||
return new TileEntityDoubleFireSolar();
|
||||
}
|
||||
if (meta == 14) {
|
||||
return new TileEntityTripleFireSolar();
|
||||
}
|
||||
if (meta == 15) {
|
||||
return new TileEntityAirSolar();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityCompressedSolar();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityDoubleCompressedSolar();
|
||||
}
|
||||
if (meta == 2) {
|
||||
return new TileEntityTripleCompressedSolar();
|
||||
}
|
||||
if (meta == 3) {
|
||||
return new TileEntityWaterSolar();
|
||||
}
|
||||
if (meta == 4) {
|
||||
return new TileEntityDoubleWaterSolar();
|
||||
}
|
||||
if (meta == 5) {
|
||||
return new TileEntityTripleWaterSolar();
|
||||
}
|
||||
if (meta == 6) {
|
||||
return new TileEntityDarkSolar();
|
||||
}
|
||||
if (meta == 7) {
|
||||
return new TileEntityDoubleDarkSolar();
|
||||
}
|
||||
if (meta == 8) {
|
||||
return new TileEntityTripleDarkSolar();
|
||||
}
|
||||
if (meta == 9) {
|
||||
return new TileEntityOrderSolar();
|
||||
}
|
||||
if (meta == 10) {
|
||||
return new TileEntityDoubleOrderSolar();
|
||||
}
|
||||
if (meta == 11) {
|
||||
return new TileEntityTripleOrderSolar();
|
||||
}
|
||||
if (meta == 12) {
|
||||
return new TileEntityFireSolar();
|
||||
}
|
||||
if (meta == 13) {
|
||||
return new TileEntityDoubleFireSolar();
|
||||
}
|
||||
if (meta == 14) {
|
||||
return new TileEntityTripleFireSolar();
|
||||
}
|
||||
if (meta == 15) {
|
||||
return new TileEntityAirSolar();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
}
|
||||
@@ -21,69 +21,68 @@ import java.util.List;
|
||||
|
||||
public class BlockEMTSolars2 extends BlockBaseContainer {
|
||||
|
||||
public BlockEMTSolars2() {
|
||||
super("solars.2", Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
public BlockEMTSolars2() {
|
||||
super("solars.2", Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop");
|
||||
this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop");
|
||||
this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop");
|
||||
|
||||
this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom");
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
|
||||
this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
}
|
||||
this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside");
|
||||
this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityDoubleAirSolar();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityTripleAirSolar();
|
||||
}
|
||||
if (meta == 2) {
|
||||
return new TileEntityEarthSolar();
|
||||
}
|
||||
if (meta == 3) {
|
||||
return new TileEntityDoubleEarthSolar();
|
||||
}
|
||||
if (meta == 4) {
|
||||
return new TileEntityTripleEarthSolar();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
if (meta == 0) {
|
||||
return new TileEntityDoubleAirSolar();
|
||||
}
|
||||
if (meta == 1) {
|
||||
return new TileEntityTripleAirSolar();
|
||||
}
|
||||
if (meta == 2) {
|
||||
return new TileEntityEarthSolar();
|
||||
}
|
||||
if (meta == 3) {
|
||||
return new TileEntityDoubleEarthSolar();
|
||||
}
|
||||
if (meta == 4) {
|
||||
return new TileEntityTripleEarthSolar();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
}
|
||||
@@ -17,58 +17,62 @@ import java.util.Random;
|
||||
|
||||
public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
|
||||
public BlockEssentiaGenerators() {
|
||||
super("generator.essentia.2", Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
public BlockEssentiaGenerators() {
|
||||
super("generator.essentia.2", Material.iron, soundTypeMetal, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.blockIcon = ri.registerIcon(ModInformation.texturePath + ":machines/top");
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.blockIcon = ri.registerIcon(ModInformation.texturePath + ":machines/top");
|
||||
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.top[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top");
|
||||
}
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.top[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top");
|
||||
}
|
||||
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.bottom[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top");
|
||||
}
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.bottom[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top");
|
||||
}
|
||||
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.side[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/side");
|
||||
}
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
this.side[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/side");
|
||||
}
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/potentiafront");
|
||||
this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/ignisfront");
|
||||
this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/auramfront");
|
||||
this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/arborfront");
|
||||
this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/aerfront");
|
||||
}
|
||||
this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/potentiafront");
|
||||
this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/ignisfront");
|
||||
this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/auramfront");
|
||||
this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/arborfront");
|
||||
this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/aerfront");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
list.add(new ItemStack(id, 1, 3));
|
||||
list.add(new ItemStack(id, 1, 4));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
list.add(new ItemStack(id, 1, 3));
|
||||
list.add(new ItemStack(id, 1, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
switch(meta){
|
||||
case 0 : return new TileEntityPotentiaGenerator();
|
||||
case 1 : return new TileEntityIgnisGenerator();
|
||||
case 2 : return new TileEntityAuramGenerator();
|
||||
case 3 : return new TileEntityArborGenerator();
|
||||
case 4 : return new TileEntityAerGenerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return new TileEntityPotentiaGenerator();
|
||||
case 1:
|
||||
return new TileEntityIgnisGenerator();
|
||||
case 2:
|
||||
return new TileEntityAuramGenerator();
|
||||
case 3:
|
||||
return new TileEntityArborGenerator();
|
||||
case 4:
|
||||
return new TileEntityAerGenerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
world.spawnParticle("largesmoke", x + 0.5f, y + 1.0f, z + 0.5f, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
world.spawnParticle("largesmoke", x + 0.5f, y + 1.0f, z + 0.5f, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,6 @@ public class BlockPortableNode extends BlockAiry {
|
||||
return this.texture[0];
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
|
||||
@@ -17,61 +17,61 @@ import java.util.Random;
|
||||
|
||||
public class BlockShield extends Block {
|
||||
|
||||
public BlockShield() {
|
||||
super(Material.rock);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setHardness(1F);
|
||||
this.setResistance(10000000000000000000000000000000000000F);
|
||||
}
|
||||
public BlockShield() {
|
||||
super(Material.rock);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setHardness(1F);
|
||||
this.setResistance(10000000000000000000000000000000000000F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random) {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shield");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shield");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
||||
}
|
||||
@Override
|
||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
||||
}
|
||||
}
|
||||
@@ -25,93 +25,93 @@ import net.minecraftforge.common.IExtendedEntityProperties;
|
||||
|
||||
public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties {
|
||||
|
||||
public EntityArcher(World par1World) {
|
||||
super(par1World);
|
||||
this.isImmuneToFire = true;
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
|
||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
|
||||
}
|
||||
public EntityArcher(World par1World) {
|
||||
super(par1World);
|
||||
this.isImmuneToFire = true;
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
|
||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
|
||||
}
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource par1DamageSource) {
|
||||
super.onDeath(par1DamageSource);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
|
||||
this.setDead();
|
||||
}
|
||||
@Override
|
||||
public void onDeath(DamageSource par1DamageSource) {
|
||||
super.onDeath(par1DamageSource);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Items.arrow;
|
||||
}
|
||||
@Override
|
||||
protected Item getDropItem() {
|
||||
return Items.arrow;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean par1, int par2) {
|
||||
int j;
|
||||
int k;
|
||||
@Override
|
||||
protected void dropFewItems(boolean par1, int par2) {
|
||||
int j;
|
||||
int k;
|
||||
|
||||
j = this.rand.nextInt(3 + par2);
|
||||
j = this.rand.nextInt(3 + par2);
|
||||
|
||||
for (k = 0; k < j; ++k) {
|
||||
this.dropItem(Items.arrow, 1);
|
||||
}
|
||||
j = this.rand.nextInt(3 + par2);
|
||||
for (k = 0; k < j; ++k) {
|
||||
this.dropItem(Items.arrow, 1);
|
||||
}
|
||||
j = this.rand.nextInt(3 + par2);
|
||||
|
||||
for (k = 0; k < j; ++k) {
|
||||
this.dropItem(Items.bone, 1);
|
||||
}
|
||||
}
|
||||
for (k = 0; k < j; ++k) {
|
||||
this.dropItem(Items.bone, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropRareDrop(int par1) {
|
||||
this.entityDropItem(new ItemStack(Items.snowball, 1, 1), 0.0F);
|
||||
}
|
||||
@Override
|
||||
protected void dropRareDrop(int par1) {
|
||||
this.entityDropItem(new ItemStack(Items.snowball, 1, 1), 0.0F);
|
||||
}
|
||||
|
||||
protected void addRandomArmor() {
|
||||
super.addRandomArmor();
|
||||
this.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
|
||||
}
|
||||
protected void addRandomArmor() {
|
||||
super.addRandomArmor();
|
||||
this.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) {
|
||||
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
|
||||
int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
|
||||
int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
|
||||
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
|
||||
@Override
|
||||
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) {
|
||||
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
|
||||
int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
|
||||
int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
|
||||
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
|
||||
|
||||
if (i > 0) {
|
||||
entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
|
||||
}
|
||||
if (i > 0) {
|
||||
entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
|
||||
}
|
||||
|
||||
if (j > 0) {
|
||||
entityarrow.setKnockbackStrength(j);
|
||||
}
|
||||
if (j > 0) {
|
||||
entityarrow.setKnockbackStrength(j);
|
||||
}
|
||||
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
|
||||
entityarrow.setFire(100);
|
||||
}
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
|
||||
entityarrow.setFire(100);
|
||||
}
|
||||
|
||||
this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
|
||||
this.worldObj.spawnEntityInWorld(entityarrow);
|
||||
}
|
||||
this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
|
||||
this.worldObj.spawnEntityInWorld(entityarrow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound compound) {
|
||||
}
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound compound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound compound) {
|
||||
}
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound compound) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Entity entity, World world) {
|
||||
}
|
||||
@Override
|
||||
public void init(Entity entity, World world) {
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -44,15 +45,15 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
this.yOffset = 0.0F;
|
||||
}
|
||||
|
||||
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) {
|
||||
super(par1World);
|
||||
public EntityLaser(World world, EntityLivingBase entity, EntityLivingBase par3EntityLivingBase, float par4, float par5) {
|
||||
super(world);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = par2EntityLivingBase;
|
||||
this.shootingEntity = entity;
|
||||
|
||||
this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
|
||||
this.posY = entity.posY + (double) entity.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = par3EntityLivingBase.posX - entity.posX;
|
||||
double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 3.0F) - this.posY;
|
||||
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
|
||||
double d2 = par3EntityLivingBase.posZ - entity.posZ;
|
||||
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
if (d3 >= 1.0E-7D) {
|
||||
@@ -60,20 +61,20 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
|
||||
double d4 = d0 / d3;
|
||||
double d5 = d2 / d3;
|
||||
this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3);
|
||||
this.setLocationAndAngles(entity.posX + d4, this.posY, entity.posZ + d5, f2, f3);
|
||||
this.yOffset = 0.0F;
|
||||
float f4 = (float) d3 * 0.2F;
|
||||
this.setThrowableHeading(d0, d1 + (double) f4, d2, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, float par3) {
|
||||
super(par1World);
|
||||
public EntityLaser(World world, EntityLivingBase entity, float par3) {
|
||||
super(world);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = par2EntityLivingBase;
|
||||
this.shootingEntity = entity;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch);
|
||||
this.setLocationAndAngles(entity.posX, entity.posY + (double) entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
|
||||
@@ -132,7 +133,6 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
@@ -163,18 +163,19 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
if (this.inGround) {
|
||||
Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
|
||||
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
|
||||
if(!this.worldObj.isRemote){
|
||||
this.worldObj.createExplosion(this, (int)this.posX, (int)this.posY, (int)this.posZ, 3, true);
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.createExplosion(this, (int) this.posX, (int) this.posY, (int) this.posZ, 3, true);
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
|
||||
if (j == this.inTile && k == this.inData) {
|
||||
++this.ticksInGround;
|
||||
|
||||
|
||||
if (this.ticksInGround == 1200) {
|
||||
this.setDead();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.inGround = false;
|
||||
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
|
||||
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
|
||||
@@ -182,7 +183,8 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
this.ticksInGround = 0;
|
||||
this.ticksInAir = 0;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
++this.ticksInAir;
|
||||
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
@@ -246,7 +248,8 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
this.prevRotationYaw += 180.0F;
|
||||
this.ticksInAir = 0;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.xTile = movingobjectposition.blockX;
|
||||
this.yTile = movingobjectposition.blockY;
|
||||
this.zTile = movingobjectposition.blockZ;
|
||||
@@ -308,22 +311,22 @@ public class EntityLaser extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
par1NBTTagCompound.setShort("xTile", (short) this.xTile);
|
||||
par1NBTTagCompound.setShort("yTile", (short) this.yTile);
|
||||
par1NBTTagCompound.setShort("zTile", (short) this.zTile);
|
||||
par1NBTTagCompound.setByte("inTile", (byte) Block.getIdFromBlock(this.inTile));
|
||||
par1NBTTagCompound.setByte("inData", (byte) this.inData);
|
||||
par1NBTTagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0));
|
||||
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
nbt.setShort("xTile", (short) this.xTile);
|
||||
nbt.setShort("yTile", (short) this.yTile);
|
||||
nbt.setShort("zTile", (short) this.zTile);
|
||||
nbt.setByte("inTile", (byte) Block.getIdFromBlock(this.inTile));
|
||||
nbt.setByte("inData", (byte) this.inData);
|
||||
nbt.setBoolean("inGround", this.inGround);
|
||||
}
|
||||
|
||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
this.xTile = par1NBTTagCompound.getShort("xTile");
|
||||
this.yTile = par1NBTTagCompound.getShort("yTile");
|
||||
this.zTile = par1NBTTagCompound.getShort("zTile");
|
||||
this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255);
|
||||
this.inData = par1NBTTagCompound.getByte("inData") & 255;
|
||||
this.inGround = par1NBTTagCompound.getByte("inGround") == 1;
|
||||
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
this.xTile = nbt.getShort("xTile");
|
||||
this.yTile = nbt.getShort("yTile");
|
||||
this.zTile = nbt.getShort("zTile");
|
||||
this.inTile = Block.getBlockById(nbt.getByte("inTile") & 255);
|
||||
this.inData = nbt.getByte("inData") & 255;
|
||||
this.inGround = nbt.getBoolean("inGround");
|
||||
}
|
||||
|
||||
public void onCollide(Entity par1Entity) {
|
||||
|
||||
@@ -22,52 +22,51 @@ import tombenpotter.emt.common.items.blocks.ItemBlockEssentiaGenerators;
|
||||
|
||||
public class BlockRegistry {
|
||||
|
||||
public static Block portableNode;
|
||||
public static Block essentiaGens;
|
||||
public static Block shield;
|
||||
public static Block emtSolars;
|
||||
public static Block emtMachines;
|
||||
public static Block emtSolars2;
|
||||
public static Block portableNode;
|
||||
public static Block essentiaGens;
|
||||
public static Block shield;
|
||||
public static Block emtSolars;
|
||||
public static Block emtMachines;
|
||||
public static Block emtSolars2;
|
||||
|
||||
public static void registerBlocks() {
|
||||
portableNode = new BlockPortableNode().setBlockName(ModInformation.modid + ".portablenode");
|
||||
GameRegistry.registerBlock(portableNode, "PortableNode");
|
||||
|
||||
public static void registerBlocks() {
|
||||
portableNode = new BlockPortableNode().setBlockName(ModInformation.modid + ".portablenode");
|
||||
GameRegistry.registerBlock(portableNode, "PortableNode");
|
||||
|
||||
shield = new BlockShield().setBlockName(ModInformation.modid + ".shield");
|
||||
GameRegistry.registerBlock(shield, "ShieldBlock");
|
||||
shield = new BlockShield().setBlockName(ModInformation.modid + ".shield");
|
||||
GameRegistry.registerBlock(shield, "ShieldBlock");
|
||||
|
||||
emtSolars = new BlockEMTSolars().setBlockName(ModInformation.modid + ".emtsolars");
|
||||
GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMTSolars");
|
||||
emtSolars = new BlockEMTSolars().setBlockName(ModInformation.modid + ".emtsolars");
|
||||
GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMTSolars");
|
||||
|
||||
emtSolars2 = new BlockEMTSolars2().setBlockName(ModInformation.modid + ".emtsolars2");
|
||||
GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMTSolars2");
|
||||
emtSolars2 = new BlockEMTSolars2().setBlockName(ModInformation.modid + ".emtsolars2");
|
||||
GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMTSolars2");
|
||||
|
||||
emtMachines = new BlockEMTMachines().setBlockName(ModInformation.modid + ".emtmachines");
|
||||
GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMTMachines");
|
||||
emtMachines = new BlockEMTMachines().setBlockName(ModInformation.modid + ".emtmachines");
|
||||
GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMTMachines");
|
||||
|
||||
essentiaGens = new BlockEssentiaGenerators().setBlockName(ModInformation.modid + ".essentiaGens");
|
||||
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
|
||||
}
|
||||
|
||||
public static void addAspects(){
|
||||
registerObjectTag(IC2Items.getItem("rubberTrampoline"), new AspectList().add(Aspect.AIR, 5));
|
||||
registerObjectTag(IC2Items.getItem("ironFence"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.METAL, 2).add(Aspect.WEATHER, 1));
|
||||
registerObjectTag(IC2Items.getItem("reinforcedGlass"), new AspectList().add(Aspect.METAL, 2).add(Aspect.COLD, 2));
|
||||
registerObjectTag(IC2Items.getItem("scaffold"), new AspectList().add(Aspect.TREE, 4));
|
||||
registerObjectTag(IC2Items.getItem("ironScaffold"), new AspectList().add(Aspect.METAL, 4));
|
||||
registerObjectTag(IC2Items.getItem("generator"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("waterMill"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("solarPanel"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("windMill"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.WEATHER, 3).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("batBox"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 3).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("cesuUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 4).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("mfeUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("mfsUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 7).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("ironFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("electroFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("macerator"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("extractor"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("compressor"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3).add(Aspect.MECHANISM, 1));
|
||||
}
|
||||
essentiaGens = new BlockEssentiaGenerators().setBlockName(ModInformation.modid + ".essentiaGens");
|
||||
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
|
||||
}
|
||||
|
||||
public static void addAspects() {
|
||||
registerObjectTag(IC2Items.getItem("rubberTrampoline"), new AspectList().add(Aspect.AIR, 5));
|
||||
registerObjectTag(IC2Items.getItem("ironFence"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.METAL, 2).add(Aspect.WEATHER, 1));
|
||||
registerObjectTag(IC2Items.getItem("reinforcedGlass"), new AspectList().add(Aspect.METAL, 2).add(Aspect.COLD, 2));
|
||||
registerObjectTag(IC2Items.getItem("scaffold"), new AspectList().add(Aspect.TREE, 4));
|
||||
registerObjectTag(IC2Items.getItem("ironScaffold"), new AspectList().add(Aspect.METAL, 4));
|
||||
registerObjectTag(IC2Items.getItem("generator"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("waterMill"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("solarPanel"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("windMill"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.WEATHER, 3).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("batBox"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 3).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("cesuUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 4).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("mfeUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("mfsUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 7).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("ironFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("electroFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("macerator"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("extractor"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2).add(Aspect.MECHANISM, 1));
|
||||
registerObjectTag(IC2Items.getItem("compressor"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3).add(Aspect.MECHANISM, 1));
|
||||
}
|
||||
}
|
||||
@@ -10,29 +10,30 @@ import tombenpotter.emt.common.entities.EntityLaser;
|
||||
|
||||
public class EntityRegistry {
|
||||
|
||||
private static int startEID = 300;
|
||||
private static int entityIDs = 0;
|
||||
private static int startEID = 300;
|
||||
private static int entityIDs = 0;
|
||||
|
||||
private static int getUniqueEntityID() {
|
||||
private static int getUniqueEntityID() {
|
||||
|
||||
do {
|
||||
startEID++;
|
||||
} while (EntityList.getStringFromID(startEID) != null);
|
||||
return startEID;
|
||||
}
|
||||
do {
|
||||
startEID++;
|
||||
}
|
||||
while (EntityList.getStringFromID(startEID) != null);
|
||||
return startEID;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
|
||||
int id = getUniqueEntityID();
|
||||
EntityList.IDtoClassMapping.put(id, entity);
|
||||
EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
|
||||
return;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
|
||||
int id = getUniqueEntityID();
|
||||
EntityList.IDtoClassMapping.put(id, entity);
|
||||
EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
|
||||
return;
|
||||
}
|
||||
|
||||
public static void registerEMTEntities() {
|
||||
public static void registerEMTEntities() {
|
||||
|
||||
cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityLaser.class, "entityLaser", entityIDs++, ElectroMagicTools.instance, 80, 3, true);
|
||||
cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityArcher.class, "entityArcher", entityIDs++, ElectroMagicTools.instance, 80, 3, true);
|
||||
registerEntityEgg(EntityArcher.class, 0x99111F, 0xE5685);
|
||||
}
|
||||
cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityLaser.class, "laser", entityIDs++, ElectroMagicTools.instance, 80, 3, true);
|
||||
cpw.mods.fml.common.registry.EntityRegistry.registerModEntity(EntityArcher.class, "archer", entityIDs++, ElectroMagicTools.instance, 80, 3, true);
|
||||
registerEntityEgg(EntityArcher.class, 0x99111F, 0xE5685);
|
||||
}
|
||||
}
|
||||
@@ -46,142 +46,144 @@ import tombenpotter.emt.common.items.tools.omnitools.ItemOmnitoolIron;
|
||||
import tombenpotter.emt.common.items.tools.omnitools.ItemOmnitoolThaumium;
|
||||
|
||||
public class ItemRegistry {
|
||||
|
||||
public static Item onering;
|
||||
public static Item materials;
|
||||
public static Item craftingComponents;
|
||||
public static Item focusChristmas;
|
||||
public static Item thaumiumDrill;
|
||||
public static Item thaumiumChainsaw;
|
||||
public static Item quantumThaumicHelmet;
|
||||
public static Item diamondChainsaw;
|
||||
public static Item ironOmnitool;
|
||||
public static Item diamondOmnitool;
|
||||
public static Item thaumiumOmnitool;
|
||||
public static Item nanoThaumicHelmet;
|
||||
public static Item explosionFocus;
|
||||
public static Item christmasFocus;
|
||||
public static Item shieldFocus;
|
||||
public static Item electricGoggles;
|
||||
public static Item streamChainsaw;
|
||||
public static Item rockbreakerDrill;
|
||||
public static Item solarHelmetRevealing;
|
||||
public static Item thorHammer;
|
||||
public static Item taintedThorHammer;
|
||||
public static Item electricThorHammer;
|
||||
public static Item electricBootsTraveller;
|
||||
public static Item quantumBootsTraveller;
|
||||
public static Item nanoBootsTraveller;
|
||||
public static Item electricScribingTools;
|
||||
public static Item itemEMTItems;
|
||||
public static Item electricHoeGrowth;
|
||||
public static Item chargeFocus;
|
||||
public static Item emtBauble;
|
||||
public static Item wandChargeFocus;
|
||||
public static Item featherWing;
|
||||
public static Item thaumiumWing;
|
||||
public static Item nanoWing;
|
||||
public static Item quantumWing;
|
||||
public static Item quantumArmor;
|
||||
public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[]{2, 2, 2, 2}, 6);
|
||||
|
||||
public static void registerItems() {
|
||||
itemEMTItems = new ItemMaterials().setUnlocalizedName(ModInformation.modid + ".emtitems");
|
||||
GameRegistry.registerItem(itemEMTItems, "EMTItems");
|
||||
|
||||
emtBauble = new ItemIC2Baubles().setUnlocalizedName(ModInformation.modid + ".emtbauble");
|
||||
GameRegistry.registerItem(emtBauble, "EMTBaubles");
|
||||
|
||||
onering = new ItemOneRing();
|
||||
GameRegistry.registerItem(onering, "BaseBaubles");
|
||||
|
||||
quantumArmor = new ItemInfusedQuantumChestplate(InternalName.itemArmorQuantumChestplate, 1).setUnlocalizedName(ModInformation.modid + ".quantum");
|
||||
|
||||
electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.electric");
|
||||
GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing");
|
||||
|
||||
nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.nano");
|
||||
GameRegistry.registerItem(nanoThaumicHelmet, "NanosuitGogglesRevealing");
|
||||
|
||||
quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.quantum");
|
||||
GameRegistry.registerItem(quantumThaumicHelmet, "QuantumGogglesRevealing");
|
||||
|
||||
solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.solar");
|
||||
GameRegistry.registerItem(solarHelmetRevealing, "SolarHelmetRevealing");
|
||||
public static Item onering;
|
||||
public static Item materials;
|
||||
public static Item craftingComponents;
|
||||
public static Item focusChristmas;
|
||||
public static Item thaumiumDrill;
|
||||
public static Item thaumiumChainsaw;
|
||||
public static Item quantumThaumicHelmet;
|
||||
public static Item diamondChainsaw;
|
||||
public static Item ironOmnitool;
|
||||
public static Item diamondOmnitool;
|
||||
public static Item thaumiumOmnitool;
|
||||
public static Item nanoThaumicHelmet;
|
||||
public static Item explosionFocus;
|
||||
public static Item christmasFocus;
|
||||
public static Item shieldFocus;
|
||||
public static Item electricGoggles;
|
||||
public static Item streamChainsaw;
|
||||
public static Item rockbreakerDrill;
|
||||
public static Item solarHelmetRevealing;
|
||||
public static Item thorHammer;
|
||||
public static Item taintedThorHammer;
|
||||
public static Item electricThorHammer;
|
||||
public static Item electricBootsTraveller;
|
||||
public static Item quantumBootsTraveller;
|
||||
public static Item nanoBootsTraveller;
|
||||
public static Item electricScribingTools;
|
||||
public static Item itemEMTItems;
|
||||
public static Item electricHoeGrowth;
|
||||
public static Item chargeFocus;
|
||||
public static Item emtBauble;
|
||||
public static Item wandChargeFocus;
|
||||
public static Item featherWing;
|
||||
public static Item thaumiumWing;
|
||||
public static Item nanoWing;
|
||||
public static Item quantumWing;
|
||||
public static Item quantumArmor;
|
||||
public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[] { 2, 2, 2, 2 }, 6);
|
||||
|
||||
electricBootsTraveller = new ItemElectricBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".boots.traveller.electric");
|
||||
GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller");
|
||||
|
||||
nanoBootsTraveller = new ItemNanoBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".boots.traveller.nano");
|
||||
GameRegistry.registerItem(nanoBootsTraveller, "NanoBootsTraveller");
|
||||
|
||||
quantumBootsTraveller = new ItemQuantumBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".boots.traveller.quantum");
|
||||
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
|
||||
public static void registerItems() {
|
||||
itemEMTItems = new ItemMaterials();
|
||||
GameRegistry.registerItem(itemEMTItems, "EMTItems");
|
||||
OreDictionary.registerOre("plateThaumium", new ItemStack(itemEMTItems, 1, 5));
|
||||
OreDictionary.registerOre("slimeball", new ItemStack(itemEMTItems, 1, 8));
|
||||
|
||||
electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(ModInformation.modid + ".scribingtools.electric");
|
||||
GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools");
|
||||
emtBauble = new ItemIC2Baubles().setUnlocalizedName(ModInformation.modid + ".bauble");
|
||||
GameRegistry.registerItem(emtBauble, "EMTBaubles");
|
||||
|
||||
featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.feather");
|
||||
GameRegistry.registerItem(featherWing, "FeatherWing");
|
||||
|
||||
thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.thaumium");
|
||||
GameRegistry.registerItem(thaumiumWing, "ThaumiumWing");
|
||||
|
||||
nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.nano");
|
||||
GameRegistry.registerItem(nanoWing, "NanosuitWing");
|
||||
|
||||
quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.quantum");
|
||||
GameRegistry.registerItem(quantumWing, "QuantumWing");
|
||||
onering = new ItemOneRing();
|
||||
GameRegistry.registerItem(onering, "BaseBaubles");
|
||||
|
||||
thorHammer = new ItemThorHammer().setUnlocalizedName(ModInformation.modid + ".hammer");
|
||||
GameRegistry.registerItem(thorHammer, "Mjolnir");
|
||||
|
||||
taintedThorHammer = new ItemThorHammerBroken().setUnlocalizedName(ModInformation.modid + ".hammer.broken");
|
||||
GameRegistry.registerItem(taintedThorHammer, "TaintedMjolnir");
|
||||
|
||||
electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName(ModInformation.modid + ".hammer.electric");
|
||||
GameRegistry.registerItem(electricThorHammer, "SuperchargedMjolnir");
|
||||
quantumArmor = new ItemInfusedQuantumChestplate(InternalName.itemArmorQuantumChestplate, 1).setUnlocalizedName(ModInformation.modid + ".quantum");
|
||||
|
||||
thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName(ModInformation.modid + ".drill.thaumium");
|
||||
GameRegistry.registerItem(thaumiumDrill, "ThaumiumDrill");
|
||||
electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.electric");
|
||||
GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing");
|
||||
|
||||
diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName(ModInformation.modid + ".chainsaw.diamond");
|
||||
GameRegistry.registerItem(diamondChainsaw, "DiamondChainsaw");
|
||||
|
||||
thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName(ModInformation.modid + ".chainsaw.thaumium");
|
||||
GameRegistry.registerItem(thaumiumChainsaw, "ThaumiumChainsaw");
|
||||
nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.nano");
|
||||
GameRegistry.registerItem(nanoThaumicHelmet, "NanosuitGogglesRevealing");
|
||||
|
||||
ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName(ModInformation.modid + ".omnitool.iron");
|
||||
GameRegistry.registerItem(ironOmnitool, "Omnitool");
|
||||
|
||||
diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName(ModInformation.modid + ".omnitool.diamond");
|
||||
GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool");
|
||||
|
||||
thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName(ModInformation.modid + ".omnitool.thaumium");
|
||||
GameRegistry.registerItem(thaumiumOmnitool, "ThaumiumOmnitool");
|
||||
quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.quantum");
|
||||
GameRegistry.registerItem(quantumThaumicHelmet, "QuantumGogglesRevealing");
|
||||
|
||||
streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName(ModInformation.modid + ".chainsaw.stream");
|
||||
GameRegistry.registerItem(streamChainsaw, "ChainsawStream");
|
||||
|
||||
rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName(ModInformation.modid + ".drill.rockbreaker");
|
||||
GameRegistry.registerItem(rockbreakerDrill, "DrillRockbreaker");
|
||||
|
||||
electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName(ModInformation.modid + ".hoeofgrowth.electric");
|
||||
GameRegistry.registerItem(electricHoeGrowth, "ElectricHoeGrowth");
|
||||
solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.solar");
|
||||
GameRegistry.registerItem(solarHelmetRevealing, "SolarHelmetRevealing");
|
||||
|
||||
explosionFocus = new ItemExplosionFocus();
|
||||
GameRegistry.registerItem(explosionFocus, "ExplosionFocus");
|
||||
|
||||
christmasFocus = new ItemChristmasFocus();
|
||||
GameRegistry.registerItem(christmasFocus, "ChristmasFocus");
|
||||
|
||||
shieldFocus = new ItemShieldFocus();
|
||||
GameRegistry.registerItem(shieldFocus, "ShieldFocus");
|
||||
|
||||
chargeFocus = new ItemChargeFocus();
|
||||
GameRegistry.registerItem(chargeFocus, "ChargingFocus");
|
||||
|
||||
wandChargeFocus = new ItemWandChargingFocus();
|
||||
GameRegistry.registerItem(wandChargeFocus, "WandChargingFocus");
|
||||
}
|
||||
electricBootsTraveller = new ItemElectricBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".boots.traveller.electric");
|
||||
GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller");
|
||||
|
||||
nanoBootsTraveller = new ItemNanoBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".boots.traveller.nano");
|
||||
GameRegistry.registerItem(nanoBootsTraveller, "NanoBootsTraveller");
|
||||
|
||||
quantumBootsTraveller = new ItemQuantumBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".boots.traveller.quantum");
|
||||
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
|
||||
|
||||
electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(ModInformation.modid + ".scribingtools.electric");
|
||||
GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools");
|
||||
|
||||
featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.feather");
|
||||
GameRegistry.registerItem(featherWing, "FeatherWing");
|
||||
|
||||
thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.thaumium");
|
||||
GameRegistry.registerItem(thaumiumWing, "ThaumiumWing");
|
||||
|
||||
nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.nano");
|
||||
GameRegistry.registerItem(nanoWing, "NanosuitWing");
|
||||
|
||||
quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".wing.quantum");
|
||||
GameRegistry.registerItem(quantumWing, "QuantumWing");
|
||||
|
||||
thorHammer = new ItemThorHammer().setUnlocalizedName(ModInformation.modid + ".hammer");
|
||||
GameRegistry.registerItem(thorHammer, "Mjolnir");
|
||||
|
||||
taintedThorHammer = new ItemThorHammerBroken().setUnlocalizedName(ModInformation.modid + ".hammer.broken");
|
||||
GameRegistry.registerItem(taintedThorHammer, "TaintedMjolnir");
|
||||
|
||||
electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName(ModInformation.modid + ".hammer.electric");
|
||||
GameRegistry.registerItem(electricThorHammer, "SuperchargedMjolnir");
|
||||
|
||||
thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName(ModInformation.modid + ".drill.thaumium");
|
||||
GameRegistry.registerItem(thaumiumDrill, "ThaumiumDrill");
|
||||
|
||||
diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName(ModInformation.modid + ".chainsaw.diamond");
|
||||
GameRegistry.registerItem(diamondChainsaw, "DiamondChainsaw");
|
||||
|
||||
thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName(ModInformation.modid + ".chainsaw.thaumium");
|
||||
GameRegistry.registerItem(thaumiumChainsaw, "ThaumiumChainsaw");
|
||||
|
||||
ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName(ModInformation.modid + ".omnitool.iron");
|
||||
GameRegistry.registerItem(ironOmnitool, "Omnitool");
|
||||
|
||||
diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName(ModInformation.modid + ".omnitool.diamond");
|
||||
GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool");
|
||||
|
||||
thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName(ModInformation.modid + ".omnitool.thaumium");
|
||||
GameRegistry.registerItem(thaumiumOmnitool, "ThaumiumOmnitool");
|
||||
|
||||
streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName(ModInformation.modid + ".chainsaw.stream");
|
||||
GameRegistry.registerItem(streamChainsaw, "ChainsawStream");
|
||||
|
||||
rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName(ModInformation.modid + ".drill.rockbreaker");
|
||||
GameRegistry.registerItem(rockbreakerDrill, "DrillRockbreaker");
|
||||
|
||||
electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName(ModInformation.modid + ".hoeofgrowth.electric");
|
||||
GameRegistry.registerItem(electricHoeGrowth, "ElectricHoeGrowth");
|
||||
|
||||
explosionFocus = new ItemExplosionFocus();
|
||||
GameRegistry.registerItem(explosionFocus, "ExplosionFocus");
|
||||
|
||||
christmasFocus = new ItemChristmasFocus();
|
||||
GameRegistry.registerItem(christmasFocus, "ChristmasFocus");
|
||||
|
||||
shieldFocus = new ItemShieldFocus();
|
||||
GameRegistry.registerItem(shieldFocus, "ShieldFocus");
|
||||
|
||||
chargeFocus = new ItemChargeFocus();
|
||||
GameRegistry.registerItem(chargeFocus, "ChargingFocus");
|
||||
|
||||
wandChargeFocus = new ItemWandChargingFocus();
|
||||
GameRegistry.registerItem(wandChargeFocus, "WandChargingFocus");
|
||||
}
|
||||
}
|
||||
@@ -41,42 +41,36 @@ public class RecipeRegistry {
|
||||
|
||||
public static ItemStack uuMCell = new ItemStack(ItemRegistry.itemEMTItems, 1, 15);
|
||||
|
||||
private static void registerShapedRecipes() {
|
||||
private static void registerShapedRecipes() {
|
||||
|
||||
/** Crafting Recipes **/
|
||||
ironOmnitool = GameRegistry.addShapedRecipe(RandomHelper.getChargedItem(ItemRegistry.ironOmnitool, 10), "X", "Z", "Y", 'X', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', new ItemStack(IC2Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', IC2Items.getItem("plateiron"));
|
||||
diamondChainsaw = GameRegistry.addShapedRecipe(RandomHelper.getChargedItem(ItemRegistry.diamondChainsaw, 10), " X ", "XYX", 'X', new ItemStack(Items.diamond), 'Y', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
ductTape = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 9), "XXX", "YYY", "XXX", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 8), 'Y', new ItemStack(Items.paper));
|
||||
featherMesh = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 7), "XYX", "YXY", "XYX", 'X', new ItemStack(Items.feather), 'Y', new ItemStack(ItemRegistry.itemEMTItems, 1, 9));
|
||||
featherWing = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 12), "XYZ", "XYZ", "XYZ", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 7), 'Y', new ItemStack(ItemRegistry.itemEMTItems, 1, 8), 'Z', new ItemStack(ItemRegistry.itemEMTItems, 1, 11));
|
||||
featherWings = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.featherWing), "XX", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 12));
|
||||
taintedFeathers = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 13), " X ", "XYX", " X ", 'X', new ItemStack(ConfigItems.itemResource, 1, 12), 'Y', new ItemStack(Items.feather));
|
||||
/** Crafting Recipes **/
|
||||
ironOmnitool = GameRegistry.addShapedRecipe(RandomHelper.getChargedItem(ItemRegistry.ironOmnitool, 10), "X", "Z", "Y", 'X', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', new ItemStack(IC2Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', IC2Items.getItem("plateiron"));
|
||||
diamondChainsaw = GameRegistry.addShapedRecipe(RandomHelper.getChargedItem(ItemRegistry.diamondChainsaw, 10), " X ", "XYX", 'X', new ItemStack(Items.diamond), 'Y', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
ductTape = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 9), "XXX", "YYY", "XXX", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 8), 'Y', new ItemStack(Items.paper));
|
||||
featherMesh = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 7), "XYX", "YXY", "XYX", 'X', new ItemStack(Items.feather), 'Y', new ItemStack(ItemRegistry.itemEMTItems, 1, 9));
|
||||
featherWing = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 12), "XYZ", "XYZ", "XYZ", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 7), 'Y', new ItemStack(ItemRegistry.itemEMTItems, 1, 8), 'Z', new ItemStack(ItemRegistry.itemEMTItems, 1, 11));
|
||||
featherWings = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.featherWing), "XX", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 12));
|
||||
taintedFeathers = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 13), " X ", "XYX", " X ", 'X', new ItemStack(ConfigItems.itemResource, 1, 12), 'Y', new ItemStack(Items.feather));
|
||||
|
||||
if (!Loader.isModLoaded("gregtech_addon")) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(IC2Items.getItem("diamondDrill"), " Y ", "YXY", 'Y', "gemDiamond", 'X', new ItemStack(IC2Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE)));
|
||||
} else {
|
||||
ElectroMagicTools.logger.info("GregTech Addon detected. Disabling the fix for the Diamond Drill recipe.");
|
||||
}
|
||||
GameRegistry.addRecipe(IC2Items.getItem("nanoHelmet"), "XYX", "XZX", 'X', IC2Items.getItem("carbonPlate"), 'Y', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(IC2Items.getItem("nightvisionGoggles").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
|
||||
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', IC2Items.getItem("reBattery"), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
|
||||
|
||||
GameRegistry.addRecipe(IC2Items.getItem("nanoHelmet"), "XYX", "XZX", 'X', IC2Items.getItem("carbonPlate"), 'Y', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(IC2Items.getItem("nightvisionGoggles").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
|
||||
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', IC2Items.getItem("reBattery"), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
|
||||
/** OreDict Crafting Recipes **/
|
||||
for (int i = 0; i < OreDictionary.getOres("logWood").size(); i++) {
|
||||
cardboard = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 11), "XXX", "YYY", "XXX", 'X', new ItemStack(Items.paper), 'Y', OreDictionary.getOres("logWood").get(i));
|
||||
}
|
||||
for (int i = 0; i < OreDictionary.getOres("itemRubber").size(); i++) {
|
||||
rubberBall = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 10), "XX", "XX", 'X', OreDictionary.getOres("itemRubber").get(i));
|
||||
}
|
||||
|
||||
/** OreDict Crafting Recipes **/
|
||||
for (int i = 0; i < OreDictionary.getOres("logWood").size(); i++) {
|
||||
cardboard = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 11), "XXX", "YYY", "XXX", 'X', new ItemStack(Items.paper), 'Y', OreDictionary.getOres("logWood").get(i));
|
||||
}
|
||||
for (int i = 0; i < OreDictionary.getOres("itemRubber").size(); i++) {
|
||||
rubberBall = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 10), "XX", "XX", 'X', OreDictionary.getOres("itemRubber").get(i));
|
||||
}
|
||||
|
||||
/** Smelting Recipes **/
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 4), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 10), new ItemStack(ItemRegistry.itemEMTItems, 2, 8), 0.0F);
|
||||
}
|
||||
/** Smelting Recipes **/
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 4), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 10), new ItemStack(ItemRegistry.itemEMTItems, 2, 8), 0.0F);
|
||||
}
|
||||
|
||||
private static void registerShaplessRecipes() {
|
||||
|
||||
@@ -96,127 +90,159 @@ public class RecipeRegistry {
|
||||
|
||||
ItemStack iridium = IC2Items.getItem("iridiumOre").copy();
|
||||
iridium.stackSize = 2;
|
||||
uraniumToIridium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", iridium, 4, CraftingAspects.uuMatterInfusions, IC2Items.getItem("Uran238"), new ItemStack[]{uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell});
|
||||
uraniumToIridium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", iridium, 4, CraftingAspects.uuMatterInfusions, IC2Items.getItem("Uran238"), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack uranium = IC2Items.getItem("Uran238").copy();
|
||||
uranium.stackSize = 2;
|
||||
diamondToUranium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uranium, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(Items.diamond), new ItemStack[]{uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell});
|
||||
diamondToUranium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uranium, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(Items.diamond), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack diamond = new ItemStack(Items.diamond).copy();
|
||||
diamond.stackSize = 1;
|
||||
goldToDiamond = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", diamond, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Items.gold_ingot), new ItemStack[]{uuMCell, uuMCell, uuMCell, uuMCell});
|
||||
goldToDiamond = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", diamond, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Items.gold_ingot), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot).copy();
|
||||
gold.stackSize = 2;
|
||||
ironToGold = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", gold, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Items.iron_ingot), new ItemStack[]{uuMCell, uuMCell, uuMCell});
|
||||
ironToGold = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", gold, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Items.iron_ingot), new ItemStack[] { uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack ironOre = new ItemStack(Blocks.iron_ore).copy();
|
||||
ironOre.stackSize = 16;
|
||||
stoneBricksToIronOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", ironOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Blocks.stonebrick), new ItemStack[]{uuMCell, uuMCell});
|
||||
stoneBricksToIronOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", ironOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Blocks.stonebrick), new ItemStack[] { uuMCell, uuMCell });
|
||||
|
||||
/**
|
||||
* ItemStack copperOre = Items.getItem("copperOre").copy(); BUGGED IN 1.6 IF IC2 OREGEN IS DISABLED
|
||||
* ItemStack copperOre = Items.getItem("copperOre").copy(); BUGGED IN
|
||||
* 1.6 IF IC2 OREGEN IS DISABLED
|
||||
**/
|
||||
ItemStack copperOre = IC2Items.getItem("crushedCopperOre").copy();
|
||||
copperOre.stackSize = 32;
|
||||
arcaneStoneToCopperOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", copperOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack[]{uuMCell, uuMCell});
|
||||
arcaneStoneToCopperOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", copperOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack[] { uuMCell, uuMCell });
|
||||
|
||||
/**
|
||||
* ItemStack tinOre = Items.getItem("tinOre").copy(); BUGGED IN 1.6 IF IC2 OREGEN IS DISABLED
|
||||
* ItemStack tinOre = Items.getItem("tinOre").copy(); BUGGED IN 1.6 IF
|
||||
* IC2 OREGEN IS DISABLED
|
||||
**/
|
||||
ItemStack tinOre = IC2Items.getItem("crushedTinOre").copy();
|
||||
tinOre.stackSize = 32;
|
||||
arcaneStoneBricksToTinOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", tinOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 7), new ItemStack[]{uuMCell, uuMCell});
|
||||
arcaneStoneBricksToTinOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", tinOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 7), new ItemStack[] { uuMCell, uuMCell });
|
||||
|
||||
/**
|
||||
* ItemStack leadOre = Items.getItem("leadOre").copy(); BUGGED IN 1.6 IF IC2 OREGEN IS DISABLED
|
||||
* ItemStack leadOre = Items.getItem("leadOre").copy(); BUGGED IN 1.6 IF
|
||||
* IC2 OREGEN IS DISABLED
|
||||
**/
|
||||
ItemStack leadOre = IC2Items.getItem("crushedLeadOre").copy();
|
||||
leadOre.stackSize = 32;
|
||||
amberBlockToLeadOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", leadOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 0), new ItemStack[]{uuMCell, uuMCell});
|
||||
amberBlockToLeadOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", leadOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 0), new ItemStack[] { uuMCell, uuMCell });
|
||||
|
||||
ItemStack uraniumOre = IC2Items.getItem("uraniumOre").copy();
|
||||
uraniumOre.stackSize = 8;
|
||||
amberBricksToUraniumOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uraniumOre, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 1), new ItemStack[]{uuMCell, uuMCell, uuMCell});
|
||||
amberBricksToUraniumOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uraniumOre, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 1), new ItemStack[] { uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack coal = new ItemStack(Items.coal, 1, 0).copy();
|
||||
coal.stackSize = 16;
|
||||
charcoalToCoal = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", coal, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Items.coal, 1, 1), new ItemStack[]{uuMCell, uuMCell});
|
||||
charcoalToCoal = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", coal, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Items.coal, 1, 1), new ItemStack[] { uuMCell, uuMCell });
|
||||
|
||||
ItemStack stickyResin = IC2Items.getItem("resin").copy();
|
||||
stickyResin.stackSize = 21;
|
||||
shardToResin = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", stickyResin, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{uuMCell, uuMCell, uuMCell});
|
||||
shardToResin = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", stickyResin, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack redstone = new ItemStack(Items.redstone).copy();
|
||||
redstone.stackSize = 24;
|
||||
shardToRedstone = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", redstone, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{uuMCell, uuMCell, uuMCell});
|
||||
shardToRedstone = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", redstone, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack lapisLazuli = new ItemStack(Items.dye, 1, 4).copy();
|
||||
lapisLazuli.stackSize = 8;
|
||||
shardToLapis = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", lapisLazuli, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{uuMCell, uuMCell, uuMCell});
|
||||
shardToLapis = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", lapisLazuli, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack glowstone = new ItemStack(Blocks.glowstone).copy();
|
||||
glowstone.stackSize = 1;
|
||||
glowstoneDustToBlock = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", glowstone, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Items.glowstone_dust), new ItemStack[]{uuMCell});
|
||||
glowstoneDustToBlock = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", glowstone, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Items.glowstone_dust), new ItemStack[] { uuMCell });
|
||||
}
|
||||
|
||||
public static void registerLateRecipes() {
|
||||
/** Infusion Recipes **/
|
||||
thaumiumDrill = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Drill", RandomHelper.getChargedItem(ItemRegistry.thaumiumDrill, 10), 5, CraftingAspects.thaumiumDrillCrafting, new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron")});
|
||||
thaumiumDrill = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Drill", RandomHelper.getChargedItem(ItemRegistry.thaumiumDrill, 10), 5, CraftingAspects.thaumiumDrillCrafting, new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron") });
|
||||
|
||||
thaumiumChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Chainsaw", RandomHelper.getChargedItem(ItemRegistry.thaumiumChainsaw, 10), 5, CraftingAspects.thaumiumChainsawCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron")});
|
||||
thaumiumChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Chainsaw", RandomHelper.getChargedItem(ItemRegistry.thaumiumChainsaw, 10), 5, CraftingAspects.thaumiumChainsawCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron") });
|
||||
|
||||
thaumicQuantumHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Goggles of Revealing", RandomHelper.getChargedItem(ItemRegistry.quantumThaumicHelmet, 10), 6, CraftingAspects.thaumicQuantumHelmetCrafting, new ItemStack(ItemRegistry.nanoThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.milk_bucket), new ItemStack(IC2Items.getItem("quantumHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("advancedCircuit")});
|
||||
thaumicQuantumHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Goggles of Revealing", RandomHelper.getChargedItem(ItemRegistry.quantumThaumicHelmet, 10), 6, CraftingAspects.thaumicQuantumHelmetCrafting, new ItemStack(ItemRegistry.nanoThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.milk_bucket), new ItemStack(IC2Items.getItem("quantumHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("advancedCircuit") });
|
||||
|
||||
thaumicNanoHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Goggles of Revealing", RandomHelper.getChargedItem(ItemRegistry.nanoThaumicHelmet, 10), 5, CraftingAspects.thaumicNanoHelmetCrafting, new ItemStack(ItemRegistry.electricGoggles, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.gold_ingot), new ItemStack(IC2Items.getItem("nanoHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("electronicCircuit")});
|
||||
thaumicNanoHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Goggles of Revealing", RandomHelper.getChargedItem(ItemRegistry.nanoThaumicHelmet, 10), 5, CraftingAspects.thaumicNanoHelmetCrafting, new ItemStack(ItemRegistry.electricGoggles, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.gold_ingot), new ItemStack(IC2Items.getItem("nanoHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("electronicCircuit") });
|
||||
|
||||
thaumiumOmnitool = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", RandomHelper.getChargedItem(ItemRegistry.thaumiumOmnitool, 10), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("plateobsidian")});
|
||||
thaumiumOmnitool = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", RandomHelper.getChargedItem(ItemRegistry.thaumiumOmnitool, 10), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("plateobsidian") });
|
||||
|
||||
diamondOmnitoolToThaumium = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.diamondOmnitool, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Blocks.diamond_block), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("carbonPlate"), IC2Items.getItem("advancedCircuit")});
|
||||
diamondOmnitoolToThaumium = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.diamondOmnitool, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Blocks.diamond_block), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("carbonPlate"), IC2Items.getItem("advancedCircuit") });
|
||||
|
||||
explosionFocus = ThaumcraftApi.addInfusionCraftingRecipe("Explosion Focus", new ItemStack(ItemRegistry.explosionFocus), 6, CraftingAspects.laserFocusCrafting, new ItemStack(ConfigItems.itemFocusHellbat, 1), new ItemStack[]{new ItemStack(IC2Items.getItem("miningLaser").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.arrow), new ItemStack(Items.gunpowder), new ItemStack(Items.firework_charge), new ItemStack(ConfigItems.itemResource, 1, 1)});
|
||||
explosionFocus = ThaumcraftApi.addInfusionCraftingRecipe("Explosion Focus", new ItemStack(ItemRegistry.explosionFocus), 6, CraftingAspects.laserFocusCrafting, new ItemStack(ConfigItems.itemFocusHellbat, 1),
|
||||
new ItemStack[] { new ItemStack(IC2Items.getItem("miningLaser").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.arrow), new ItemStack(Items.gunpowder), new ItemStack(Items.firework_charge), new ItemStack(ConfigItems.itemResource, 1, 1) });
|
||||
|
||||
shieldFocus = ThaumcraftApi.addInfusionCraftingRecipe("Shield Focus", new ItemStack(ItemRegistry.shieldFocus), 4, CraftingAspects.shieldFocusCrafting, new ItemStack(ConfigItems.itemFocusPortableHole, 1), new ItemStack[]{IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian), new ItemStack(Blocks.obsidian)});
|
||||
shieldFocus = ThaumcraftApi.addInfusionCraftingRecipe("Shield Focus", new ItemStack(ItemRegistry.shieldFocus), 4, CraftingAspects.shieldFocusCrafting, new ItemStack(ConfigItems.itemFocusPortableHole, 1),
|
||||
new ItemStack[] { IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian), new ItemStack(Blocks.obsidian) });
|
||||
|
||||
potentiaGenerator = ThaumcraftApi.addInfusionCraftingRecipe("Potentia Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 0), 6, CraftingAspects.potentiaGeneratorCrafting, IC2Items.getItem("semifluidGenerator"), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(ConfigItems.itemFocusTrade), new ItemStack(Blocks.hopper), new ItemStack(ConfigBlocks.blockJar), IC2Items.getItem("mvTransformer"), IC2Items.getItem("advancedMachine"), IC2Items.getItem("orewashingplant"), IC2Items.getItem("scrap")});
|
||||
potentiaGenerator = ThaumcraftApi.addInfusionCraftingRecipe("Potentia Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 0), 6, CraftingAspects.potentiaGeneratorCrafting, IC2Items.getItem("semifluidGenerator"),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(ConfigItems.itemFocusTrade), new ItemStack(Blocks.hopper), new ItemStack(ConfigBlocks.blockJar), IC2Items.getItem("mvTransformer"), IC2Items.getItem("advancedMachine"), IC2Items.getItem("orewashingplant"), IC2Items.getItem("scrap") });
|
||||
|
||||
streamChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Chainsaw of the Stream", RandomHelper.getChargedItem(ItemRegistry.streamChainsaw, 10), 6, CraftingAspects.streamChaisnawCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.water_bucket), new ItemStack(ConfigItems.itemAxeElemental), new ItemStack(ConfigBlocks.blockMagicalLog), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade")});
|
||||
streamChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Chainsaw of the Stream", RandomHelper.getChargedItem(ItemRegistry.streamChainsaw, 10), 6, CraftingAspects.streamChaisnawCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.water_bucket), new ItemStack(ConfigItems.itemAxeElemental), new ItemStack(ConfigBlocks.blockMagicalLog), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade") });
|
||||
|
||||
rockbreakerDrill = ThaumcraftApi.addInfusionCraftingRecipe("Drill of the Rockbreaker", RandomHelper.getChargedItem(ItemRegistry.rockbreakerDrill, 10), 6, CraftingAspects.rockbreakerDrillCrafting, new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.flint_and_steel), new ItemStack(Items.fire_charge), new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemShovelElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade")});
|
||||
rockbreakerDrill = ThaumcraftApi.addInfusionCraftingRecipe("Drill of the Rockbreaker", RandomHelper.getChargedItem(ItemRegistry.rockbreakerDrill, 10), 6, CraftingAspects.rockbreakerDrillCrafting, new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.flint_and_steel), new ItemStack(Items.fire_charge),
|
||||
new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemShovelElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade") });
|
||||
|
||||
thorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Mjolnir", new ItemStack(ItemRegistry.thorHammer), 7, CraftingAspects.thorHammerCrafting, new ItemStack(ItemRegistry.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemFocusShock), IC2Items.getItem("rubber")});
|
||||
thorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Mjolnir", new ItemStack(ItemRegistry.thorHammer), 7, CraftingAspects.thorHammerCrafting, new ItemStack(ItemRegistry.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemFocusShock), IC2Items.getItem("rubber") });
|
||||
|
||||
superchargedThorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Supercharged Mjolnir", RandomHelper.getChargedItem(ItemRegistry.electricThorHammer, 10), 10, CraftingAspects.superchargedThorHammerCrafting, new ItemStack(ItemRegistry.thorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(Blocks.web), new ItemStack(ConfigItems.itemFocusHellbat), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("nanoSaber").getItem(), 1, OreDictionary.WILDCARD_VALUE)});
|
||||
superchargedThorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Supercharged Mjolnir", RandomHelper.getChargedItem(ItemRegistry.electricThorHammer, 10), 10, CraftingAspects.superchargedThorHammerCrafting, new ItemStack(ItemRegistry.thorHammer, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(Blocks.web), new ItemStack(ConfigItems.itemFocusHellbat), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"),
|
||||
IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("nanoSaber").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
wandRecharger = ThaumcraftApi.addInfusionCraftingRecipe("Industrial Wand Charging Station", new ItemStack(BlockRegistry.emtMachines, 1, 0), 6, CraftingAspects.wandCharger, new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), new ItemStack[]{IC2Items.getItem("replicator"), IC2Items.getItem("iridiumPlate"), new ItemStack(Blocks.diamond_block), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(ConfigBlocks.blockJar)});
|
||||
wandRecharger = ThaumcraftApi.addInfusionCraftingRecipe("Industrial Wand Charging Station", new ItemStack(BlockRegistry.emtMachines, 1, 0), 6, CraftingAspects.wandCharger, new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5),
|
||||
new ItemStack[] { IC2Items.getItem("replicator"), IC2Items.getItem("iridiumPlate"), new ItemStack(Blocks.diamond_block), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(ConfigBlocks.blockJar) });
|
||||
|
||||
solarHelmetRevealing = ThaumcraftApi.addInfusionCraftingRecipe("Solar Helmet of Revealing", RandomHelper.getChargedItem(ItemRegistry.solarHelmetRevealing, 10), 5, CraftingAspects.solarHelmetRevealing, new ItemStack(ItemRegistry.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(BlockRegistry.emtSolars, 1, 1), IC2Items.getItem("glassFiberCableItem"), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, 4)});
|
||||
solarHelmetRevealing = ThaumcraftApi.addInfusionCraftingRecipe("Solar Helmet of Revealing", RandomHelper.getChargedItem(ItemRegistry.solarHelmetRevealing, 10), 5, CraftingAspects.solarHelmetRevealing, new ItemStack(ItemRegistry.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(BlockRegistry.emtSolars, 1, 1), IC2Items.getItem("glassFiberCableItem"), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, 4) });
|
||||
|
||||
electricBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Electric Boots of the Traveller", RandomHelper.getChargedItem(ItemRegistry.electricBootsTraveller, 10), 2, CraftingAspects.electricBootsTravel, new ItemStack(ConfigItems.itemBootsTraveller), new ItemStack[]{new ItemStack(Items.diamond), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), IC2Items.getItem("hazmatBoots"), new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE)});
|
||||
electricBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Electric Boots of the Traveller", RandomHelper.getChargedItem(ItemRegistry.electricBootsTraveller, 10), 2, CraftingAspects.electricBootsTravel, new ItemStack(ConfigItems.itemBootsTraveller),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), IC2Items.getItem("hazmatBoots"), new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
nanoBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Nano Boots of the Traveller", RandomHelper.getChargedItem(ItemRegistry.nanoBootsTraveller, 10), 2, CraftingAspects.nanoBootsTravel, new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(IC2Items.getItem("nanoBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE)});
|
||||
nanoBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Nano Boots of the Traveller", RandomHelper.getChargedItem(ItemRegistry.nanoBootsTraveller, 10), 2, CraftingAspects.nanoBootsTravel, new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(IC2Items.getItem("nanoBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
quantumBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Boots of the Traveller", RandomHelper.getChargedItem(ItemRegistry.quantumBootsTraveller, 10), 2, CraftingAspects.quantumBootsTravel, new ItemStack(ItemRegistry.nanoBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Blocks.diamond_block), new ItemStack(IC2Items.getItem("quantumBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate")});
|
||||
quantumBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Boots of the Traveller", RandomHelper.getChargedItem(ItemRegistry.quantumBootsTraveller, 10), 2, CraftingAspects.quantumBootsTravel, new ItemStack(ItemRegistry.nanoBootsTraveller, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Blocks.diamond_block), new ItemStack(IC2Items.getItem("quantumBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate") });
|
||||
|
||||
etheralProcessor = ThaumcraftApi.addInfusionCraftingRecipe("Etheral Processor", new ItemStack(BlockRegistry.emtMachines, 1, 1), 3, CraftingAspects.etherealProcessor, IC2Items.getItem("macerator"), new ItemStack[]{IC2Items.getItem("electroFurnace"), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5)});
|
||||
etheralProcessor = ThaumcraftApi.addInfusionCraftingRecipe("Etheral Processor", new ItemStack(BlockRegistry.emtMachines, 1, 1), 3, CraftingAspects.etherealProcessor, IC2Items.getItem("macerator"),
|
||||
new ItemStack[] { IC2Items.getItem("electroFurnace"), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5) });
|
||||
|
||||
tripleCompressedSolar = ThaumcraftApi.addInfusionCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 2), 2, CraftingAspects.compressedSolars, new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack[]{new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1)});
|
||||
tripleCompressedSolar = ThaumcraftApi.addInfusionCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 2), 2, CraftingAspects.compressedSolars, new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack[] { new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1),
|
||||
new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1) });
|
||||
|
||||
electricHoeGrowth = ThaumcraftApi.addInfusionCraftingRecipe("Electric Hoe of Growth", RandomHelper.getChargedItem(ItemRegistry.electricHoeGrowth, 10), 4, CraftingAspects.electricHoeGrowth, new ItemStack(ConfigItems.itemHoeElemental), new ItemStack[]{new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("electricHoe").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.dye, 1, 15), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE)});
|
||||
electricHoeGrowth = ThaumcraftApi.addInfusionCraftingRecipe("Electric Hoe of Growth", RandomHelper.getChargedItem(ItemRegistry.electricHoeGrowth, 10), 4, CraftingAspects.electricHoeGrowth, new ItemStack(ConfigItems.itemHoeElemental),
|
||||
new ItemStack[] { new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("electricHoe").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.dye, 1, 15), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
chargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Charging", new ItemStack(ItemRegistry.chargeFocus), 4, CraftingAspects.chargeFocus, new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{IC2Items.getItem("generator"), IC2Items.getItem("batBox"), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE)});
|
||||
chargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Charging", new ItemStack(ItemRegistry.chargeFocus), 4, CraftingAspects.chargeFocus, new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { IC2Items.getItem("generator"), IC2Items.getItem("batBox"), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
wandChargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(ItemRegistry.wandChargeFocus), 5, CraftingAspects.wandChargeFocus, new ItemStack(BlockRegistry.emtMachines, 1, 0), new ItemStack[]{new ItemStack(ItemRegistry.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate")});
|
||||
wandChargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(ItemRegistry.wandChargeFocus), 5, CraftingAspects.wandChargeFocus, new ItemStack(BlockRegistry.emtMachines, 1, 0),
|
||||
new ItemStack[] { new ItemStack(ItemRegistry.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate") });
|
||||
|
||||
inventoryChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 1), 6, CraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[]{new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("waterMill"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor")});
|
||||
inventoryChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 1), 6, CraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1),
|
||||
new ItemStack[] { new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor") });
|
||||
|
||||
armorChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Armor Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 0), 6, CraftingAspects.armorChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[]{new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("waterMill"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor")});
|
||||
armorChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Armor Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 0), 6, CraftingAspects.armorChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1),
|
||||
new ItemStack[] { new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor") });
|
||||
|
||||
nanoWings = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Wings", RandomHelper.getChargedItem(ItemRegistry.nanoWing, 10), 4, CraftingAspects.nanoWing, new ItemStack(ItemRegistry.thaumiumWing), new ItemStack[]{IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), new ItemStack(IC2Items.getItem("nanoBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1)});
|
||||
nanoWings = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Wings", RandomHelper.getChargedItem(ItemRegistry.nanoWing, 10), 4, CraftingAspects.nanoWing, new ItemStack(ItemRegistry.thaumiumWing),
|
||||
new ItemStack[] { IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), new ItemStack(IC2Items.getItem("nanoBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1) });
|
||||
|
||||
quantumWings = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Wings", RandomHelper.getChargedItem(ItemRegistry.quantumWing, 10), 6, CraftingAspects.quantumWing, new ItemStack(ItemRegistry.nanoWing, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1)});
|
||||
|
||||
infusedQuantumArmor = ThaumcraftApi.addInfusionCraftingRecipe("Infused Quantum Armor", RandomHelper.getChargedItem(ItemRegistry.quantumArmor, 10), 5, CraftingAspects.quantumWing, new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(BlockRegistry.shield), new ItemStack(BlockRegistry.shield)});
|
||||
quantumWings = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Wings", RandomHelper.getChargedItem(ItemRegistry.quantumWing, 10), 6, CraftingAspects.quantumWing, new ItemStack(ItemRegistry.nanoWing, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1) });
|
||||
|
||||
infusedQuantumArmor = ThaumcraftApi.addInfusionCraftingRecipe("Infused Quantum Armor", RandomHelper.getChargedItem(ItemRegistry.quantumArmor, 10), 5, CraftingAspects.quantumWing, new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(BlockRegistry.shield), new ItemStack(BlockRegistry.shield) });
|
||||
|
||||
/** Arcane Worktable Recipes **/
|
||||
|
||||
@@ -226,9 +252,11 @@ public class RecipeRegistry {
|
||||
|
||||
christmasFocus = ThaumcraftApi.addArcaneCraftingRecipe("Kris-tmas Focus", new ItemStack(ItemRegistry.christmasFocus), CraftingAspects.christmasFocusCrafting, "XYX", "YZY", "XYX", 'X', new ItemStack(Blocks.snow), 'Y', new ItemStack(Blocks.pumpkin), 'Z', new ItemStack(ConfigItems.itemFocusFrost));
|
||||
|
||||
electricGoggles = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", RandomHelper.getChargedItem(ItemRegistry.electricGoggles, 10), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A', new ItemStack(IC2Items.getItem("reBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE),'B', Items.repeater);
|
||||
|
||||
electricGoggles2 = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", RandomHelper.getChargedItem(ItemRegistry.electricGoggles, 10), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
|
||||
electricGoggles = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", RandomHelper.getChargedItem(ItemRegistry.electricGoggles, 10), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A',
|
||||
new ItemStack(IC2Items.getItem("reBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
|
||||
|
||||
electricGoggles2 = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", RandomHelper.getChargedItem(ItemRegistry.electricGoggles, 10), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A',
|
||||
new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
|
||||
|
||||
shieldBlock = ThaumcraftApi.addArcaneCraftingRecipe("Shield Block", new ItemStack(BlockRegistry.shield, 6), CraftingAspects.shieldBlockCrafting, "XYX", "X X", "XYX", 'X', new ItemStack(Blocks.glass), 'Y', new ItemStack(Blocks.obsidian));
|
||||
|
||||
@@ -238,10 +266,11 @@ public class RecipeRegistry {
|
||||
|
||||
doubleCompressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', new ItemStack(BlockRegistry.emtSolars, 1, 0));
|
||||
|
||||
electricScribingTools = ThaumcraftApi.addArcaneCraftingRecipe("Electric Scribing Tools", RandomHelper.getChargedItem(ItemRegistry.electricScribingTools, 10), CraftingAspects.electricScribingTools, "YXY", "XZX", "YXY", 'Y', IC2Items.getItem("electronicCircuit"), 'X', new ItemStack(ConfigItems.itemInkwell), 'Z', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
electricScribingTools = ThaumcraftApi.addArcaneCraftingRecipe("Electric Scribing Tools", RandomHelper.getChargedItem(ItemRegistry.electricScribingTools, 10), CraftingAspects.electricScribingTools, "YXY", "XZX", "YXY", 'Y', IC2Items.getItem("electronicCircuit"), 'X', new ItemStack(ConfigItems.itemInkwell), 'Z',
|
||||
new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
thaumiumWing = ThaumcraftApi.addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(ItemRegistry.itemEMTItems, 1, 14), CraftingAspects.thaumiumWing, "XYZ", "XYZ", "XYZ", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 13), 'Y', new ItemStack(ItemRegistry.itemEMTItems, 1, 5), 'Z', IC2Items.getItem("plateiron"));
|
||||
|
||||
|
||||
thaumiumWings = ThaumcraftApi.addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(ItemRegistry.thaumiumWing), CraftingAspects.thaumiumWing, "XX", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 14));
|
||||
|
||||
/** Crucible Recipes **/
|
||||
@@ -291,14 +320,14 @@ public class RecipeRegistry {
|
||||
tripleEarthSolar = ThaumcraftApi.addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars2, 1, 4), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.earthSolars);
|
||||
|
||||
ItemStack itemStack = new ItemStack(ConfigItems.itemJarNode);
|
||||
((ItemJarNode)itemStack.getItem()).setAspects(itemStack, new AspectList());
|
||||
((ItemJarNode) itemStack.getItem()).setAspects(itemStack, new AspectList());
|
||||
portableNode = ThaumcraftApi.addCrucibleRecipe("Portable Node", new ItemStack(BlockRegistry.portableNode), itemStack, CraftingAspects.portableNode);
|
||||
|
||||
|
||||
uuMCrystal = ThaumcraftApi.addCrucibleRecipe("UU-Matter Infusion", new ItemStack(ItemRegistry.itemEMTItems, 1, 15), Ic2Items.uuMatterCell.copy(), CraftingAspects.uuMatterCrystal);
|
||||
|
||||
/** IC2 Stuff related recipes **/
|
||||
|
||||
/* Ore Clusters Macerator Recipes */
|
||||
/* Ore Clusters Macerator Recipes */
|
||||
ItemStack ironClusterRecipe = IC2Items.getItem("smallIronDust").copy();
|
||||
ironClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)), null, ironClusterRecipe);
|
||||
@@ -327,12 +356,9 @@ public class RecipeRegistry {
|
||||
thaumiumPlate = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 5), "X", "Y", "Z", 'Y', new ItemStack(ConfigItems.itemResource, 1, 2), 'X', new ItemStack(IC2Items.getItem("ForgeHammer").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(Blocks.obsidian));
|
||||
Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)), null, new ItemStack(ItemRegistry.itemEMTItems, 1, 5));
|
||||
|
||||
///* Iron Sheet Recipe */
|
||||
//Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(IC2Items.getItem("denseplateiron")), null, new ItemStack(ItemRegistry.itemEMTItems, 1, 13));
|
||||
|
||||
/* Ore Processing for Amber and Cinnabar */
|
||||
if (ConfigHandler.removeAmberAndCinnabarMacerating) {
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext(); ) {
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7))) {
|
||||
it.remove();
|
||||
@@ -340,7 +366,7 @@ public class RecipeRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext(); ) {
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0))) {
|
||||
it.remove();
|
||||
@@ -364,26 +390,26 @@ public class RecipeRegistry {
|
||||
ItemStack smallTinDust = IC2Items.getItem("smallTinDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 1)), waterAmount, new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 2), smallCopperDust, IC2Items.getItem("stoneDust")});
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 3)), waterAmount, new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 4), smallTinDust, IC2Items.getItem("stoneDust")});
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 1)), waterAmount, new ItemStack[] { new ItemStack(ItemRegistry.itemEMTItems, 1, 2), smallCopperDust, IC2Items.getItem("stoneDust") });
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 3)), waterAmount, new ItemStack[] { new ItemStack(ItemRegistry.itemEMTItems, 1, 4), smallTinDust, IC2Items.getItem("stoneDust") });
|
||||
|
||||
NBTTagCompound heatAmount = new NBTTagCompound();
|
||||
heatAmount.setInteger("minHeat", 1000);
|
||||
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 2)), heatAmount, new ItemStack[]{IC2Items.getItem("smallCopperDust"), new ItemStack(ConfigItems.itemResource, 1, 6)});
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 4)), heatAmount, new ItemStack[]{IC2Items.getItem("smallTinDust"), new ItemStack(ConfigItems.itemResource, 1, 3)});
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 2)), heatAmount, new ItemStack[] { IC2Items.getItem("smallCopperDust"), new ItemStack(ConfigItems.itemResource, 1, 6) });
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 4)), heatAmount, new ItemStack[] { IC2Items.getItem("smallTinDust"), new ItemStack(ConfigItems.itemResource, 1, 3) });
|
||||
|
||||
}
|
||||
|
||||
public static IRecipe ironOmnitool;
|
||||
public static IRecipe diamondChainsaw;
|
||||
public static IRecipe ductTape;
|
||||
public static IRecipe rubberBall;
|
||||
public static IRecipe featherMesh;
|
||||
public static IRecipe cardboard;
|
||||
public static IRecipe featherWing;
|
||||
public static IRecipe featherWings;
|
||||
public static IRecipe taintedFeathers;
|
||||
public static IRecipe ironOmnitool;
|
||||
public static IRecipe diamondChainsaw;
|
||||
public static IRecipe ductTape;
|
||||
public static IRecipe rubberBall;
|
||||
public static IRecipe featherMesh;
|
||||
public static IRecipe cardboard;
|
||||
public static IRecipe featherWing;
|
||||
public static IRecipe featherWings;
|
||||
public static IRecipe taintedFeathers;
|
||||
|
||||
public static InfusionRecipe uraniumToIridium;
|
||||
public static InfusionRecipe diamondToUranium;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package tombenpotter.emt.common.init;
|
||||
|
||||
public class Registry{
|
||||
public static void register(){
|
||||
public class Registry {
|
||||
public static void register() {
|
||||
BlockRegistry.registerBlocks();
|
||||
ItemRegistry.registerItems();
|
||||
TileRegistry.registerTiles();
|
||||
RecipeRegistry.registerEarlyRecipes();
|
||||
}
|
||||
|
||||
public static void registerLate(){
|
||||
|
||||
public static void registerLate() {
|
||||
BlockRegistry.addAspects();
|
||||
RecipeRegistry.registerLateRecipes();
|
||||
RecipeRegistry.registerUUMInfusionRecipes();
|
||||
RecipeRegistry.registerLateRecipes();
|
||||
RecipeRegistry.registerUUMInfusionRecipes();
|
||||
}
|
||||
}
|
||||
@@ -33,35 +33,35 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class TileRegistry {
|
||||
|
||||
public static void registerTiles() {
|
||||
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
|
||||
GameRegistry.registerTileEntity(TileEntityPotentiaGenerator.class, "tileentitypotentiagenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityIgnisGenerator.class, "tileentityignisgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
||||
GameRegistry.registerTileEntity(TileEntityCompressedSolar.class, "tileentitycompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||
GameRegistry.registerTileEntity(TileEntityWaterSolar.class, "tileentitywatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDarkSolar.class, "tileentitydarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntityOrderSolar.class, "tileentityordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityFireSolar.class, "tileentityfiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntityAirSolar.class, "tileentityairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
|
||||
}
|
||||
public static void registerTiles() {
|
||||
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
|
||||
GameRegistry.registerTileEntity(TileEntityPotentiaGenerator.class, "tileentitypotentiagenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityIgnisGenerator.class, "tileentityignisgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
||||
GameRegistry.registerTileEntity(TileEntityCompressedSolar.class, "tileentitycompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||
GameRegistry.registerTileEntity(TileEntityWaterSolar.class, "tileentitywatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDarkSolar.class, "tileentitydarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
|
||||
GameRegistry.registerTileEntity(TileEntityOrderSolar.class, "tileentityordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityFireSolar.class, "tileentityfiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
|
||||
GameRegistry.registerTileEntity(TileEntityAirSolar.class, "tileentityairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,29 @@
|
||||
package tombenpotter.emt.common.items;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tombenpotter.emt.ElectroMagicTools;
|
||||
import tombenpotter.emt.ModInformation;
|
||||
import tombenpotter.emt.common.util.TextHelper;
|
||||
|
||||
public class ItemBase extends Item {
|
||||
|
||||
public ItemBase(String unlocName, String textureName) {
|
||||
super();
|
||||
setUnlocalizedName(ModInformation.modid + ".item." + unlocName);
|
||||
setTextureName(ModInformation.texturePath + ":" + textureName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
}
|
||||
public ItemBase(String unlocName, String textureName) {
|
||||
super();
|
||||
setUnlocalizedName(ModInformation.modid + unlocName);
|
||||
setTextureName(ModInformation.texturePath + ":" + textureName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
}
|
||||
|
||||
public ItemBase(String unlocName) {
|
||||
super();
|
||||
setUnlocalizedName(ModInformation.modid + ".item." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
public ItemBase(String unlocName) {
|
||||
super();
|
||||
setUnlocalizedName(ModInformation.modid + ".item." + unlocName);
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
return (TextHelper.GREEN + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
}
|
||||
}
|
||||
@@ -1,227 +0,0 @@
|
||||
package tombenpotter.emt.common.items;
|
||||
|
||||
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 tombenpotter.emt.ModInformation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCraftingComponents extends ItemBase {
|
||||
|
||||
public IIcon[] icon = new IIcon[100];
|
||||
public final String drillTop = "drillTop";
|
||||
public final String chainsawTop = "chainsawTop";
|
||||
public final String omnitoolTop = "omnitoolTop";
|
||||
public final String shard = "shard";
|
||||
|
||||
public ItemCraftingComponents(String unlocName) {
|
||||
super(unlocName);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
case 0: {
|
||||
name = drillTop + ".wood";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = drillTop + ".stone";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = drillTop + ".iron";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = drillTop + ".gold";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = drillTop + ".diamond";
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
name = drillTop + ".copper";
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
name = drillTop + ".tin";
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
name = drillTop + ".lead";
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
name = drillTop + ".bronze";
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
name = chainsawTop + ".wood";
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
name = chainsawTop + ".stone";
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
name = chainsawTop + ".iron";
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
name = chainsawTop + ".gold";
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
name = chainsawTop + ".diamond";
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
name = chainsawTop + ".copper";
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
name = chainsawTop + ".tin";
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
name = chainsawTop + ".lead";
|
||||
break;
|
||||
}
|
||||
case 17: {
|
||||
name = chainsawTop + ".bronze";
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
name = omnitoolTop + ".iron";
|
||||
break;
|
||||
}
|
||||
case 19: {
|
||||
name = omnitoolTop + ".gold";
|
||||
break;
|
||||
}
|
||||
case 20: {
|
||||
name = omnitoolTop + ".diamond";
|
||||
break;
|
||||
}
|
||||
case 21: {
|
||||
name = omnitoolTop + ".copper";
|
||||
break;
|
||||
}
|
||||
case 22: {
|
||||
name = omnitoolTop + ".tin";
|
||||
break;
|
||||
}
|
||||
case 23: {
|
||||
name = omnitoolTop + ".lead";
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
name = omnitoolTop + ".bronze";
|
||||
break;
|
||||
}
|
||||
case 25: {
|
||||
name = shard + ".wood";
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
name = shard + ".stone";
|
||||
break;
|
||||
}
|
||||
case 27: {
|
||||
name = shard + ".iron";
|
||||
break;
|
||||
}
|
||||
case 28: {
|
||||
name = shard + ".gold";
|
||||
break;
|
||||
}
|
||||
case 29: {
|
||||
name = shard + ".obsidian";
|
||||
break;
|
||||
}
|
||||
case 30: {
|
||||
name = shard + ".copper";
|
||||
break;
|
||||
}
|
||||
case 31: {
|
||||
name = shard + ".tin";
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
name = shard + ".lead";
|
||||
break;
|
||||
}
|
||||
case 33: {
|
||||
name = shard + ".bronze";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "wood");
|
||||
this.icon[1] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "stone");
|
||||
this.icon[2] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "iron");
|
||||
this.icon[3] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "gold");
|
||||
this.icon[4] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "diamond");
|
||||
this.icon[5] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "copper");
|
||||
this.icon[6] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "tin");
|
||||
this.icon[7] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "lead");
|
||||
this.icon[8] = ri.registerIcon(ModInformation.texturePath + ":materials/" + drillTop + "_" + "bronze");
|
||||
|
||||
this.icon[9] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "wood");
|
||||
this.icon[10] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "stone");
|
||||
this.icon[11] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "iron");
|
||||
this.icon[12] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "gold");
|
||||
this.icon[13] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "diamond");
|
||||
this.icon[14] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "copper");
|
||||
this.icon[15] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "tin");
|
||||
this.icon[16] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "lead");
|
||||
this.icon[17] = ri.registerIcon(ModInformation.texturePath + ":materials/" + chainsawTop + "_" + "bronze");
|
||||
|
||||
this.icon[18] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "iron");
|
||||
this.icon[19] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "gold");
|
||||
this.icon[20] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "diamond");
|
||||
this.icon[21] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "copper");
|
||||
this.icon[22] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "tin");
|
||||
this.icon[23] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "lead");
|
||||
this.icon[24] = ri.registerIcon(ModInformation.texturePath + ":materials/" + omnitoolTop + "_" + "bronze");
|
||||
|
||||
this.icon[25] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "wood");
|
||||
this.icon[26] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "stone");
|
||||
this.icon[27] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "iron");
|
||||
this.icon[28] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "gold");
|
||||
this.icon[29] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "diamond");
|
||||
this.icon[30] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "copper");
|
||||
this.icon[31] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "tin");
|
||||
this.icon[32] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "lead");
|
||||
this.icon[33] = ri.registerIcon(ModInformation.texturePath + ":materials/" + shard + "_" + "bronze");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return this.icon[meta];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
for (int i = 0; i <= 33; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,59 +15,54 @@ import java.util.List;
|
||||
|
||||
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
|
||||
|
||||
public static int maxCharge = 400;
|
||||
public static int maxCharge = 400;
|
||||
|
||||
public ItemElectricScribingTools() {
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
public ItemElectricScribingTools() {
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -38,21 +38,21 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "euMaker.armor";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "euMaker.inventory";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
case 0: {
|
||||
name = "euMaker.armor";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "euMaker.inventory";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":armoreumaker");
|
||||
@@ -64,7 +64,6 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
|
||||
return this.icon[meta];
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
@@ -75,7 +74,8 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
|
||||
public BaubleType getBaubleType(ItemStack stack) {
|
||||
if (stack.getItemDamage() <= 1) {
|
||||
return BaubleType.RING;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,162 +27,161 @@ import java.util.List;
|
||||
|
||||
public class ItemMaterials extends Item {
|
||||
|
||||
public IIcon[] icon = new IIcon[25];
|
||||
public IIcon[] icon = new IIcon[25];
|
||||
|
||||
public ItemMaterials() {
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
setHasSubtypes(true);
|
||||
OreDictionary.registerOre("plateThaumium", new ItemStack(this, 1, 5));
|
||||
OreDictionary.registerOre("slimeball", new ItemStack(this, 1, 8));
|
||||
}
|
||||
public ItemMaterials() {
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = null;
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0:
|
||||
name = "oreClusterUranium";
|
||||
break;
|
||||
case 1:
|
||||
name = "crushedOreAmber";
|
||||
break;
|
||||
case 2:
|
||||
name = "purifiedOreAmber";
|
||||
break;
|
||||
case 3:
|
||||
name = "crushedOreCinnabar";
|
||||
break;
|
||||
case 4:
|
||||
name = "purifiedOreCinnabar";
|
||||
break;
|
||||
case 5:
|
||||
name = "thaumiumPlate";
|
||||
break;
|
||||
case 6:
|
||||
name = "lightningSummoner";
|
||||
break;
|
||||
case 7:
|
||||
name = "featherMesh";
|
||||
break;
|
||||
case 8:
|
||||
name = "glue";
|
||||
break;
|
||||
case 9:
|
||||
name = "ductTape";
|
||||
break;
|
||||
case 10:
|
||||
name = "rubberBall";
|
||||
break;
|
||||
case 11:
|
||||
name = "cardboard";
|
||||
break;
|
||||
case 12:
|
||||
name = "featherGluedCardboardWing";
|
||||
break;
|
||||
case 13:
|
||||
name = "taintedFeather";
|
||||
break;
|
||||
case 14:
|
||||
name = "thaumiumWing";
|
||||
break;
|
||||
case 15:
|
||||
name = "uumatterDrop";
|
||||
break;
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = null;
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0:
|
||||
name = "oreClusterUranium";
|
||||
break;
|
||||
case 1:
|
||||
name = "crushedOreAmber";
|
||||
break;
|
||||
case 2:
|
||||
name = "purifiedOreAmber";
|
||||
break;
|
||||
case 3:
|
||||
name = "crushedOreCinnabar";
|
||||
break;
|
||||
case 4:
|
||||
name = "purifiedOreCinnabar";
|
||||
break;
|
||||
case 5:
|
||||
name = "thaumiumPlate";
|
||||
break;
|
||||
case 6:
|
||||
name = "lightningSummoner";
|
||||
break;
|
||||
case 7:
|
||||
name = "featherMesh";
|
||||
break;
|
||||
case 8:
|
||||
name = "glue";
|
||||
break;
|
||||
case 9:
|
||||
name = "ductTape";
|
||||
break;
|
||||
case 10:
|
||||
name = "rubberBall";
|
||||
break;
|
||||
case 11:
|
||||
name = "cardboard";
|
||||
break;
|
||||
case 12:
|
||||
name = "featherGluedCardboardWing";
|
||||
break;
|
||||
case 13:
|
||||
name = "taintedFeather";
|
||||
break;
|
||||
case 14:
|
||||
name = "thaumiumWing";
|
||||
break;
|
||||
case 15:
|
||||
name = "uumatterDrop";
|
||||
break;
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return "item." + ModInformation.modid + "." + name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":materials/clusteruranium");
|
||||
this.icon[1] = ri.registerIcon(ModInformation.texturePath + ":materials/crushedamber");
|
||||
this.icon[2] = ri.registerIcon(ModInformation.texturePath + ":materials/purifiedamber");
|
||||
this.icon[3] = ri.registerIcon(ModInformation.texturePath + ":materials/crushedcinnabar");
|
||||
this.icon[4] = ri.registerIcon(ModInformation.texturePath + ":materials/purifiedcinnabar");
|
||||
this.icon[5] = ri.registerIcon(ModInformation.texturePath + ":materials/thaumiumplate");
|
||||
this.icon[6] = ri.registerIcon(ModInformation.texturePath + ":materials/lightningsummoner");
|
||||
this.icon[7] = ri.registerIcon(ModInformation.texturePath + ":materials/feathermesh");
|
||||
this.icon[8] = ri.registerIcon(ModInformation.texturePath + ":materials/glue");
|
||||
this.icon[9] = ri.registerIcon(ModInformation.texturePath + ":materials/ducttape");
|
||||
this.icon[10] = ri.registerIcon(ModInformation.texturePath + ":materials/rubberball");
|
||||
this.icon[11] = ri.registerIcon(ModInformation.texturePath + ":materials/cardboard");
|
||||
this.icon[12] = ri.registerIcon(ModInformation.texturePath + ":materials/cardboardsheet");
|
||||
this.icon[13] = ri.registerIcon(ModInformation.texturePath + ":materials/taintedfeather");
|
||||
this.icon[14] = ri.registerIcon(ModInformation.texturePath + ":materials/thaumiumWing");
|
||||
this.icon[15] = ri.registerIcon(ModInformation.texturePath + ":materials/uumatterdrop");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":materials/clusteruranium");
|
||||
this.icon[1] = ri.registerIcon(ModInformation.texturePath + ":materials/crushedamber");
|
||||
this.icon[2] = ri.registerIcon(ModInformation.texturePath + ":materials/purifiedamber");
|
||||
this.icon[3] = ri.registerIcon(ModInformation.texturePath + ":materials/crushedcinnabar");
|
||||
this.icon[4] = ri.registerIcon(ModInformation.texturePath + ":materials/purifiedcinnabar");
|
||||
this.icon[5] = ri.registerIcon(ModInformation.texturePath + ":materials/thaumiumplate");
|
||||
this.icon[6] = ri.registerIcon(ModInformation.texturePath + ":materials/lightningsummoner");
|
||||
this.icon[7] = ri.registerIcon(ModInformation.texturePath + ":materials/feathermesh");
|
||||
this.icon[8] = ri.registerIcon(ModInformation.texturePath + ":materials/glue");
|
||||
this.icon[9] = ri.registerIcon(ModInformation.texturePath + ":materials/ducttape");
|
||||
this.icon[10] = ri.registerIcon(ModInformation.texturePath + ":materials/rubberball");
|
||||
this.icon[11] = ri.registerIcon(ModInformation.texturePath + ":materials/cardboard");
|
||||
this.icon[12] = ri.registerIcon(ModInformation.texturePath + ":materials/cardboardsheet");
|
||||
this.icon[13] = ri.registerIcon(ModInformation.texturePath + ":materials/taintedfeather");
|
||||
this.icon[14] = ri.registerIcon(ModInformation.texturePath + ":materials/thaumiumWing");
|
||||
this.icon[15] = ri.registerIcon(ModInformation.texturePath + ":materials/uumatterdrop");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return this.icon[meta];
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return this.icon[meta];
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
for (int i = 1; i <= 15; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
for (int i = 1; i <= 15; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack != null && stack.getItemDamage() == 6) {
|
||||
player.swingItem();
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||
double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||
double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
float f9 = f3 * f5;
|
||||
double d3 = 5000D;
|
||||
Vec3 vec3d1 = playerLoc.addVector(f7 * d3, f8 * d3, f9 * d3);
|
||||
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(playerLoc, vec3d1, true);
|
||||
if (movingobjectposition == null) {
|
||||
return stack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
|
||||
} else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
|
||||
Entity entityhit = movingobjectposition.entityHit;
|
||||
double x = entityhit.posX;
|
||||
double y = entityhit.posY;
|
||||
double z = entityhit.posZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
|
||||
}
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return stack;
|
||||
} else {
|
||||
player.inventory.consumeInventoryItem(this);
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack != null && stack.getItemDamage() == 6) {
|
||||
player.swingItem();
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||
double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||
double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
float f9 = f3 * f5;
|
||||
double d3 = 5000D;
|
||||
Vec3 vec3d1 = playerLoc.addVector(f7 * d3, f8 * d3, f9 * d3);
|
||||
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(playerLoc, vec3d1, true);
|
||||
if (movingobjectposition == null) {
|
||||
return stack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
|
||||
}
|
||||
else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
|
||||
Entity entityhit = movingobjectposition.entityHit;
|
||||
double x = entityhit.posX;
|
||||
double y = entityhit.posY;
|
||||
double z = entityhit.posZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
|
||||
}
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return stack;
|
||||
}
|
||||
else {
|
||||
player.inventory.consumeInventoryItem(this);
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||
super.onUpdate(stack, world, entity, par4, par5);
|
||||
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13)) && ((entity instanceof EntityLivingBase)) && (!((EntityLivingBase) entity).isEntityUndead()) && (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID)) && (world.rand.nextInt(4321) <= stack.stackSize)) {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false));
|
||||
if ((entity instanceof EntityPlayer)) {
|
||||
InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
}
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
|
||||
super.onUpdate(stack, world, entity, par4, par5);
|
||||
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13)) && ((entity instanceof EntityLivingBase)) && (!((EntityLivingBase) entity).isEntityUndead()) && (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID)) && (world.rand.nextInt(4321) <= stack.stackSize)) {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false));
|
||||
if ((entity instanceof EntityPlayer)) {
|
||||
InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,15 +41,15 @@ public class ItemOneRing extends ItemBase implements IBauble {
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "oneRing";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
case 0: {
|
||||
name = "oneRing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return "item." + ModInformation.modid + ".bauble." + name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -62,7 +62,7 @@ public class ItemOneRing extends ItemBase implements IBauble {
|
||||
return this.icon[meta];
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
@@ -72,7 +72,8 @@ public class ItemOneRing extends ItemBase implements IBauble {
|
||||
public BaubleType getBaubleType(ItemStack stack) {
|
||||
if (stack.getItemDamage() <= 0) {
|
||||
return BaubleType.RING;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+162
-159
@@ -32,190 +32,193 @@ import java.util.List;
|
||||
|
||||
public class ItemElectricBootsTraveller extends ItemArmor implements IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
|
||||
|
||||
public int maxCharge = 100000;
|
||||
public int energyPerDamage = 100;
|
||||
public int visDiscount = 2;
|
||||
public float speedBonus = 0.055F;
|
||||
public float jumpBonus = 0.3F;
|
||||
public double transferLimit = 100;
|
||||
public int maxCharge = 100000;
|
||||
public int energyPerDamage = 100;
|
||||
public int visDiscount = 2;
|
||||
public float speedBonus = 0.055F;
|
||||
public float jumpBonus = 0.3F;
|
||||
public double transferLimit = 100;
|
||||
|
||||
public ItemElectricBootsTraveller(int par3, int par4) {
|
||||
super(ArmorMaterial.DIAMOND, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
public ItemElectricBootsTraveller(int par3, int par4) {
|
||||
super(ArmorMaterial.DIAMOND, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/boots_electric");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/boots_electric");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
}
|
||||
else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
|
||||
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight));
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) {
|
||||
player.moveFlying(0F, 1F, speedBonus);
|
||||
player.jumpMovementFactor = jumpBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
|
||||
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight));
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) {
|
||||
player.moveFlying(0F, 1F, speedBonus);
|
||||
player.jumpMovementFactor = jumpBonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
|
||||
|
||||
if (hasArmor)
|
||||
player.motionY += jumpBonus;
|
||||
}
|
||||
}
|
||||
if (hasArmor)
|
||||
player.motionY += jumpBonus;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if ((entity.inventory.armorInventory[0] != null) && (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
if (ElectricItem.manager.use(stack, energyPerDamage, entity)) event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if ((entity.inventory.armorInventory[0] != null) && (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
if (ElectricItem.manager.use(stack, energyPerDamage, entity))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/electricboots.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/electricboots.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+18
-18
@@ -10,24 +10,24 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemNanoBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 1000000;
|
||||
speedBonus = (float) ConfigHandler.nanoBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.nanoBootsJump;
|
||||
visDiscount = 4;
|
||||
transferLimit = 1000;
|
||||
energyPerDamage = 500;
|
||||
}
|
||||
public ItemNanoBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 1000000;
|
||||
speedBonus = (float) ConfigHandler.nanoBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.nanoBootsJump;
|
||||
visDiscount = 4;
|
||||
transferLimit = 1000;
|
||||
energyPerDamage = 500;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/boots_nano");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/boots_nano");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanobootstravel.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanobootstravel.png";
|
||||
}
|
||||
}
|
||||
+18
-18
@@ -10,24 +10,24 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemQuantumBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 10000000;
|
||||
speedBonus = (float) ConfigHandler.quantumBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.quantumBootsJump;
|
||||
visDiscount = 5;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
public ItemQuantumBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
maxCharge = 10000000;
|
||||
speedBonus = (float) ConfigHandler.quantumBootsSpeed;
|
||||
jumpBonus = (float) ConfigHandler.quantumBootsJump;
|
||||
visDiscount = 5;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/boots_quantum");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/boots_quantum");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/quantumbootstravel.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/quantumbootstravel.png";
|
||||
}
|
||||
}
|
||||
+232
-202
@@ -65,35 +65,34 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
|
||||
|
||||
IIcon iconNONE;
|
||||
IIcon iconJETPACK;
|
||||
IIcon iconTHAUMIUM;
|
||||
IIcon iconNANO;
|
||||
IIcon iconQUANTUM;
|
||||
Random rnd;
|
||||
|
||||
|
||||
public final byte NONE = 0;
|
||||
public final byte JETPACK = 1;
|
||||
public final byte THAUMIUM = 2;
|
||||
public final byte NANO = 3;
|
||||
public final byte QUANTUM = 4;
|
||||
|
||||
|
||||
protected static final Map<Integer, Integer> potionRemovalCost = new HashMap();
|
||||
public static AudioSource audioSource;
|
||||
private static boolean lastJetpackUsed = false;
|
||||
|
||||
|
||||
public ItemInfusedQuantumChestplate(InternalName internalName, int armorType) {
|
||||
super(internalName, InternalName.quantum, armorType, 2000000, 12000.0D, 4);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
potionRemovalCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionRemovalCost.put(Integer.valueOf(IC2Potion.radiation.id), Integer.valueOf(10000));
|
||||
potionRemovalCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(25000));
|
||||
potionRemovalCost.put(Potion.poison.id, 10000);
|
||||
potionRemovalCost.put(IC2Potion.radiation.id, 10000);
|
||||
potionRemovalCost.put(Potion.wither.id, 25000);
|
||||
rnd = new Random();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -104,8 +103,17 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
iconNANO = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_n");
|
||||
iconQUANTUM = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_q");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
return "item." + ModInformation.modid + ".chestplates.infusedQuantum";
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityLivingFallEvent(LivingFallEvent event) {
|
||||
if ((IC2.platform.isSimulating()) && ((event.entity instanceof EntityLivingBase))) {
|
||||
@@ -121,159 +129,169 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1D;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int getEnergyPerDamage() {
|
||||
return 20000;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemStack);
|
||||
|
||||
|
||||
byte toggleTimer = nbt.getByte("toggleTimer");
|
||||
boolean ret = false;
|
||||
boolean hoverMode = nbt.getBoolean("hoverMode");
|
||||
boolean jetpackUsed = false;
|
||||
byte wing = nbt.getByte("wing");
|
||||
|
||||
if(!world.isRemote){
|
||||
|
||||
if(wing == 0){
|
||||
|
||||
if (!world.isRemote) {
|
||||
if (nbt.hasKey("useother")) {
|
||||
String useother = nbt.getString("useother");
|
||||
if (useother.equals("Jetpack")) {
|
||||
nbt.setByte("wing", JETPACK);
|
||||
}
|
||||
if (useother.equals("TW")) {
|
||||
nbt.setByte("wing", THAUMIUM);
|
||||
}
|
||||
if (useother.equals("NW")) {
|
||||
nbt.setByte("wing", NANO);
|
||||
}
|
||||
if (useother.equals("QW")) {
|
||||
nbt.setByte("wing", QUANTUM);
|
||||
}
|
||||
wing = nbt.getByte("wing");
|
||||
nbt.removeTag("useother");
|
||||
}
|
||||
|
||||
if (wing == 0) {
|
||||
nbt.setByte("wing", NONE);
|
||||
}
|
||||
|
||||
|
||||
if ((IC2.keyboard.isJumpKeyDown(player)) && (IC2.keyboard.isModeSwitchKeyDown(player)) && (toggleTimer == 0)) {
|
||||
toggleTimer = 30;
|
||||
hoverMode = !hoverMode;
|
||||
if (IC2.platform.isSimulating())
|
||||
{
|
||||
if (IC2.platform.isSimulating()) {
|
||||
nbt.setBoolean("hoverMode", hoverMode);
|
||||
if (hoverMode)
|
||||
{
|
||||
if (hoverMode) {
|
||||
IC2.platform.messagePlayer(player, "Hover Mode enabled.", new Object[0]);
|
||||
} else
|
||||
{
|
||||
}
|
||||
else {
|
||||
IC2.platform.messagePlayer(player, "Hover Mode disabled.", new Object[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(player.inventory.getCurrentItem() != null && player.isSneaking() && toggleTimer == 0 && wing == NONE){
|
||||
if(player.inventory.getCurrentItem().getItem() == IC2Items.getItem("electricJetpack").getItem()){
|
||||
|
||||
if (player.inventory.getCurrentItem() != null && player.isSneaking() && toggleTimer == 0 && wing == NONE) {
|
||||
if (player.inventory.getCurrentItem().getItem() == IC2Items.getItem("electricJetpack").getItem()) {
|
||||
IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]);
|
||||
nbt.setByte("wing", JETPACK);
|
||||
int charge = (int)ElectricItem.manager.getCharge(itemStack);
|
||||
if(ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000){
|
||||
int charge = (int) ElectricItem.manager.getCharge(itemStack);
|
||||
if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
|
||||
ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(player.inventory.getCurrentItem()), player);
|
||||
}
|
||||
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int)ElectricItem.manager.getCharge(itemStack)));
|
||||
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int) ElectricItem.manager.getCharge(itemStack)));
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
|
||||
}
|
||||
|
||||
else if(player.inventory.getCurrentItem().getItem() == ItemRegistry.thaumiumWing){
|
||||
|
||||
else if (player.inventory.getCurrentItem().getItem() == ItemRegistry.thaumiumWing) {
|
||||
IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]);
|
||||
nbt.setByte("wing", THAUMIUM);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
}
|
||||
|
||||
else if(player.inventory.getCurrentItem().getItem() == ItemRegistry.nanoWing){
|
||||
|
||||
else if (player.inventory.getCurrentItem().getItem() == ItemRegistry.nanoWing) {
|
||||
IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]);
|
||||
nbt.setByte("wing", NANO);
|
||||
int charge = (int)ElectricItem.manager.getCharge(itemStack);
|
||||
if(ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < ItemNanoWing.maxCharge){
|
||||
int charge = (int) ElectricItem.manager.getCharge(itemStack);
|
||||
if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < ItemNanoWing.maxCharge) {
|
||||
ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(player.inventory.getCurrentItem()), player);
|
||||
}
|
||||
nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int)ElectricItem.manager.getCharge(itemStack)));
|
||||
nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int) ElectricItem.manager.getCharge(itemStack)));
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
}
|
||||
|
||||
else if(player.inventory.getCurrentItem().getItem() == ItemRegistry.quantumWing){
|
||||
|
||||
else if (player.inventory.getCurrentItem().getItem() == ItemRegistry.quantumWing) {
|
||||
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
|
||||
nbt.setByte("wing", QUANTUM);
|
||||
int charge = (int)ElectricItem.manager.getCharge(itemStack);
|
||||
if(ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < ItemQuantumWing.maxCharge){
|
||||
int charge = (int) ElectricItem.manager.getCharge(itemStack);
|
||||
if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < ItemQuantumWing.maxCharge) {
|
||||
ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(player.inventory.getCurrentItem()), player);
|
||||
}
|
||||
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int)ElectricItem.manager.getCharge(itemStack)));
|
||||
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) + charge - (int) ElectricItem.manager.getCharge(itemStack)));
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
}
|
||||
}
|
||||
|
||||
if(player.inventory.getCurrentItem() == null && nbt.getBoolean("unequip") && player.isSneaking() && toggleTimer == 0 && IC2.platform.isSimulating()){
|
||||
|
||||
if (player.inventory.getCurrentItem() == null && nbt.getBoolean("unequip") && player.isSneaking() && toggleTimer == 0 && IC2.platform.isSimulating()) {
|
||||
toggleTimer = 30;
|
||||
|
||||
if(wing == JETPACK){
|
||||
if (wing == JETPACK) {
|
||||
IC2.platform.messagePlayer(player, "Jetpack disabled.", new Object[0]);
|
||||
nbt.setByte("wing", NONE);
|
||||
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
|
||||
if(nbt.getInteger("jetpackCharge") > 0)
|
||||
ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false);
|
||||
else
|
||||
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
|
||||
if (nbt.getInteger("jetpackCharge") > 0)
|
||||
ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false);
|
||||
else
|
||||
ElectricItem.manager.charge(charged, 0, 1, true, false);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||
}
|
||||
|
||||
if(wing == THAUMIUM){
|
||||
|
||||
if (wing == THAUMIUM) {
|
||||
IC2.platform.messagePlayer(player, "Thaumium wings disabled.", new Object[0]);
|
||||
nbt.setByte("wing", NONE);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ItemRegistry.thaumiumWing));
|
||||
}
|
||||
|
||||
if(wing == NANO){
|
||||
|
||||
if (wing == NANO) {
|
||||
IC2.platform.messagePlayer(player, "Nano wings disabled.", new Object[0]);
|
||||
nbt.setByte("wing", NONE);
|
||||
ItemStack charged = new ItemStack(ItemRegistry.nanoWing);
|
||||
if(nbt.getInteger("NWCharge") > 0)
|
||||
if (nbt.getInteger("NWCharge") > 0)
|
||||
ElectricItem.manager.charge(charged, nbt.getInteger("NWCharge"), 3, true, false);
|
||||
else
|
||||
ElectricItem.manager.charge(charged, 0, 3, true, false);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||
}
|
||||
|
||||
if(wing == QUANTUM){
|
||||
|
||||
if (wing == QUANTUM) {
|
||||
IC2.platform.messagePlayer(player, "Quantum wings disabled.", new Object[0]);
|
||||
nbt.setByte("wing", NONE);
|
||||
ItemStack charged = new ItemStack(ItemRegistry.quantumWing);
|
||||
if(nbt.getInteger("QWCharge") > 0)
|
||||
if (nbt.getInteger("QWCharge") > 0)
|
||||
ElectricItem.manager.charge(charged, nbt.getInteger("QWCharge"), 3, true, false);
|
||||
else
|
||||
ElectricItem.manager.charge(charged, 0, 3, true, false);
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
|
||||
}
|
||||
|
||||
|
||||
nbt.setBoolean("unequip", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((IC2.keyboard.isJumpKeyDown(player) && wing == JETPACK) || (hoverMode && player.motionY < -0.029999999329447746D)) {
|
||||
jetpackUsed = useJetpack(player, hoverMode, itemStack);
|
||||
}
|
||||
|
||||
if(wing == THAUMIUM)
|
||||
|
||||
if (wing == THAUMIUM)
|
||||
useWing(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
|
||||
if(wing == NANO)
|
||||
if (wing == NANO)
|
||||
useWing(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
|
||||
if(wing == QUANTUM)
|
||||
useWing(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||
|
||||
|
||||
if (wing == QUANTUM)
|
||||
useWing(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||
|
||||
if ((IC2.platform.isSimulating()) && (toggleTimer > 0)) {
|
||||
toggleTimer = (byte) (toggleTimer - 1);
|
||||
nbt.setByte("toggleTimer", toggleTimer);
|
||||
@@ -287,7 +305,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
if (audioSource != null) {
|
||||
audioSource.play();
|
||||
}
|
||||
} else if (audioSource != null) {
|
||||
}
|
||||
else if (audioSource != null) {
|
||||
audioSource.remove();
|
||||
audioSource = null;
|
||||
}
|
||||
@@ -297,7 +316,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
audioSource.updatePosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret = jetpackUsed;
|
||||
|
||||
player.extinguish();
|
||||
@@ -306,98 +325,108 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconIndex(ItemStack stack){
|
||||
try{
|
||||
public IIcon getIconIndex(ItemStack stack) {
|
||||
try {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch(wing){
|
||||
case JETPACK : return iconJETPACK;
|
||||
case THAUMIUM : return iconTHAUMIUM;
|
||||
case NANO : return iconNANO;
|
||||
case QUANTUM : return iconQUANTUM;
|
||||
default : return iconNONE;
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return iconJETPACK;
|
||||
case THAUMIUM:
|
||||
return iconTHAUMIUM;
|
||||
case NANO:
|
||||
return iconNANO;
|
||||
case QUANTUM:
|
||||
return iconQUANTUM;
|
||||
default:
|
||||
return iconNONE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return iconNONE;
|
||||
}
|
||||
catch(Exception ex){return iconNONE;}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining){
|
||||
try{
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||
try {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch(wing){
|
||||
case JETPACK : return iconJETPACK;
|
||||
case THAUMIUM : return iconTHAUMIUM;
|
||||
case NANO : return iconNANO;
|
||||
case QUANTUM : return iconQUANTUM;
|
||||
default : return iconNONE;
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return iconJETPACK;
|
||||
case THAUMIUM:
|
||||
return iconTHAUMIUM;
|
||||
case NANO:
|
||||
return iconNANO;
|
||||
case QUANTUM:
|
||||
return iconQUANTUM;
|
||||
default:
|
||||
return iconNONE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return iconNONE;
|
||||
}
|
||||
catch(Exception e){return iconNONE;}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false)
|
||||
return 0;
|
||||
else
|
||||
return 4;
|
||||
if (ConfigHandler.enchanting == false)
|
||||
return 0;
|
||||
else
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch (wing) {
|
||||
case JETPACK:
|
||||
return ModInformation.texturePath + ":textures/models/quantum_jetpack.png";
|
||||
case THAUMIUM:
|
||||
return ModInformation.texturePath + ":textures/models/quantum_wings_t.png";
|
||||
case NANO:
|
||||
return ModInformation.texturePath + ":textures/models/quantum_wings_n.png";
|
||||
case QUANTUM:
|
||||
return ModInformation.texturePath + ":textures/models/quantum_wings_q.png";
|
||||
default:
|
||||
return ModInformation.texturePath + ":textures/models/quantum.png";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
try {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
if (wing == JETPACK) {
|
||||
ModelCpecialArmor mbm = new ModelCpecialArmor(1, 1);
|
||||
return mbm;
|
||||
}
|
||||
else if (wing != 0) {
|
||||
ModelCpecialArmor mbm = new ModelCpecialArmor(1, 2);
|
||||
mbm.isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
return mbm;
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
new ModelCpecialArmor(1, 0);
|
||||
}
|
||||
return new ModelCpecialArmor(1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
try {
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + tier);
|
||||
} catch (NullPointerException e) {}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch(wing){
|
||||
case JETPACK : return ModInformation.texturePath + ":textures/models/quantum_jetpack.png";
|
||||
case THAUMIUM : return ModInformation.texturePath + ":textures/models/quantum_wings_t.png";
|
||||
case NANO : return ModInformation.texturePath + ":textures/models/quantum_wings_n.png";
|
||||
case QUANTUM : return ModInformation.texturePath + ":textures/models/quantum_wings_q.png";
|
||||
default : return ModInformation.texturePath + ":textures/models/quantum.png";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
try{
|
||||
if(entity instanceof EntityPlayer){
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
if(wing == JETPACK){
|
||||
ModelCpecialArmor mbm = new ModelCpecialArmor(1, 1);
|
||||
return mbm;
|
||||
}
|
||||
else if(wing != 0){
|
||||
ModelCpecialArmor mbm = new ModelCpecialArmor(1, 2);
|
||||
mbm.isJumping = IC2.keyboard.isJumpKeyDown((EntityPlayer) entity);
|
||||
return mbm;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(NullPointerException e){new ModelCpecialArmor(1, 0);}
|
||||
return new ModelCpecialArmor(1, 0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
try{
|
||||
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + tier);
|
||||
}
|
||||
catch(NullPointerException e){}
|
||||
}
|
||||
|
||||
|
||||
public boolean useJetpack(EntityPlayer player, boolean hoverMode, ItemStack stack) {
|
||||
int jetpackMaxCharge = 30000;
|
||||
ItemStack jetpack = stack;
|
||||
@@ -405,8 +434,8 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
return false;
|
||||
float power = 1.0F;
|
||||
float dropPercentage = 0.05F;
|
||||
if (((float)ElectricItem.manager.getCharge(stack) / (float)jetpackMaxCharge) <= dropPercentage){
|
||||
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float)jetpackMaxCharge) * dropPercentage);
|
||||
if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) {
|
||||
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) * dropPercentage);
|
||||
}
|
||||
if (IC2.keyboard.isForwardKeyDown(player)) {
|
||||
float retruster = 3.5F;
|
||||
@@ -418,7 +447,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
player.moveFlying(0.0F, 0.4F * forwardpower, 0.02F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int worldHeight = IC2.getWorldHeight(player.worldObj);
|
||||
|
||||
double y = player.posY;
|
||||
@@ -455,55 +484,56 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
IC2.platform.resetPlayerInAirTime(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric){
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
|
||||
void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
|
||||
|
||||
if(isJumping){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if(f > 7) nbtData.setByte("f", (byte) 7);
|
||||
}
|
||||
else if(nbtData.getBoolean("isHolding")){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
player.motionY = motionY * f;
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
if(player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5){
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
}
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
for(int i = 0; i < 4; i++){
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
if (isJumping && !player.onGround && player.motionY < 0){
|
||||
player.motionY *= f1;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((world.getBiomeGenForCoords((int)player.posX, (int)player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int)player.posX, (int)player.posY, (int)player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode){
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
nbtData.setBoolean("isJumping", isJumping);
|
||||
|
||||
if (isJumping) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if (f > 7)
|
||||
nbtData.setByte("f", (byte) 7);
|
||||
}
|
||||
else if (nbtData.getBoolean("isHolding")) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
player.motionY = motionY * f;
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
}
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
if (isJumping && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= f1;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
|
||||
if (ConfigHandler.impactOfRain) {
|
||||
if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+135
-132
@@ -29,162 +29,165 @@ import java.util.List;
|
||||
|
||||
public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
|
||||
|
||||
public double maxCharge = 10000;
|
||||
public double transferLimit = 10;
|
||||
public int tier = 2;
|
||||
public int energyPerDamage = 100;
|
||||
public int visDiscount = 5;
|
||||
public double maxCharge = 10000;
|
||||
public double transferLimit = 10;
|
||||
public int tier = 2;
|
||||
public int energyPerDamage = 100;
|
||||
public int visDiscount = 5;
|
||||
|
||||
public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
}
|
||||
public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_electric");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_electric");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/electricgoggles.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/electricgoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showNodes(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean showNodes(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||
}
|
||||
else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -17,45 +17,46 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemNanoGoggles extends ItemElectricGoggles {
|
||||
|
||||
public ItemNanoGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
visDiscount = 6;
|
||||
tier = 3;
|
||||
maxCharge = 100000;
|
||||
energyPerDamage = 1000;
|
||||
transferLimit = 100;
|
||||
}
|
||||
public ItemNanoGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
visDiscount = 6;
|
||||
tier = 3;
|
||||
maxCharge = 100000;
|
||||
energyPerDamage = 1000;
|
||||
transferLimit = 100;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_nano");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_nano");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumicnanohelmet.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumicnanohelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (ConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (ConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
} else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
}
|
||||
else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,76 +23,77 @@ import java.util.Map;
|
||||
|
||||
public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
|
||||
private static final Map<Integer, Integer> potionCost = new HashMap();
|
||||
private static final Map<Integer, Integer> potionCost = new HashMap();
|
||||
|
||||
public ItemQuantumGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
maxCharge = 10000000;
|
||||
tier = 3;
|
||||
visDiscount = 8;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
public ItemQuantumGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
maxCharge = 10000000;
|
||||
tier = 3;
|
||||
visDiscount = 8;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||
}
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_quantum");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_quantum");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumicquantumhelmet.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumicquantumhelmet.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
int refill = player.getAir();
|
||||
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
|
||||
player.setAir(refill + 200);
|
||||
ElectricItem.manager.use(itemStack, 1000, null);
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
int refill = player.getAir();
|
||||
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
|
||||
player.setAir(refill + 200);
|
||||
ElectricItem.manager.use(itemStack, 1000, null);
|
||||
}
|
||||
|
||||
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
|
||||
do {
|
||||
if (!i$.hasNext()) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null) {
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
|
||||
do {
|
||||
if (!i$.hasNext()) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null) {
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
|
||||
if (ConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
} else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
}
|
||||
else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+139
-133
@@ -24,37 +24,36 @@ import java.util.Map;
|
||||
|
||||
public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
|
||||
private int ticker;
|
||||
private int generating;
|
||||
private int genDay;
|
||||
private int genNight;
|
||||
private boolean sunIsUp;
|
||||
private boolean skyIsVisible;
|
||||
private boolean noSunWorld;
|
||||
private boolean dampPlace;
|
||||
private int ticker;
|
||||
private int generating;
|
||||
private int genDay;
|
||||
private int genNight;
|
||||
private boolean sunIsUp;
|
||||
private boolean skyIsVisible;
|
||||
private boolean noSunWorld;
|
||||
private boolean dampPlace;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static final Map potionCost = new HashMap();
|
||||
private static final Map potionCost = new HashMap();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.maxCharge = 1000000;
|
||||
this.genDay = 256;
|
||||
this.genNight = 128;
|
||||
maxCharge = 10000000;
|
||||
visDiscount = 7;
|
||||
tier = 3;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 10000;
|
||||
@SuppressWarnings("unchecked")
|
||||
public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.maxCharge = 1000000;
|
||||
this.genDay = 256;
|
||||
this.genNight = 128;
|
||||
maxCharge = 10000000;
|
||||
visDiscount = 7;
|
||||
tier = 3;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 10000;
|
||||
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||
}
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -62,118 +61,125 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/goggles_solar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) {
|
||||
return ModInformation.texturePath + ":textures/models/solarrevealinghelmet.png";
|
||||
}
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) {
|
||||
return ModInformation.texturePath + ":textures/models/solarrevealinghelmet.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) {
|
||||
if (ConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) {
|
||||
if (ConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
} else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
}
|
||||
else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
|
||||
int refill = player.getAir();
|
||||
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
|
||||
player.setAir(refill + 200);
|
||||
ElectricItem.manager.use(itemStack, 1000, null);
|
||||
}
|
||||
int refill = player.getAir();
|
||||
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
|
||||
player.setAir(refill + 200);
|
||||
ElectricItem.manager.use(itemStack, 1000, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes") Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
|
||||
do {
|
||||
if (!i$.hasNext()) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null) {
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
@SuppressWarnings("rawtypes")
|
||||
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
|
||||
do {
|
||||
if (!i$.hasNext()) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null) {
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
checkForSun(player);
|
||||
if (this.generating > 0) {
|
||||
int energyLeft = this.generating;
|
||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
checkForSun(player);
|
||||
if (this.generating > 0) {
|
||||
int energyLeft = this.generating;
|
||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int checkForSun(EntityPlayer player) {
|
||||
if (this.ticker++ % tickRate() == 0) {
|
||||
updateVisibility(player);
|
||||
}
|
||||
if ((this.sunIsUp) && (this.skyIsVisible)) {
|
||||
this.generating = (0 + this.genDay);
|
||||
return this.generating;
|
||||
}
|
||||
if (this.skyIsVisible) {
|
||||
this.generating = (0 + this.genNight);
|
||||
return this.generating;
|
||||
}
|
||||
this.generating = 0;
|
||||
return this.generating;
|
||||
}
|
||||
public int checkForSun(EntityPlayer player) {
|
||||
if (this.ticker++ % tickRate() == 0) {
|
||||
updateVisibility(player);
|
||||
}
|
||||
if ((this.sunIsUp) && (this.skyIsVisible)) {
|
||||
this.generating = (0 + this.genDay);
|
||||
return this.generating;
|
||||
}
|
||||
if (this.skyIsVisible) {
|
||||
this.generating = (0 + this.genNight);
|
||||
return this.generating;
|
||||
}
|
||||
this.generating = 0;
|
||||
return this.generating;
|
||||
}
|
||||
|
||||
public void updateVisibility(EntityPlayer player) {
|
||||
this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0);
|
||||
this.noSunWorld = player.worldObj.provider.hasNoSky;
|
||||
Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering())));
|
||||
if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) {
|
||||
this.sunIsUp = false;
|
||||
} else {
|
||||
this.sunIsUp = true;
|
||||
}
|
||||
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) {
|
||||
this.skyIsVisible = false;
|
||||
} else {
|
||||
this.skyIsVisible = true;
|
||||
}
|
||||
}
|
||||
public void updateVisibility(EntityPlayer player) {
|
||||
this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0);
|
||||
this.noSunWorld = player.worldObj.provider.hasNoSky;
|
||||
Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering())));
|
||||
if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) {
|
||||
this.sunIsUp = false;
|
||||
}
|
||||
else {
|
||||
this.sunIsUp = true;
|
||||
}
|
||||
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) {
|
||||
this.skyIsVisible = false;
|
||||
}
|
||||
else {
|
||||
this.skyIsVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static int tickRate() {
|
||||
return 128;
|
||||
}
|
||||
public static int tickRate() {
|
||||
return 128;
|
||||
}
|
||||
}
|
||||
@@ -24,98 +24,100 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
public int visDiscount = 0;
|
||||
Random rnd;
|
||||
public int visDiscount = 0;
|
||||
Random rnd;
|
||||
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(120);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
rnd = new Random();
|
||||
}
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(120);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
rnd = new Random();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_feather");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_feather");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/featherwing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/featherwing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
try{
|
||||
if(entity instanceof EntityPlayer){
|
||||
ModelWings mw = new ModelWings();
|
||||
mw.isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
return mw;
|
||||
}
|
||||
}
|
||||
catch(NullPointerException e){return new ModelWings();}
|
||||
return new ModelWings();
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
try {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
ModelWings mw = new ModelWings();
|
||||
mw.isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
return mw;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
return new ModelWings();
|
||||
}
|
||||
return new ModelWings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
useWing(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
}
|
||||
|
||||
public void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount){
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
|
||||
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
|
||||
|
||||
if(isJmuping){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if(f > 7) nbtData.setByte("f", (byte) 7);
|
||||
}
|
||||
else if(isHolding){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
player.motionY = motionY * f;
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
if(player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5){
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
}
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
for(int i = 0; i < 4; i++){
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
useWing(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
}
|
||||
|
||||
if (isJmuping && !player.onGround && player.motionY < 0){
|
||||
player.motionY *= f1;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode){
|
||||
player.motionY += -0.03;
|
||||
}
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((world.getBiomeGenForCoords((int)player.posX, (int)player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int)player.posX, (int)player.posY, (int)player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode){
|
||||
player.motionY += -0.03;
|
||||
}
|
||||
}
|
||||
public void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0){
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F){
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
|
||||
|
||||
if (isJmuping) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if (f > 7)
|
||||
nbtData.setByte("f", (byte) 7);
|
||||
}
|
||||
else if (isHolding) {
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
player.motionY = motionY * f;
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
}
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
if (isJmuping && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= f1;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.03;
|
||||
}
|
||||
|
||||
if (ConfigHandler.impactOfRain) {
|
||||
if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.03;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,145 +25,148 @@ import java.util.List;
|
||||
|
||||
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
|
||||
|
||||
public static int maxCharge = 100000;
|
||||
public int tier = 3;
|
||||
public double transferLimit = 1000;
|
||||
public int energyPerDamage = 100;
|
||||
public static int maxCharge = 100000;
|
||||
public int tier = 3;
|
||||
public double transferLimit = 1000;
|
||||
public int energyPerDamage = 100;
|
||||
|
||||
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
visDiscount = 5;
|
||||
}
|
||||
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
visDiscount = 5;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_nano");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_nano");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanowing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/nanowing.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
public int getEnergyPerDamage() {
|
||||
return energyPerDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
}
|
||||
else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return transferLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+30
-31
@@ -23,40 +23,39 @@ import java.util.List;
|
||||
|
||||
public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable {
|
||||
|
||||
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(250);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
visDiscount = 4;
|
||||
}
|
||||
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(250);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.isDamageable();
|
||||
visDiscount = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return visDiscount;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_thaumium");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_thaumium");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumiumwing.png";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ModInformation.texturePath + ":textures/models/thaumiumwing.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||
}
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.useWing(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||
}
|
||||
}
|
||||
@@ -6,35 +6,35 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemBlockEMTMachines extends ItemBlock {
|
||||
|
||||
public ItemBlockEMTMachines(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemBlockEMTMachines(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "wandrecharge";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "etheralprocessor";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "raindispeller";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "wandrecharge";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "etheralprocessor";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "raindispeller";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
}
|
||||
@@ -13,172 +13,172 @@ import static tombenpotter.emt.common.util.TextHelper.localize;
|
||||
|
||||
public class ItemBlockEMTSolars extends ItemBlock {
|
||||
|
||||
public ItemBlockEMTSolars(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemBlockEMTSolars(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "compressed";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "doublecompressed";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "triplecompressed";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "water";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "doublewater";
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
name = "triplewater";
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
name = "dark";
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
name = "doubledark";
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
name = "tripledark";
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
name = "order";
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
name = "doubleorder";
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
name = "tripleorder";
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
name = "doublefire";
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
name = "triplefire";
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
name = "air";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "compressed";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "doublecompressed";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "triplecompressed";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "water";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "doublewater";
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
name = "triplewater";
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
name = "dark";
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
name = "doubledark";
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
name = "tripledark";
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
name = "order";
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
name = "doubleorder";
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
name = "tripleorder";
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
name = "doublefire";
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
name = "triplefire";
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
name = "air";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(ConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(ConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(ConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(ConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(ConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(ConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 11: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
case 11: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,80 +13,79 @@ import static tombenpotter.emt.common.util.TextHelper.localize;
|
||||
|
||||
public class ItemBlockEMTSolars2 extends ItemBlock {
|
||||
|
||||
public ItemBlockEMTSolars2(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemBlockEMTSolars2(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "doubleair";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "tripleair";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "earth";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "doubleearth";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "tripleearth";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
name = "doubleair";
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
name = "tripleair";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
name = "earth";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "doubleearth";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
name = "tripleearth";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
list.add(localize("tooltip.EMT.forget"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,4 @@ public class ItemBlockEssentiaGenerator extends ItemBlock {
|
||||
public ItemBlockEssentiaGenerator(Block id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
// list.add("");
|
||||
}
|
||||
}
|
||||
+52
-39
@@ -16,46 +16,59 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||
|
||||
public ItemBlockEssentiaGenerators(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemBlockEssentiaGenerators(Block id) {
|
||||
super(id);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: name = "potentia";
|
||||
break;
|
||||
case 1: name = "ignis";
|
||||
break;
|
||||
case 2: name = "auram";
|
||||
break;
|
||||
case 3: name = "arbor";
|
||||
break;
|
||||
case 4: name = "aer";
|
||||
break;
|
||||
default: name = "nothing";
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0:
|
||||
name = "potentia";
|
||||
break;
|
||||
case 1:
|
||||
name = "ignis";
|
||||
break;
|
||||
case 2:
|
||||
name = "auram";
|
||||
break;
|
||||
case 3:
|
||||
name = "arbor";
|
||||
break;
|
||||
case 4:
|
||||
name = "aer";
|
||||
break;
|
||||
default:
|
||||
name = "nothing";
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
switch(stack.getItemDamage()){
|
||||
case 0 : list.add(ConfigHandler.potentiaGenerator + " EU/t");
|
||||
break;
|
||||
case 1 : list.add(ConfigHandler.ignisGenerator + " EU/t");
|
||||
break;
|
||||
case 2 : list.add(ConfigHandler.auramGenerator + " EU/t");
|
||||
break;
|
||||
case 3 : list.add(ConfigHandler.arborGenerator + " EU/t");
|
||||
break;
|
||||
case 4 : list.add(ConfigHandler.aerGenerator + " EU/t");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 0:
|
||||
list.add(ConfigHandler.potentiaGenerator + " EU/t");
|
||||
break;
|
||||
case 1:
|
||||
list.add(ConfigHandler.ignisGenerator + " EU/t");
|
||||
break;
|
||||
case 2:
|
||||
list.add(ConfigHandler.auramGenerator + " EU/t");
|
||||
break;
|
||||
case 3:
|
||||
list.add(ConfigHandler.arborGenerator + " EU/t");
|
||||
break;
|
||||
case 4:
|
||||
list.add(ConfigHandler.aerGenerator + " EU/t");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int meta) {return meta;}
|
||||
@Override
|
||||
public int getMetadata(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -40,10 +40,10 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
boolean hasOrnament() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon(ModInformation.texturePath + ":" + textureName);
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon(ModInformation.texturePath + ":" + textureName);
|
||||
}
|
||||
|
||||
boolean hasDepth() {
|
||||
@@ -82,8 +82,8 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
}
|
||||
|
||||
public boolean isUseItem(ItemStack stack) {
|
||||
return isVisCostPerTick(stack);
|
||||
}
|
||||
return isVisCostPerTick(stack);
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick() {
|
||||
return false;
|
||||
@@ -124,7 +124,6 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
AspectList cost = getVisCost();
|
||||
|
||||
@@ -14,56 +14,58 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemChargeFocus extends ItemBaseFocus {
|
||||
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||
|
||||
public ItemChargeFocus() {
|
||||
super(".focus.charge", "focus_charge");
|
||||
}
|
||||
public ItemChargeFocus() {
|
||||
super(".focus.charge", "focus_charge");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0xFFFF00;
|
||||
}
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0xFFFF00;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visCost;
|
||||
}
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "WANDCHARGING";
|
||||
}
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "WANDCHARGING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
|
||||
int energyLeft = ConfigHandler.chargeFocusProduction;
|
||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} else {
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} else {
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
int energyLeft = ConfigHandler.chargeFocusProduction;
|
||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||
if (energyLeft > 0) {
|
||||
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
@@ -18,44 +18,44 @@ import tombenpotter.emt.ModInformation;
|
||||
|
||||
public class ItemChristmasFocus extends ItemBaseFocus {
|
||||
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
|
||||
|
||||
public ItemChristmasFocus() {
|
||||
super(".focus.christmas", "focus_christmas" );
|
||||
}
|
||||
public ItemChristmasFocus() {
|
||||
super(".focus.christmas", "focus_christmas");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0x00FFFF;
|
||||
}
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0x00FFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visCost;
|
||||
}
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "CHRISTMAS";
|
||||
}
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "CHRISTMAS";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
|
||||
int x = mop.blockX;
|
||||
int y = mop.blockY + 1;
|
||||
int z = mop.blockZ;
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
EntitySnowman snowman;
|
||||
snowman = new EntitySnowman(world);
|
||||
snowman.setPosition(x, y, z);
|
||||
world.spawnEntityInWorld(snowman);
|
||||
}
|
||||
}
|
||||
player.swingItem();
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
|
||||
int x = mop.blockX;
|
||||
int y = mop.blockY + 1;
|
||||
int z = mop.blockZ;
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
EntitySnowman snowman;
|
||||
snowman = new EntitySnowman(world);
|
||||
snowman.setPosition(x, y, z);
|
||||
world.spawnEntityInWorld(snowman);
|
||||
}
|
||||
}
|
||||
player.swingItem();
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
@@ -11,38 +11,38 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import tombenpotter.emt.common.entities.EntityLaser;
|
||||
|
||||
public class ItemExplosionFocus extends ItemBaseFocus {
|
||||
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
|
||||
|
||||
public ItemExplosionFocus() {
|
||||
super(".focus.explosion", "focus_explosion");
|
||||
}
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0x8B0000;
|
||||
}
|
||||
public ItemExplosionFocus() {
|
||||
super(".focus.explosion", "focus_explosion");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack focusstack) {
|
||||
return visCost;
|
||||
}
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0x8B0000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "EXPLOSION";
|
||||
}
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack focusstack) {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
EntityLaser laser;
|
||||
laser = new EntityLaser(world, player, 2);
|
||||
world.spawnEntityInWorld(laser);
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "EXPLOSION";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
if (!world.isRemote) {
|
||||
EntityLaser laser;
|
||||
laser = new EntityLaser(world, player, 2);
|
||||
world.spawnEntityInWorld(laser);
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
@@ -17,107 +17,109 @@ public class ItemShieldFocus extends ItemBaseFocus {
|
||||
int y1 = 0;
|
||||
ItemStack milk;
|
||||
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10);
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10);
|
||||
|
||||
public ItemShieldFocus() {
|
||||
super(".focus.shield", "focus_shield");
|
||||
}
|
||||
public ItemShieldFocus() {
|
||||
super(".focus.shield", "focus_shield");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0x1E90FF;
|
||||
}
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0x1E90FF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visCost;
|
||||
}
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "SHIELD";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseItem(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "SHIELD";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
|
||||
player.motionX = 0.0D;
|
||||
if(!player.capabilities.isCreativeMode && player.motionY < 0)
|
||||
player.motionY = player.motionY / 2;
|
||||
player.motionZ = 0.0D;
|
||||
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
|
||||
if(milk == null)milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
|
||||
|
||||
if(player.motionY > -5){
|
||||
// Player Level
|
||||
if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) {
|
||||
player.worldObj.setBlock(x + 1, y, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x - 1, y, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y, z + 1, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y, z - 1, BlockRegistry.shield);
|
||||
}
|
||||
@Override
|
||||
public boolean isUseItem(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Above the player
|
||||
if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) {
|
||||
player.worldObj.setBlock(x + 1, y + 1, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x - 1, y + 1, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield);
|
||||
}
|
||||
|
||||
if (y > y1 && (player.worldObj.isAirBlock(x + 1, y - 2, z) && player.worldObj.isAirBlock(x - 1, y - 2, z) && player.worldObj.isAirBlock(x, y - 2, z + 1) && player.worldObj.isAirBlock(x, y - 2, z - 1)) || (player.worldObj.getBlock(x + 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z - 1) == BlockRegistry.shield)){
|
||||
player.worldObj.setBlockToAir(x + 1, y - 2, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y - 2, z);
|
||||
player.worldObj.setBlockToAir(x, y - 2, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y - 2, z - 1);
|
||||
}
|
||||
|
||||
if (y < y1 && (player.worldObj.isAirBlock(x + 1, y + 2, z) && player.worldObj.isAirBlock(x - 1, y + 2, z) && player.worldObj.isAirBlock(x, y + 2, z + 1) && player.worldObj.isAirBlock(x, y + 2, z - 1)) || (player.worldObj.getBlock(x + 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z - 1) == BlockRegistry.shield)){
|
||||
player.worldObj.setBlockToAir(x + 1, y + 2, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y + 2, z);
|
||||
player.worldObj.setBlockToAir(x, y + 2, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y + 2, z - 1);
|
||||
}
|
||||
}
|
||||
|
||||
y1 = y;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
|
||||
|
||||
// Player Level
|
||||
if ((player.worldObj.getBlock(x + 1, y, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y, z + 1) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y, z - 1) == BlockRegistry.shield)) {
|
||||
player.worldObj.setBlockToAir(x + 1, y, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y, z);
|
||||
player.worldObj.setBlockToAir(x, y, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y, z - 1);
|
||||
}
|
||||
player.motionX = 0.0D;
|
||||
if (!player.capabilities.isCreativeMode && player.motionY < 0)
|
||||
player.motionY = player.motionY / 2;
|
||||
player.motionZ = 0.0D;
|
||||
|
||||
// Above the player
|
||||
if ((player.worldObj.getBlock(x + 1, y + 1, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y + 1, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z + 1) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z - 1) == BlockRegistry.shield)) {
|
||||
player.worldObj.setBlockToAir(x + 1, y + 1, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y + 1, z);
|
||||
player.worldObj.setBlockToAir(x, y + 1, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y + 1, z - 1);
|
||||
}
|
||||
}
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
|
||||
if (milk == null)
|
||||
milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
|
||||
if (player.motionY > -5) {
|
||||
// Player Level
|
||||
if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) {
|
||||
player.worldObj.setBlock(x + 1, y, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x - 1, y, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y, z + 1, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y, z - 1, BlockRegistry.shield);
|
||||
}
|
||||
|
||||
// Above the player
|
||||
if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) {
|
||||
player.worldObj.setBlock(x + 1, y + 1, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x - 1, y + 1, z, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield);
|
||||
player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield);
|
||||
}
|
||||
|
||||
if (y > y1 && (player.worldObj.isAirBlock(x + 1, y - 2, z) && player.worldObj.isAirBlock(x - 1, y - 2, z) && player.worldObj.isAirBlock(x, y - 2, z + 1) && player.worldObj.isAirBlock(x, y - 2, z - 1))
|
||||
|| (player.worldObj.getBlock(x + 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z - 1) == BlockRegistry.shield)) {
|
||||
player.worldObj.setBlockToAir(x + 1, y - 2, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y - 2, z);
|
||||
player.worldObj.setBlockToAir(x, y - 2, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y - 2, z - 1);
|
||||
}
|
||||
|
||||
if (y < y1 && (player.worldObj.isAirBlock(x + 1, y + 2, z) && player.worldObj.isAirBlock(x - 1, y + 2, z) && player.worldObj.isAirBlock(x, y + 2, z + 1) && player.worldObj.isAirBlock(x, y + 2, z - 1))
|
||||
|| (player.worldObj.getBlock(x + 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z - 1) == BlockRegistry.shield)) {
|
||||
player.worldObj.setBlockToAir(x + 1, y + 2, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y + 2, z);
|
||||
player.worldObj.setBlockToAir(x, y + 2, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y + 2, z - 1);
|
||||
}
|
||||
}
|
||||
|
||||
y1 = y;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
|
||||
// Player Level
|
||||
if ((player.worldObj.getBlock(x + 1, y, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y, z + 1) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y, z - 1) == BlockRegistry.shield)) {
|
||||
player.worldObj.setBlockToAir(x + 1, y, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y, z);
|
||||
player.worldObj.setBlockToAir(x, y, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y, z - 1);
|
||||
}
|
||||
|
||||
// Above the player
|
||||
if ((player.worldObj.getBlock(x + 1, y + 1, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y + 1, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z + 1) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z - 1) == BlockRegistry.shield)) {
|
||||
player.worldObj.setBlockToAir(x + 1, y + 1, z);
|
||||
player.worldObj.setBlockToAir(x - 1, y + 1, z);
|
||||
player.worldObj.setBlockToAir(x, y + 1, z + 1);
|
||||
player.worldObj.setBlockToAir(x, y + 1, z - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,49 +11,49 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemWandChargingFocus extends ItemBaseFocus {
|
||||
|
||||
AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||
AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||
|
||||
public ItemWandChargingFocus() {
|
||||
super(".focus.charge.wand", "focus_wandCharge");
|
||||
}
|
||||
public ItemWandChargingFocus() {
|
||||
super(".focus.charge.wand", "focus_chargeWand");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0xFFFF450;
|
||||
}
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0xFFFF450;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "ELECTRICCHARGING";
|
||||
}
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "ELECTRICCHARGING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick(ItemStack focusstack) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isVisCostPerTick(ItemStack focusstack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack focusstack) {
|
||||
return visCost;
|
||||
}
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack focusstack) {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) {
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) {
|
||||
|
||||
if (!player.worldObj.isRemote) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
|
||||
if (!player.worldObj.isRemote) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
|
||||
|
||||
ItemStack armor = player.inventory.armorInventory[1];
|
||||
if (armor != null) {
|
||||
if ((ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)))) {
|
||||
wandItem.addVis(itemstack, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack armor = player.inventory.armorInventory[1];
|
||||
if (armor != null) {
|
||||
if ((ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)))) {
|
||||
wandItem.addVis(itemstack, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(itemstack, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,132 +27,121 @@ import java.util.List;
|
||||
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
|
||||
public IIcon icon;
|
||||
public int maxCharge = 10000;
|
||||
public int growthCost = 1000;
|
||||
public int tillCost = 100;
|
||||
public int maxCharge = 20000;
|
||||
public int growthCost = 500;
|
||||
public int tillCost = 100;
|
||||
|
||||
public ItemElectricHoeGrowth() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
this.growthCost = 10000;
|
||||
}
|
||||
public ItemElectricHoeGrowth() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
this.growthCost = 10000;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.icon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/hoe_growth");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.icon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/hoe_growth");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
return this.icon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if(ElectricItem.manager.canUse(stack, 50)){
|
||||
ElectricItem.manager.use(stack, 50, player);
|
||||
boolean did = false;
|
||||
for (int x1 = -1; x1 <= 1; x1++) {
|
||||
for (int z1 = -1; z1 <= 1; z1++) {
|
||||
if (super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10))
|
||||
{
|
||||
Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2);
|
||||
if (!did) {
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!did)
|
||||
{
|
||||
did = Utils.useBonemealAtLoc(world, player, x, y, z);
|
||||
if (!did)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if ((block == ConfigBlocks.blockCustomPlant) && (meta == 0) && ElectricItem.manager.canUse(stack, 50))
|
||||
{
|
||||
((BlockCustomPlant)block).growGreatTree(world, x, y, z, world.rand);
|
||||
ElectricItem.manager.use(stack, 50, player);
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
|
||||
did = true;
|
||||
}
|
||||
else if ((block == ConfigBlocks.blockCustomPlant) && (meta == 1) && ElectricItem.manager.canUse(stack, 250))
|
||||
{
|
||||
((BlockCustomPlant)block).growSilverTree(world, x, y, z, world.rand);
|
||||
ElectricItem.manager.use(stack, 250, player);
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3);
|
||||
}
|
||||
if (did) {
|
||||
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wand", 0.75F, 0.9F + world.rand.nextFloat() * 0.2F);
|
||||
}
|
||||
}
|
||||
return did;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
|
||||
if (stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setBoolean("Unbreakable", true);
|
||||
}
|
||||
boolean did = false;
|
||||
for (int x1 = -1; x1 <= 1; x1++) {
|
||||
for (int z1 = -1; z1 <= 1; z1++) {
|
||||
if (ElectricItem.manager.canUse(stack, 25) && super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10)) {
|
||||
ElectricItem.manager.use(stack, 25, player);
|
||||
Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2);
|
||||
if (!did) {
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!did && ElectricItem.manager.canUse(stack, 250)) {
|
||||
did = Utils.useBonemealAtLoc(world, player, x, y, z);
|
||||
if (!did) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if ((block == ConfigBlocks.blockCustomPlant) && (meta == 0)) {
|
||||
((BlockCustomPlant) block).growGreatTree(world, x, y, z, world.rand);
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
|
||||
did = true;
|
||||
}
|
||||
else if ((block == ConfigBlocks.blockCustomPlant) && (meta == 1)) {
|
||||
((BlockCustomPlant) block).growSilverTree(world, x, y, z, world.rand);
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ElectricItem.manager.use(stack, 250, player);
|
||||
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3);
|
||||
}
|
||||
if (did) {
|
||||
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wand", 0.75F, 0.9F + world.rand.nextFloat() * 0.2F);
|
||||
}
|
||||
}
|
||||
if (stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setBoolean("Unbreakable", false);
|
||||
}
|
||||
return did;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 1000;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,6 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -24,71 +24,72 @@ import java.util.List;
|
||||
|
||||
public class ItemThorHammer extends ItemSword implements IRepairable {
|
||||
|
||||
public ItemThorHammer() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(2000);
|
||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
||||
}
|
||||
public ItemThorHammer() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(2000);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/thorhammer");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/thorhammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||
double d = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
float f9 = f3 * f5;
|
||||
double d3 = 5000D;
|
||||
Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3);
|
||||
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemstack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
|
||||
} else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
|
||||
Entity entityhit = movingobjectposition.entityHit;
|
||||
double x = entityhit.posX;
|
||||
double y = entityhit.posY;
|
||||
double z = entityhit.posZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
|
||||
}
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack.damageItem(20, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||
double d = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
float f9 = f3 * f5;
|
||||
double d3 = 5000D;
|
||||
Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3);
|
||||
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true);
|
||||
if (movingobjectposition == null) {
|
||||
return itemstack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
|
||||
}
|
||||
else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
|
||||
Entity entityhit = movingobjectposition.entityHit;
|
||||
double x = entityhit.posX;
|
||||
double y = entityhit.posY;
|
||||
double z = entityhit.posZ;
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
|
||||
}
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
itemstack.damageItem(20, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
itemstack.damageItem(1, attacker);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
itemstack.damageItem(1, attacker);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
|
||||
}
|
||||
}
|
||||
@@ -23,52 +23,53 @@ import java.util.List;
|
||||
|
||||
public class ItemThorHammerBroken extends ItemSword implements IRepairable {
|
||||
|
||||
public ItemThorHammerBroken() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(1000);
|
||||
}
|
||||
public ItemThorHammerBroken() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(1000);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/taintedthorhammer");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/taintedthorhammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ));
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ));
|
||||
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack.damageItem(20, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
itemstack.damageItem(20, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 2F);
|
||||
itemstack.damageItem(1, attacker);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 2F);
|
||||
itemstack.damageItem(1, attacker);
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.thor"));
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.danger"));
|
||||
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick"));
|
||||
} else {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick"));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.thor"));
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.danger"));
|
||||
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick"));
|
||||
}
|
||||
else {
|
||||
list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+162
-163
@@ -31,187 +31,186 @@ import java.util.Locale;
|
||||
|
||||
public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||
|
||||
public int maxCharge = 40000;
|
||||
public int cost = 200;
|
||||
public int hitCost = 300;
|
||||
public int tier = 2;
|
||||
public static AudioSource audio;
|
||||
boolean dropped = false;
|
||||
public int maxCharge = 40000;
|
||||
public int cost = 200;
|
||||
public int hitCost = 300;
|
||||
public int tier = 2;
|
||||
public static AudioSource audio;
|
||||
boolean dropped = false;
|
||||
|
||||
public ItemDiamondChainsaw() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
public ItemDiamondChainsaw() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_diamond");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_diamond");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
||||
}
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
} else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
continue;
|
||||
}
|
||||
int oldMeta = torchStack.getItemDamage();
|
||||
int oldSize = torchStack.stackSize;
|
||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0) {
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
continue;
|
||||
}
|
||||
int oldMeta = torchStack.getItemDamage();
|
||||
int oldSize = torchStack.stackSize;
|
||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
}
|
||||
else if (torchStack.stackSize <= 0) {
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
||||
{
|
||||
if (audio != null) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
dropped = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
if(entity instanceof EntityLivingBase){
|
||||
if (IC2.platform.isRendering()) {
|
||||
if (flag && !dropped) {
|
||||
if (audio == null) audio = IC2.audioManager.createSource(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawIdle.ogg", true, false, IC2.audioManager.getDefaultVolume());
|
||||
if (audio != null) {
|
||||
audio.updatePosition();
|
||||
audio.play();
|
||||
}
|
||||
} else if (!flag && audio != null && ((((EntityPlayer)entity).inventory.getCurrentItem() != null && ((EntityPlayer)entity).inventory.getCurrentItem().getItem() != this) || (((EntityPlayer)entity).inventory.getCurrentItem() == null))) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
IC2.audioManager.playOnce(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawStop.ogg", true, IC2.audioManager.getDefaultVolume());
|
||||
}
|
||||
dropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) {
|
||||
if (audio != null) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
dropped = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
if (IC2.platform.isRendering()) {
|
||||
if (flag && !dropped) {
|
||||
if (audio == null)
|
||||
audio = IC2.audioManager.createSource(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawIdle.ogg", true, false, IC2.audioManager.getDefaultVolume());
|
||||
if (audio != null) {
|
||||
audio.updatePosition();
|
||||
audio.play();
|
||||
}
|
||||
}
|
||||
else if (!flag && audio != null && ((((EntityPlayer) entity).inventory.getCurrentItem() != null && ((EntityPlayer) entity).inventory.getCurrentItem().getItem() != this) || (((EntityPlayer) entity).inventory.getCurrentItem() == null))) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
IC2.audioManager.playOnce(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawStop.ogg", true, IC2.audioManager.getDefaultVolume());
|
||||
}
|
||||
dropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return tier;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 300;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 300;
|
||||
}
|
||||
}
|
||||
+97
-97
@@ -27,109 +27,109 @@ import java.util.ArrayList;
|
||||
|
||||
public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
||||
|
||||
boolean alternateServer;
|
||||
boolean alternateClient;
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static ArrayList oreDictLogs = new ArrayList();
|
||||
public static AudioSource audio;
|
||||
boolean alternateServer;
|
||||
boolean alternateClient;
|
||||
public static ArrayList oreDictLogs = new ArrayList();
|
||||
public static AudioSource audio;
|
||||
|
||||
public ItemStreamChainsaw() {
|
||||
this.efficiencyOnProperMaterial = 25F;
|
||||
alternateServer = false;
|
||||
alternateClient = false;
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(27);
|
||||
maxCharge = 900000;
|
||||
cost = 400;
|
||||
hitCost = 500;
|
||||
tier = 3;
|
||||
}
|
||||
public ItemStreamChainsaw() {
|
||||
this.efficiencyOnProperMaterial = 25F;
|
||||
alternateServer = false;
|
||||
alternateClient = false;
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(27);
|
||||
maxCharge = 900000;
|
||||
cost = 400;
|
||||
hitCost = 500;
|
||||
tier = 3;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_stream");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_stream");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack itemstack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack itemstack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z)) && ElectricItem.manager.getCharge(itemstack) > cost) {
|
||||
if (!world.isRemote) {
|
||||
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
|
||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
this.alternateServer = (!this.alternateServer);
|
||||
}
|
||||
} else {
|
||||
player.swingItem();
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
this.alternateClient = (!this.alternateClient);
|
||||
}
|
||||
}
|
||||
return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10);
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z)) && ElectricItem.manager.getCharge(itemstack) > cost) {
|
||||
if (!world.isRemote) {
|
||||
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
|
||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
this.alternateServer = (!this.alternateServer);
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.swingItem();
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
this.alternateClient = (!this.alternateClient);
|
||||
}
|
||||
}
|
||||
return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
if(entity instanceof EntityLivingBase){
|
||||
if (IC2.platform.isRendering()) {
|
||||
if (flag && !dropped) {
|
||||
if (audio == null) audio = IC2.audioManager.createSource(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawIdle.ogg", true, false, IC2.audioManager.getDefaultVolume());
|
||||
if (audio != null) {
|
||||
audio.updatePosition();
|
||||
audio.play();
|
||||
}
|
||||
} else if (!flag && audio != null && ((((EntityPlayer)entity).inventory.getCurrentItem() != null && ((EntityPlayer)entity).inventory.getCurrentItem().getItem() != this) || (((EntityPlayer)entity).inventory.getCurrentItem() == null))) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
IC2.audioManager.playOnce(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawStop.ogg", true, IC2.audioManager.getDefaultVolume());
|
||||
}
|
||||
dropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
||||
{
|
||||
if(audio != null){
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
dropped = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
if (IC2.platform.isRendering()) {
|
||||
if (flag && !dropped) {
|
||||
if (audio == null)
|
||||
audio = IC2.audioManager.createSource(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawIdle.ogg", true, false, IC2.audioManager.getDefaultVolume());
|
||||
if (audio != null) {
|
||||
audio.updatePosition();
|
||||
audio.play();
|
||||
}
|
||||
}
|
||||
else if (!flag && audio != null && ((((EntityPlayer) entity).inventory.getCurrentItem() != null && ((EntityPlayer) entity).inventory.getCurrentItem().getItem() != this) || (((EntityPlayer) entity).inventory.getCurrentItem() == null))) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
IC2.audioManager.playOnce(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawStop.ogg", true, IC2.audioManager.getDefaultVolume());
|
||||
}
|
||||
dropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
||||
if (!world.isRemote) {
|
||||
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
|
||||
@Override
|
||||
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) {
|
||||
if (audio != null) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
dropped = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||
}
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
return true;
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, x, y, z, player);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
||||
if (!world.isRemote) {
|
||||
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 900;
|
||||
}
|
||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||
}
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
return true;
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, x, y, z, player);
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 900;
|
||||
}
|
||||
}
|
||||
+65
-65
@@ -20,73 +20,73 @@ import tombenpotter.emt.ModInformation;
|
||||
public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
||||
public static AudioSource audio;
|
||||
|
||||
public ItemThaumiumChainsaw() {
|
||||
this.efficiencyOnProperMaterial = 21F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
maxCharge = 60000;
|
||||
cost = 250;
|
||||
hitCost = 350;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
if(entity instanceof EntityLivingBase){
|
||||
if (IC2.platform.isRendering()) {
|
||||
if (flag && !dropped) {
|
||||
if (audio == null) audio = IC2.audioManager.createSource(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawIdle.ogg", true, false, IC2.audioManager.getDefaultVolume());
|
||||
if (audio != null) {
|
||||
audio.updatePosition();
|
||||
audio.play();
|
||||
}
|
||||
} else if (!flag && audio != null && ((((EntityPlayer)entity).inventory.getCurrentItem() != null && ((EntityPlayer)entity).inventory.getCurrentItem().getItem() != this) || (((EntityPlayer)entity).inventory.getCurrentItem() == null))) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
IC2.audioManager.playOnce(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawStop.ogg", true, IC2.audioManager.getDefaultVolume());
|
||||
}
|
||||
dropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
||||
{
|
||||
if (audio != null) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
dropped = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public ItemThaumiumChainsaw() {
|
||||
this.efficiencyOnProperMaterial = 21F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
maxCharge = 60000;
|
||||
cost = 250;
|
||||
hitCost = 350;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_thaumium");
|
||||
}
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
if (IC2.platform.isRendering()) {
|
||||
if (flag && !dropped) {
|
||||
if (audio == null)
|
||||
audio = IC2.audioManager.createSource(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawIdle.ogg", true, false, IC2.audioManager.getDefaultVolume());
|
||||
if (audio != null) {
|
||||
audio.updatePosition();
|
||||
audio.play();
|
||||
}
|
||||
}
|
||||
else if (!flag && audio != null && ((((EntityPlayer) entity).inventory.getCurrentItem() != null && ((EntityPlayer) entity).inventory.getCurrentItem().getItem() != this) || (((EntityPlayer) entity).inventory.getCurrentItem() == null))) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
IC2.audioManager.playOnce(entity, PositionSpec.Hand, "Tools/Chainsaw/ChainsawStop.ogg", true, IC2.audioManager.getDefaultVolume());
|
||||
}
|
||||
dropped = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) {
|
||||
if (audio != null) {
|
||||
audio.stop();
|
||||
audio.remove();
|
||||
audio = null;
|
||||
dropped = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/chainsaw_thaumium");
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 600;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 600;
|
||||
}
|
||||
}
|
||||
+156
-150
@@ -35,163 +35,169 @@ import java.util.Locale;
|
||||
|
||||
public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
|
||||
private static final Block[] isEffective = {Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone};
|
||||
public Icon icon;
|
||||
int side;
|
||||
public int searchCost = 1000;
|
||||
public int hitCost = 400;
|
||||
private static final Block[] isEffective = { Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone,
|
||||
Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone };
|
||||
public Icon icon;
|
||||
int side;
|
||||
public int searchCost = 1000;
|
||||
public int hitCost = 400;
|
||||
|
||||
public ItemRockbreakerDrill() {
|
||||
side = 0;
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.efficiencyOnProperMaterial = 25F;
|
||||
this.setMaxStackSize(1);
|
||||
if (ConfigHandler.toolsInBore == false) {
|
||||
this.setMaxDamage(27);
|
||||
} else {
|
||||
this.setMaxDamage(2571);
|
||||
}
|
||||
maxCharge = 900000;
|
||||
transferLimit = 900;
|
||||
tier = 3;
|
||||
}
|
||||
public ItemRockbreakerDrill() {
|
||||
side = 0;
|
||||
setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.efficiencyOnProperMaterial = 25F;
|
||||
this.setMaxStackSize(1);
|
||||
if (ConfigHandler.toolsInBore == false) {
|
||||
this.setMaxDamage(27);
|
||||
}
|
||||
else {
|
||||
this.setMaxDamage(2571);
|
||||
}
|
||||
maxCharge = 900000;
|
||||
transferLimit = 900;
|
||||
tier = 3;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/drill_rockbreaker");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/drill_rockbreaker");
|
||||
}
|
||||
|
||||
private boolean isEffectiveAgainst(Block block) {
|
||||
for (int var3 = 0; var3 < isEffective.length; var3++) {
|
||||
if (isEffective[var3] == block) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private boolean isEffectiveAgainst(Block block) {
|
||||
for (int var3 = 0; var3 < isEffective.length; var3++) {
|
||||
if (isEffective[var3] == block) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
|
||||
MovingObjectPosition movingobjectposition = BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true);
|
||||
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||
side = movingobjectposition.sideHit;
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
|
||||
MovingObjectPosition movingobjectposition = BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true);
|
||||
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
|
||||
side = movingobjectposition.sideHit;
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
|
||||
if (ConfigHandler.toolsInBore == false) {
|
||||
cost = 350;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
if (entityLiving.isSneaking()) {
|
||||
if (ElectricItem.manager.canUse(stack, cost)) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int md = world.getBlockMetadata(x, y, z);
|
||||
if (ForgeHooks.isToolEffective(stack, block, md) || isEffectiveAgainst(block)) {
|
||||
for (int aa = -1; aa <= 1; aa++) {
|
||||
for (int bb = -1; bb <= 1; bb++) {
|
||||
int xx = 0;
|
||||
int yy = 0;
|
||||
int zz = 0;
|
||||
if (side <= 1) {
|
||||
xx = aa;
|
||||
zz = bb;
|
||||
} else if (side <= 3) {
|
||||
xx = aa;
|
||||
yy = bb;
|
||||
} else {
|
||||
zz = aa;
|
||||
yy = bb;
|
||||
}
|
||||
Block bl = world.getBlock(x + xx, y + yy, z + zz);
|
||||
md = world.getBlockMetadata(x + xx, y + yy, z + zz);
|
||||
if (!ForgeHooks.isToolEffective(stack, bl, md) && !isEffectiveAgainst(bl)) {
|
||||
continue;
|
||||
}
|
||||
if (ElectricItem.manager.canUse(stack, cost)) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
}
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
|
||||
world.setBlockToAir(x + xx, y + yy, z + zz);
|
||||
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
|
||||
boolean creative = false;
|
||||
if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
|
||||
creative = true;
|
||||
}
|
||||
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
|
||||
continue;
|
||||
}
|
||||
ItemStack is;
|
||||
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) {
|
||||
is = (ItemStack) i$.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
|
||||
if (ConfigHandler.toolsInBore == false) {
|
||||
cost = 350;
|
||||
}
|
||||
else {
|
||||
cost = 1;
|
||||
}
|
||||
if (entityLiving.isSneaking()) {
|
||||
if (ElectricItem.manager.canUse(stack, cost)) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int md = world.getBlockMetadata(x, y, z);
|
||||
if (ForgeHooks.isToolEffective(stack, block, md) || isEffectiveAgainst(block)) {
|
||||
for (int aa = -1; aa <= 1; aa++) {
|
||||
for (int bb = -1; bb <= 1; bb++) {
|
||||
int xx = 0;
|
||||
int yy = 0;
|
||||
int zz = 0;
|
||||
if (side <= 1) {
|
||||
xx = aa;
|
||||
zz = bb;
|
||||
}
|
||||
else if (side <= 3) {
|
||||
xx = aa;
|
||||
yy = bb;
|
||||
}
|
||||
else {
|
||||
zz = aa;
|
||||
yy = bb;
|
||||
}
|
||||
Block bl = world.getBlock(x + xx, y + yy, z + zz);
|
||||
md = world.getBlockMetadata(x + xx, y + yy, z + zz);
|
||||
if (!ForgeHooks.isToolEffective(stack, bl, md) && !isEffectiveAgainst(bl)) {
|
||||
continue;
|
||||
}
|
||||
if (ElectricItem.manager.canUse(stack, cost)) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
}
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
|
||||
world.setBlockToAir(x + xx, y + yy, z + zz);
|
||||
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
|
||||
boolean creative = false;
|
||||
if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
|
||||
creative = true;
|
||||
}
|
||||
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
|
||||
continue;
|
||||
}
|
||||
ItemStack is;
|
||||
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) {
|
||||
is = (ItemStack) i$.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
if (!player.isSneaking()) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
continue;
|
||||
}
|
||||
int oldMeta = torchStack.getItemDamage();
|
||||
int oldSize = torchStack.stackSize;
|
||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0) {
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ElectricItem.manager.use(stack, searchCost, player);
|
||||
if (!world.isRemote) {
|
||||
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
|
||||
player.swingItem();
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
if (!player.isSneaking()) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
continue;
|
||||
}
|
||||
int oldMeta = torchStack.getItemDamage();
|
||||
int oldSize = torchStack.stackSize;
|
||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
}
|
||||
else if (torchStack.stackSize <= 0) {
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ElectricItem.manager.use(stack, searchCost, player);
|
||||
if (!world.isRemote) {
|
||||
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
|
||||
player.swingItem();
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
|
||||
entity.setFire(2);
|
||||
}
|
||||
return super.onLeftClickEntity(stack, player, entity);
|
||||
}
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
|
||||
entity.setFire(2);
|
||||
}
|
||||
return super.onLeftClickEntity(stack, player, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,6 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/drill_thaumium");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
@@ -117,10 +116,6 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
|
||||
|
||||
+42
-40
@@ -16,48 +16,50 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
|
||||
|
||||
public ItemOmnitoolDiamond() {
|
||||
super();
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
this.setMaxDamage(27);
|
||||
} else {
|
||||
this.setMaxDamage(350);
|
||||
}
|
||||
maxCharge = 70000;
|
||||
hitCost = 250;
|
||||
}
|
||||
public ItemOmnitoolDiamond() {
|
||||
super();
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
this.setMaxDamage(27);
|
||||
}
|
||||
else {
|
||||
this.setMaxDamage(350);
|
||||
}
|
||||
maxCharge = 70000;
|
||||
hitCost = 250;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_diamond");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_diamond");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
cost = 200;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
cost = 200;
|
||||
}
|
||||
else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 400;
|
||||
}
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
+137
-137
@@ -26,162 +26,162 @@ import java.util.Locale;
|
||||
|
||||
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
||||
|
||||
public int maxCharge = 20000;
|
||||
public int cost;
|
||||
public int hitCost = 125;
|
||||
public int maxCharge = 20000;
|
||||
public int cost;
|
||||
public int hitCost = 125;
|
||||
|
||||
public ItemOmnitoolIron() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.efficiencyOnProperMaterial = 13F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
this.setMaxDamage(27);
|
||||
} else {
|
||||
this.setMaxDamage(200);
|
||||
}
|
||||
}
|
||||
public ItemOmnitoolIron() {
|
||||
super(ToolMaterial.EMERALD);
|
||||
this.efficiencyOnProperMaterial = 13F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
this.setMaxDamage(27);
|
||||
}
|
||||
else {
|
||||
this.setMaxDamage(200);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_iron");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_iron");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
|
||||
|
||||
{
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
cost = 100;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
{
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
cost = 100;
|
||||
}
|
||||
else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
||||
}
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
} else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
continue;
|
||||
}
|
||||
int oldMeta = torchStack.getItemDamage();
|
||||
int oldSize = torchStack.stackSize;
|
||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0) {
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
continue;
|
||||
}
|
||||
int oldMeta = torchStack.getItemDamage();
|
||||
int oldSize = torchStack.stackSize;
|
||||
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
}
|
||||
else if (torchStack.stackSize <= 0) {
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (!ConfigHandler.enchanting) {
|
||||
return 0;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (!ConfigHandler.enchanting) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
/* IC2 API METHODS */
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
@Override
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 200;
|
||||
}
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
+42
-40
@@ -16,48 +16,50 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
|
||||
|
||||
public ItemOmnitoolThaumium() {
|
||||
super();
|
||||
this.efficiencyOnProperMaterial = 21F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
this.setMaxDamage(27);
|
||||
} else {
|
||||
this.setMaxDamage(467);
|
||||
}
|
||||
maxCharge = 140000;
|
||||
hitCost = 650;
|
||||
}
|
||||
public ItemOmnitoolThaumium() {
|
||||
super();
|
||||
this.efficiencyOnProperMaterial = 21F;
|
||||
this.setCreativeTab(ElectroMagicTools.tabEMT);
|
||||
this.setMaxStackSize(1);
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
this.setMaxDamage(27);
|
||||
}
|
||||
else {
|
||||
this.setMaxDamage(467);
|
||||
}
|
||||
maxCharge = 140000;
|
||||
hitCost = 650;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_thaumium");
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":tools/omnitool_thaumium");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
cost = 300;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
if (!ConfigHandler.toolsInBore) {
|
||||
cost = 300;
|
||||
}
|
||||
else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 800;
|
||||
}
|
||||
/* IC2 API METHODS */
|
||||
@Override
|
||||
public double getTransferLimit(ItemStack itemStack) {
|
||||
return 800;
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,11 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
|
||||
public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, IMessage>{
|
||||
public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketEMTKeys message, MessageContext ctx) {
|
||||
if(ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == ItemRegistry.quantumArmor){
|
||||
if (ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == ItemRegistry.quantumArmor) {
|
||||
ctx.getServerHandler().playerEntity.inventory.armorInventory[2].stackTagCompound.setBoolean("unequip", true);
|
||||
}
|
||||
return null;
|
||||
@@ -20,7 +20,7 @@ public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, I
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,45 +8,45 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public abstract class TileEntityEMT extends TileEntity {
|
||||
|
||||
public int facing;
|
||||
public boolean isOn;
|
||||
public int facing;
|
||||
public boolean isOn;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
|
||||
facing = tagCompound.getInteger("facing");
|
||||
isOn = tagCompound.getBoolean("isOn");
|
||||
}
|
||||
facing = tagCompound.getInteger("facing");
|
||||
isOn = tagCompound.getBoolean("isOn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
|
||||
tagCompound.setInteger("facing", facing);
|
||||
tagCompound.setBoolean("isOn", isOn);
|
||||
}
|
||||
tagCompound.setInteger("facing", facing);
|
||||
tagCompound.setBoolean("isOn", isOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeToNBT(nbt);
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt);
|
||||
return packet;
|
||||
}
|
||||
@Override
|
||||
public final Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeToNBT(nbt);
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt);
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
@@ -19,272 +19,285 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityEtherealMacerator extends TileEntityEMT implements ISidedInventory, IWrenchable {
|
||||
|
||||
private static final int[] slots_top = new int[]{0};
|
||||
private static final int[] slots_bottom = new int[]{2, 1};
|
||||
private static final int[] slots_sides = new int[]{1};
|
||||
private static final int[] slots_top = new int[] { 0 };
|
||||
private static final int[] slots_bottom = new int[] { 2, 1 };
|
||||
private static final int[] slots_sides = new int[] { 1 };
|
||||
|
||||
private ItemStack[] slots = new ItemStack[3];
|
||||
public int maceratingSpeed = ConfigHandler.etherealProcessorBaseSpeed;
|
||||
public int cookTime;
|
||||
private ItemStack[] slots = new ItemStack[3];
|
||||
public int maceratingSpeed = ConfigHandler.etherealProcessorBaseSpeed;
|
||||
public int cookTime;
|
||||
|
||||
public int getSizeInventory() {
|
||||
return this.slots.length;
|
||||
}
|
||||
public int getSizeInventory() {
|
||||
return this.slots.length;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.slots[par1];
|
||||
}
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.slots[par1];
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack;
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack;
|
||||
|
||||
if (this.slots[par1].stackSize <= par2) {
|
||||
itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack = this.slots[par1].splitStack(par2);
|
||||
if (this.slots[par1].stackSize <= par2) {
|
||||
itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
itemstack = this.slots[par1].splitStack(par2);
|
||||
|
||||
if (this.slots[par1].stackSize == 0) {
|
||||
this.slots[par1] = null;
|
||||
}
|
||||
if (this.slots[par1].stackSize == 0) {
|
||||
this.slots[par1] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.slots[par1] != null) {
|
||||
ItemStack itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.slots[par1] = par2ItemStack;
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.slots[par1] = par2ItemStack;
|
||||
|
||||
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) {
|
||||
par2ItemStack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) {
|
||||
par2ItemStack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public String getInvName() {
|
||||
return "Ethereal Processor";
|
||||
}
|
||||
public String getInvName() {
|
||||
return "Ethereal Processor";
|
||||
}
|
||||
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
NBTTagList nbttaglist = tagCompound.getTagList("Items", 10);
|
||||
this.slots = new ItemStack[this.getSizeInventory()];
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
NBTTagList nbttaglist = tagCompound.getTagList("Items", 10);
|
||||
this.slots = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.slots.length) {
|
||||
this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
this.cookTime = tagCompound.getShort("CookTime");
|
||||
}
|
||||
if (b0 >= 0 && b0 < this.slots.length) {
|
||||
this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
this.cookTime = tagCompound.getShort("CookTime");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setShort("CookTime", (short) this.cookTime);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setShort("CookTime", (short) this.cookTime);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.slots.length; ++i) {
|
||||
if (this.slots[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.slots[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
tagCompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
for (int i = 0; i < this.slots.length; ++i) {
|
||||
if (this.slots[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.slots[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
tagCompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) {
|
||||
++this.cookTime;
|
||||
this.isOn = true;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
public void updateEntity() {
|
||||
if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) {
|
||||
++this.cookTime;
|
||||
this.isOn = true;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
if (this.cookTime == this.maceratingSpeed) {
|
||||
this.cookTime = 0;
|
||||
this.smeltItem();
|
||||
}
|
||||
} else {
|
||||
this.cookTime = 0;
|
||||
this.isOn = false;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
if (this.cookTime == this.maceratingSpeed) {
|
||||
this.cookTime = 0;
|
||||
this.smeltItem();
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.cookTime = 0;
|
||||
this.isOn = false;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canSmelt() {
|
||||
if (this.slots[0] == null) {
|
||||
return false;
|
||||
} else {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if (itemstack == null)
|
||||
return false;
|
||||
if (this.slots[2] == null)
|
||||
return true;
|
||||
if (!this.slots[2].isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = slots[2].stackSize + (itemstack.stackSize * 2);
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
private boolean canSmelt() {
|
||||
if (this.slots[0] == null) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if (itemstack == null)
|
||||
return false;
|
||||
if (this.slots[2] == null)
|
||||
return true;
|
||||
if (!this.slots[2].isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = slots[2].stackSize + (itemstack.stackSize * 2);
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
|
||||
public void smeltItem() {
|
||||
if (this.canSmelt()) {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
public void smeltItem() {
|
||||
if (this.canSmelt()) {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
|
||||
if (this.slots[2] == null) {
|
||||
this.slots[2] = itemstack.copy();
|
||||
this.slots[2].stackSize *= 2;
|
||||
} else if (this.slots[2].isItemEqual(itemstack)) {
|
||||
slots[2].stackSize += (itemstack.stackSize * 2);
|
||||
}
|
||||
if (this.slots[2] == null) {
|
||||
this.slots[2] = itemstack.copy();
|
||||
this.slots[2].stackSize *= 2;
|
||||
}
|
||||
else if (this.slots[2].isItemEqual(itemstack)) {
|
||||
slots[2].stackSize += (itemstack.stackSize * 2);
|
||||
}
|
||||
|
||||
--this.slots[0].stackSize;
|
||||
--this.slots[0].stackSize;
|
||||
|
||||
if (this.slots[0].stackSize <= 0) {
|
||||
this.slots[0] = null;
|
||||
}
|
||||
this.addBonus();
|
||||
}
|
||||
}
|
||||
if (this.slots[0].stackSize <= 0) {
|
||||
this.slots[0] = null;
|
||||
}
|
||||
this.addBonus();
|
||||
}
|
||||
}
|
||||
|
||||
public void addBonus() {
|
||||
if (this.canSmelt()) {
|
||||
if (this.worldObj.rand.nextInt(ConfigHandler.etherealProcessorBonus) == 0) {
|
||||
if (this.slots[1] == null) {
|
||||
this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6));
|
||||
} else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) {
|
||||
slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void addBonus() {
|
||||
if (this.canSmelt()) {
|
||||
if (this.worldObj.rand.nextInt(ConfigHandler.etherealProcessorBonus) == 0) {
|
||||
if (this.slots[1] == null) {
|
||||
this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6));
|
||||
}
|
||||
else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) {
|
||||
slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D;
|
||||
}
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
public void openChest() {
|
||||
}
|
||||
public void openChest() {
|
||||
}
|
||||
|
||||
public void closeChest() {
|
||||
}
|
||||
public void closeChest() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if (slot != 0)
|
||||
return false;
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(stack) != null)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if (slot != 0)
|
||||
return false;
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(stack) != null)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public int[] getAccessibleSlotsFromSide(int par1) {
|
||||
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
||||
}
|
||||
public int[] getAccessibleSlotsFromSide(int par1) {
|
||||
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
||||
}
|
||||
|
||||
public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return this.isItemValidForSlot(par1, par2ItemStack);
|
||||
}
|
||||
public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return this.isItemValidForSlot(par1, par2ItemStack);
|
||||
}
|
||||
|
||||
public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return true;
|
||||
}
|
||||
public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isOverLimit(int i) {
|
||||
if (slots[i] != null) {
|
||||
if (slots[i].stackSize >= 63)
|
||||
return true;
|
||||
else if (slots[i].stackSize < 63)
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public boolean isOverLimit(int i) {
|
||||
if (slots[i] != null) {
|
||||
if (slots[i].stackSize >= 63)
|
||||
return true;
|
||||
else if (slots[i].stackSize < 63)
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOP() {
|
||||
final int cobblestoneId = OreDictionary.getOreID("blockCobble");
|
||||
public boolean isOP() {
|
||||
final int cobblestoneId = OreDictionary.getOreID("blockCobble");
|
||||
|
||||
if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish || this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem() || (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish
|
||||
|| this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem()
|
||||
|| (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm")
|
||||
|| this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick")
|
||||
|| this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtMachines, 1, 1);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtMachines, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Ethereal Macerator";
|
||||
}
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Ethereal Macerator";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
@Override
|
||||
public void openInventory() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+135
-132
@@ -13,165 +13,168 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements IInventory {
|
||||
|
||||
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
|
||||
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
|
||||
|
||||
ItemStack ItemStacks[];
|
||||
ItemStack ItemStacks[];
|
||||
|
||||
public TileEntityIndustrialWandRecharge() {
|
||||
ItemStacks = new ItemStack[1];
|
||||
}
|
||||
public TileEntityIndustrialWandRecharge() {
|
||||
ItemStacks = new ItemStack[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return ItemStacks[i];
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return ItemStacks[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (ItemStacks[i] != null) {
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (ItemStacks[i] != null) {
|
||||
|
||||
if (ItemStacks[i].stackSize <= j) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
ItemStack itemstack1 = ItemStacks[i].splitStack(j);
|
||||
if (ItemStacks[i].stackSize <= j) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
ItemStack itemstack1 = ItemStacks[i].splitStack(j);
|
||||
|
||||
if (ItemStacks[i].stackSize == 0) {
|
||||
ItemStacks[i] = null;
|
||||
}
|
||||
if (ItemStacks[i].stackSize == 0) {
|
||||
ItemStacks[i] = null;
|
||||
}
|
||||
|
||||
return itemstack1;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return itemstack1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if (ItemStacks[i] != null) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if (ItemStacks[i] != null) {
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ic2EnergySink.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (getStackInSlot(0) != null) {
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ic2EnergySink.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (getStackInSlot(0) != null) {
|
||||
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
|
||||
if (ic2EnergySink.useEnergy(ConfigHandler.wandChargerConsumption) && wandItem.getAspectsWithRoom(wand) != null) {
|
||||
wandItem.addVis(wand, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
|
||||
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
|
||||
if (ic2EnergySink.useEnergy(ConfigHandler.wandChargerConsumption) && wandItem.getAspectsWithRoom(wand) != null) {
|
||||
wandItem.addVis(wand, Aspect.ORDER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.FIRE, 1, true);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
ItemStacks[i] = itemstack;
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
ItemStacks[i] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_) {
|
||||
super.readFromNBT(p_145839_1_);
|
||||
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
|
||||
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_) {
|
||||
super.readFromNBT(p_145839_1_);
|
||||
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
|
||||
this.ItemStacks = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length) {
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (b0 >= 0 && b0 < this.ItemStacks.length) {
|
||||
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_) {
|
||||
super.writeToNBT(p_145841_1_);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_) {
|
||||
super.writeToNBT(p_145841_1_);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i) {
|
||||
if (this.ItemStacks[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < this.ItemStacks.length; ++i) {
|
||||
if (this.ItemStacks[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.ItemStacks[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
p_145841_1_.setTag("Items", nbttaglist);
|
||||
}
|
||||
p_145841_1_.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D;
|
||||
}
|
||||
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
ic2EnergySink.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
@Override
|
||||
public void invalidate() {
|
||||
ic2EnergySink.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
ic2EnergySink.onChunkUnload();
|
||||
}
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
ic2EnergySink.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Industrial Wand Charging Station";
|
||||
}
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Industrial Wand Charging Station";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
}
|
||||
@@ -6,17 +6,17 @@ import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
public class TileEntityPortableNode extends TileNode {
|
||||
|
||||
public TileEntityPortableNode() {
|
||||
super();
|
||||
}
|
||||
public TileEntityPortableNode() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NodeModifier getNodeModifier() {
|
||||
return NodeModifier.FADING;
|
||||
}
|
||||
@Override
|
||||
public NodeModifier getNodeModifier() {
|
||||
return NodeModifier.FADING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NodeType getNodeType() {
|
||||
return NodeType.UNSTABLE;
|
||||
}
|
||||
@Override
|
||||
public NodeType getNodeType() {
|
||||
return NodeType.UNSTABLE;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import tombenpotter.emt.common.util.EssentiasOutputs;
|
||||
|
||||
public class TileEntityAerGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityAerGenerator() {
|
||||
aspect = Aspect.AIR;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.aerGenerator;
|
||||
}
|
||||
public TileEntityAerGenerator() {
|
||||
aspect = Aspect.AIR;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.aerGenerator;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import tombenpotter.emt.common.util.EssentiasOutputs;
|
||||
|
||||
public class TileEntityArborGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityArborGenerator() {
|
||||
aspect = Aspect.TREE;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.arborGenerator;
|
||||
}
|
||||
public TileEntityArborGenerator() {
|
||||
aspect = Aspect.TREE;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.arborGenerator;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import tombenpotter.emt.common.util.EssentiasOutputs;
|
||||
|
||||
public class TileEntityAuramGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityAuramGenerator() {
|
||||
aspect = Aspect.AURA;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.auramGenerator;
|
||||
}
|
||||
public TileEntityAuramGenerator() {
|
||||
aspect = Aspect.AURA;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.auramGenerator;
|
||||
}
|
||||
}
|
||||
+46
-46
@@ -10,57 +10,57 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public abstract class TileEntityBaseGenerator extends TileEntityEMT {
|
||||
|
||||
public BasicSource energySource = new BasicSource(this, 1000000000, 3);
|
||||
public Aspect aspect;
|
||||
public int output;
|
||||
public int tick = 0;
|
||||
public BasicSource energySource = new BasicSource(this, 1000000000, 3);
|
||||
public Aspect aspect;
|
||||
public int output;
|
||||
public int tick = 0;
|
||||
|
||||
public TileEntityBaseGenerator() {
|
||||
output = 20;
|
||||
}
|
||||
public TileEntityBaseGenerator() {
|
||||
output = 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(tick > 0)
|
||||
tick--;
|
||||
|
||||
if(tick == 0){
|
||||
energySource.updateEntity();
|
||||
createEnergy();
|
||||
tick = 20;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (tick > 0)
|
||||
tick--;
|
||||
|
||||
public void createEnergy() {
|
||||
if (!this.worldObj.isRemote && EssentiaHandler.drainEssentia(this, aspect, ForgeDirection.UNKNOWN, 8)) {
|
||||
energySource.addEnergy(output * 20);
|
||||
}
|
||||
}
|
||||
if (tick == 0) {
|
||||
energySource.updateEntity();
|
||||
createEnergy();
|
||||
tick = 20;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
public void createEnergy() {
|
||||
if (!this.worldObj.isRemote && EssentiaHandler.drainEssentia(this, aspect, ForgeDirection.UNKNOWN, 8)) {
|
||||
energySource.addEnergy(output * 20);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
energySource.readFromNBT(tag);
|
||||
}
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
energySource.writeToNBT(tag);
|
||||
}
|
||||
|
||||
public int getOutput(){
|
||||
return output;
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
energySource.readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
energySource.writeToNBT(tag);
|
||||
}
|
||||
|
||||
public int getOutput() {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import tombenpotter.emt.common.util.EssentiasOutputs;
|
||||
|
||||
public class TileEntityIgnisGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityIgnisGenerator() {
|
||||
aspect = Aspect.FIRE;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.ignisGenerator;
|
||||
}
|
||||
public TileEntityIgnisGenerator() {
|
||||
aspect = Aspect.FIRE;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.ignisGenerator;
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -7,9 +7,9 @@ import tombenpotter.emt.common.util.EssentiasOutputs;
|
||||
|
||||
public class TileEntityPotentiaGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityPotentiaGenerator() {
|
||||
aspect = Aspect.ENERGY;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.potentiaGenerator;
|
||||
}
|
||||
public TileEntityPotentiaGenerator() {
|
||||
aspect = Aspect.ENERGY;
|
||||
EssentiasOutputs.outputs.get(aspect.getTag());
|
||||
output = ConfigHandler.potentiaGenerator;
|
||||
}
|
||||
}
|
||||
@@ -10,96 +10,96 @@ import java.util.Random;
|
||||
|
||||
public abstract class TileEntitySolarBase extends TileEntityEMT implements IWrenchable {
|
||||
|
||||
public BasicSource energySource= new BasicSource(this, 10000, 4);
|
||||
public static Random random = new Random();
|
||||
public boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
public boolean canRain;
|
||||
public boolean noSunlight;
|
||||
public int tick;
|
||||
public double output = 0;
|
||||
public BasicSource energySource = new BasicSource(this, 10000, 4);
|
||||
public static Random random = new Random();
|
||||
public boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
public boolean canRain;
|
||||
public boolean noSunlight;
|
||||
public int tick;
|
||||
public double output = 0;
|
||||
|
||||
public TileEntitySolarBase() {
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
public TileEntitySolarBase() {
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
checkConditions();
|
||||
}
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
checkConditions();
|
||||
}
|
||||
|
||||
public void checkConditions() {
|
||||
if (!initialized && worldObj != null) {
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight) {
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
createEnergy();
|
||||
}
|
||||
public void checkConditions() {
|
||||
if (!initialized && worldObj != null) {
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight) {
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
createEnergy();
|
||||
}
|
||||
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
public void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
}
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -9,21 +9,22 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityAirSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityAirSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
public TileEntityAirSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible && this.yCoord >= 160) {
|
||||
energySource.addEnergy(output * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible && this.yCoord >= 160) {
|
||||
energySource.addEnergy(output * 2.5);
|
||||
}
|
||||
else if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 15);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 15);
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleAirSolar extends TileEntityAirSolar {
|
||||
|
||||
public TileEntityDoubleAirSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleAirSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 0);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 0);
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityTripleAirSolar extends TileEntityAirSolar {
|
||||
|
||||
public TileEntityTripleAirSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityTripleAirSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 1);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 1);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -8,12 +8,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityCompressedSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
public TileEntityCompressedSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 0);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 0);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -8,12 +8,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityDoubleCompressedSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleCompressedSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 1);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 1);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -8,12 +8,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityTripleCompressedSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityTripleCompressedSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityTripleCompressedSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 2);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 2);
|
||||
}
|
||||
}
|
||||
@@ -8,19 +8,19 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDarkSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityDarkSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
public TileEntityDarkSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !worldObj.isDaytime() && !worldObj.isRaining() && !worldObj.isThundering()) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !worldObj.isDaytime() && !worldObj.isRaining() && !worldObj.isThundering()) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 6);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 6);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleDarkSolar extends TileEntityDarkSolar {
|
||||
|
||||
public TileEntityDoubleDarkSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleDarkSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 7);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 7);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityTripleDarkSolar extends TileEntityDarkSolar {
|
||||
|
||||
public TileEntityTripleDarkSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityTripleDarkSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 8);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 8);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleEarthSolar extends TileEntityEarthSolar {
|
||||
|
||||
public TileEntityDoubleEarthSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleEarthSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 3);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 3);
|
||||
}
|
||||
}
|
||||
@@ -8,21 +8,22 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityEarthSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityEarthSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
public TileEntityEarthSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible && this.yCoord <= 10) {
|
||||
energySource.addEnergy(output * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible && this.yCoord <= 10) {
|
||||
energySource.addEnergy(output * 2.5);
|
||||
}
|
||||
else if (theSunIsVisible) {
|
||||
energySource.addEnergy(output);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 2);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 2);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityTripleEarthSolar extends TileEntityEarthSolar {
|
||||
|
||||
public TileEntityTripleEarthSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityTripleEarthSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 4);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 4);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleFireSolar extends TileEntityFireSolar {
|
||||
|
||||
public TileEntityDoubleFireSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleFireSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 13);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 13);
|
||||
}
|
||||
}
|
||||
@@ -8,29 +8,30 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityFireSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityFireSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
public TileEntityFireSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConditions() {
|
||||
if (!initialized && worldObj != null) {
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
initialized = true;
|
||||
}
|
||||
@Override
|
||||
public void checkConditions() {
|
||||
if (!initialized && worldObj != null) {
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
if (worldObj.provider.dimensionId == -1) {
|
||||
energySource.addEnergy(output * 2);
|
||||
} else {
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (worldObj.provider.dimensionId == -1) {
|
||||
energySource.addEnergy(output * 2);
|
||||
}
|
||||
else {
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 12);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 12);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityTripleFireSolar extends TileEntityFireSolar {
|
||||
|
||||
public TileEntityTripleFireSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityTripleFireSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 14);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 14);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleOrderSolar extends TileEntityOrderSolar {
|
||||
|
||||
public TileEntityDoubleOrderSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleOrderSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 10);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 10);
|
||||
}
|
||||
}
|
||||
@@ -8,19 +8,19 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityOrderSolar extends TileEntitySolarBase {
|
||||
|
||||
public TileEntityOrderSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
public TileEntityOrderSolar() {
|
||||
output = ConfigHandler.compressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(output * 3);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void createEnergy() {
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(output * 3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 9);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 9);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityTripleOrderSolar extends TileEntityOrderSolar {
|
||||
|
||||
public TileEntityTripleOrderSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityTripleOrderSolar() {
|
||||
output = ConfigHandler.tripleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 11);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 11);
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -7,12 +7,12 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
public class TileEntityDoubleWaterSolar extends TileEntityWaterSolar {
|
||||
|
||||
public TileEntityDoubleWaterSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
public TileEntityDoubleWaterSolar() {
|
||||
output = ConfigHandler.doubleCompressedSolarOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 4);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 4);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 129 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user