mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
redcoil fix, no more shredding of blocks with the "Any" prefix, GUIs
This commit is contained in:
parent
f5c17f8bd7
commit
9528ce8afe
@ -46,6 +46,8 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
if(name == null || name.isEmpty())
|
||||
continue;
|
||||
|
||||
if(name.contains("Any")) continue;
|
||||
|
||||
List<ItemStack> matches = OreDictionary.getOres(name);
|
||||
|
||||
//if the name isn't assigned to an ore, also skip
|
||||
@ -94,10 +96,6 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
|
||||
String matName = name.substring(len);
|
||||
|
||||
//skip over genericized names so we don't accidentally convert item groups
|
||||
if(matName.startsWith("Any"))
|
||||
return;
|
||||
|
||||
ItemStack dust = getDustByName(matName);
|
||||
|
||||
if(dust != null && dust.getItem() != ModItems.scrap) {
|
||||
|
||||
@ -4410,7 +4410,7 @@ public class ModItems {
|
||||
fuse = new ItemCustomLore().setUnlocalizedName("fuse").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":fuse");
|
||||
redcoil_capacitor = new ItemCapacitor(10).setUnlocalizedName("redcoil_capacitor").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":redcoil_capacitor");
|
||||
euphemium_capacitor = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("euphemium_capacitor").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":redcoil_capacitor_euphemium");
|
||||
titanium_filter = new ItemCapacitor(6 * 60 * 60 * 20).setUnlocalizedName("titanium_filter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":titanium_filter");
|
||||
titanium_filter = new ItemTitaniumFilter(6 * 60 * 60 * 20).setUnlocalizedName("titanium_filter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":titanium_filter");
|
||||
screwdriver = new ItemTooling(ToolType.SCREWDRIVER, 100).setUnlocalizedName("screwdriver");
|
||||
screwdriver_desh = new ItemTooling(ToolType.SCREWDRIVER, 0).setUnlocalizedName("screwdriver_desh");
|
||||
hand_drill = new ItemTooling(ToolType.HAND_DRILL, 100).setUnlocalizedName("hand_drill");
|
||||
|
||||
@ -8,15 +8,13 @@ import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemCapacitor extends Item {
|
||||
|
||||
private int dura;
|
||||
|
||||
public ItemCapacitor(int dura) {
|
||||
this.dura = dura;
|
||||
this.setMaxDamage(dura);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -24,11 +22,7 @@ public class ItemCapacitor extends Item {
|
||||
if (this == ModItems.redcoil_capacitor) {
|
||||
list.add("Right-click a block to negate positive charge.");
|
||||
list.add("[Needed for Schrabidium Synthesis]");
|
||||
list.add(getDura(itemstack) + "/" + dura);
|
||||
}
|
||||
if (this == ModItems.titanium_filter) {
|
||||
list.add("[Needed for Watz Reaction]");
|
||||
list.add((getDura(itemstack) / 20) + "/" + (dura / 20));
|
||||
list.add((itemstack.getMaxDamage() - itemstack.getItemDamage()) + "/" + itemstack.getMaxDamage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,9 +33,9 @@ public class ItemCapacitor extends Item {
|
||||
|
||||
if (!player.isSneaking()) {
|
||||
|
||||
if (getDura(stack) < dura) {
|
||||
if(stack.getItemDamage() > 0) {
|
||||
|
||||
setDura(stack, getDura(stack) + 1);
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 2.5F, true);
|
||||
@ -55,29 +49,4 @@ public class ItemCapacitor extends Item {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return getDurabilityForDisplay(stack) > 0;
|
||||
}
|
||||
|
||||
public static int getDura(ItemStack stack) {
|
||||
|
||||
if(stack.stackTagCompound == null)
|
||||
return ((ItemCapacitor)stack.getItem()).dura;
|
||||
|
||||
return stack.stackTagCompound.getInteger("dura");
|
||||
}
|
||||
|
||||
public static void setDura(ItemStack stack, int dura) {
|
||||
|
||||
if(!stack.hasTagCompound())
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
stack.stackTagCompound.setInteger("dura", dura);
|
||||
}
|
||||
|
||||
public double getDurabilityForDisplay(ItemStack stack)
|
||||
{
|
||||
return 1D - (double)getDura(stack) / (double)dura;
|
||||
}
|
||||
}
|
||||
|
||||
51
src/main/java/com/hbm/items/tool/ItemTitaniumFilter.java
Normal file
51
src/main/java/com/hbm/items/tool/ItemTitaniumFilter.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ItemTitaniumFilter extends Item {
|
||||
|
||||
private int dura;
|
||||
|
||||
public ItemTitaniumFilter(int dura) {
|
||||
this.dura = dura;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
if(this == ModItems.titanium_filter) {
|
||||
list.add("[Needed for Watz Reaction]");
|
||||
list.add((getDura(itemstack) / 20) + "/" + (dura / 20));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return getDurabilityForDisplay(stack) > 0;
|
||||
}
|
||||
|
||||
public static int getDura(ItemStack stack) {
|
||||
|
||||
if(stack.stackTagCompound == null)
|
||||
return ((ItemTitaniumFilter) stack.getItem()).dura;
|
||||
|
||||
return stack.stackTagCompound.getInteger("dura");
|
||||
}
|
||||
|
||||
public static void setDura(ItemStack stack, int dura) {
|
||||
|
||||
if(!stack.hasTagCompound())
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
stack.stackTagCompound.setInteger("dura", dura);
|
||||
}
|
||||
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
return 1D - (double) getDura(stack) / (double) dura;
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,6 @@ import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator;
|
||||
import com.hbm.inventory.gui.GUIMachineSchrabidiumTransmutator;
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemCapacitor;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
@ -89,7 +88,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack stack, int j) {
|
||||
|
||||
if (i == 2 && stack.getItem() != null && (stack.getItem() == ModItems.redcoil_capacitor && ItemCapacitor.getDura(stack) <= 0) || stack.getItem() == ModItems.euphemium_capacitor) {
|
||||
if (i == 2 && stack.getItem() != null && (stack.getItem() == ModItems.redcoil_capacitor && stack.getItemDamage() == stack.getMaxDamage()) || stack.getItem() == ModItems.euphemium_capacitor) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -115,7 +114,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
|
||||
public boolean canProcess() {
|
||||
if (power >= 4990000 && slots[0] != null && MachineRecipes.mODE(slots[0], OreDictManager.U.ingot()) && slots[2] != null
|
||||
&& (slots[2].getItem() == ModItems.redcoil_capacitor && ItemCapacitor.getDura(slots[2]) > 0 || slots[2].getItem() == ModItems.euphemium_capacitor)
|
||||
&& (slots[2].getItem() == ModItems.redcoil_capacitor && slots[2].getItemDamage() < slots[2].getMaxDamage() || slots[2].getItem() == ModItems.euphemium_capacitor)
|
||||
&& (slots[1] == null || (slots[1] != null && slots[1].getItem() == VersatileConfig.getTransmutatorItem()
|
||||
&& slots[1].stackSize < slots[1].getMaxStackSize()))) {
|
||||
return true;
|
||||
@ -146,7 +145,7 @@ public class TileEntityMachineSchrabidiumTransmutator extends TileEntityMachineB
|
||||
slots[1].stackSize++;
|
||||
}
|
||||
if (slots[2] != null && slots[2].getItem() == ModItems.redcoil_capacitor) {
|
||||
ItemCapacitor.setDura(slots[2], ItemCapacitor.getDura(slots[2]) - 1);
|
||||
slots[2].setItemDamage(slots[2].getItemDamage() + 1);
|
||||
}
|
||||
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "ambient.weather.thunder", 10000.0F,
|
||||
|
||||
@ -18,8 +18,8 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIWatzCore;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemCapacitor;
|
||||
import com.hbm.items.special.WatzFuel;
|
||||
import com.hbm.items.tool.ItemTitaniumFilter;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
@ -504,7 +504,7 @@ public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedIn
|
||||
|
||||
@Override
|
||||
public boolean hasFuse() {
|
||||
return slots[38] != null && slots[38].getItem() == ModItems.titanium_filter && ItemCapacitor.getDura(slots[38]) > 0;
|
||||
return slots[38] != null && slots[38].getItem() == ModItems.titanium_filter && ItemTitaniumFilter.getDura(slots[38]) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -576,7 +576,7 @@ public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedIn
|
||||
|
||||
//Only damages filter when heat is present (thus waste being created)
|
||||
if (heatList > 0) {
|
||||
ItemCapacitor.setDura(slots[38], ItemCapacitor.getDura(slots[38]) - 1);
|
||||
ItemTitaniumFilter.setDura(slots[38], ItemTitaniumFilter.getDura(slots[38]) - 1);
|
||||
}
|
||||
|
||||
heatList *= heatMultiplier;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
x
Reference in New Issue
Block a user