mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'upstream/master' into abel-abilities
@HbmMods please, every commit you make is a merge conflict
This commit is contained in:
commit
df1ee57563
16
changelog
16
changelog
@ -1,10 +1,12 @@
|
|||||||
## Changed
|
## Changed
|
||||||
* All compound plates can now also be made in the assembler
|
* Updated chinese localiation
|
||||||
* Opening crates when held is now disabled by default
|
* Duds now have a radioactive AoE effect around them based on type
|
||||||
|
* HPS is no longer tagged as radioactive and no longer requires hazardous materials tanks to store
|
||||||
|
* Somehow, these meaningless tags triggered people exceptionally hard. Go annoy someone else.
|
||||||
|
* Solderers and arc welders can now use overdrive upgrades
|
||||||
|
* Do note that processing speed rises linearly, but power draw rises exponentially
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed all dud variants having the balefire explosion effect
|
* Crates? Maybe?
|
||||||
* Fixed demolition charges being able to explode multiple times when hitting entities
|
* Fixed conveyor placer not being usable on the conveyor sorter
|
||||||
* Condensers are no longer affected by post-impact effects, fixing an issue where HP condenser tanks would go into the negatives
|
* Fixed crucible trying to autogen recipes for nonexistant nether thorium ore
|
||||||
* Probably fixed particle accelerator recipe config not working
|
|
||||||
* Fixed potential dupe bug involving many held inventories
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
mod_version=1.0.27
|
mod_version=1.0.27
|
||||||
# Empty build number makes a release type
|
# Empty build number makes a release type
|
||||||
mod_build_number=5335
|
mod_build_number=5336
|
||||||
|
|
||||||
credits=HbMinecraft,\
|
credits=HbMinecraft,\
|
||||||
\ rodolphito (explosion algorithms),\
|
\ rodolphito (explosion algorithms),\
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import api.hbm.conveyor.IEnterableBlock;
|
|||||||
import com.hbm.blocks.IBlockMultiPass;
|
import com.hbm.blocks.IBlockMultiPass;
|
||||||
import com.hbm.blocks.ITooltipProvider;
|
import com.hbm.blocks.ITooltipProvider;
|
||||||
import com.hbm.entity.item.EntityMovingItem;
|
import com.hbm.entity.item.EntityMovingItem;
|
||||||
|
import com.hbm.items.tool.ItemConveyorWand;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.module.ModulePatternMatcher;
|
import com.hbm.module.ModulePatternMatcher;
|
||||||
@ -61,7 +62,9 @@ public class CraneRouter extends BlockContainer implements IBlockMultiPass, IEnt
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
if(world.isRemote) {
|
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemConveyorWand) {
|
||||||
|
return false;
|
||||||
|
} else if(world.isRemote) {
|
||||||
return true;
|
return true;
|
||||||
} else if(!player.isSneaking()) {
|
} else if(!player.isSneaking()) {
|
||||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class ServerConfig extends RunningConfig {
|
|||||||
public static ConfigWrapper<Float> MINE_NUKE_DAMAGE = new ConfigWrapper(100F);
|
public static ConfigWrapper<Float> MINE_NUKE_DAMAGE = new ConfigWrapper(100F);
|
||||||
public static ConfigWrapper<Float> MINE_NAVAL_DAMAGE = new ConfigWrapper(60F);
|
public static ConfigWrapper<Float> MINE_NAVAL_DAMAGE = new ConfigWrapper(60F);
|
||||||
public static ConfigWrapper<Boolean> TAINT_TRAILS = new ConfigWrapper(false);
|
public static ConfigWrapper<Boolean> TAINT_TRAILS = new ConfigWrapper(false);
|
||||||
public static ConfigWrapper<Boolean> CRATE_ALLOW_OPEN_HELD = new ConfigWrapper(false);
|
public static ConfigWrapper<Boolean> CRATE_OPEN_HELD = new ConfigWrapper(true);
|
||||||
public static ConfigWrapper<Boolean> CRATE_KEEP_CONTENTS = new ConfigWrapper(true);
|
public static ConfigWrapper<Boolean> CRATE_KEEP_CONTENTS = new ConfigWrapper(true);
|
||||||
public static ConfigWrapper<Integer> ITEM_HAZARD_DROP_TICKRATE = new ConfigWrapper(2);
|
public static ConfigWrapper<Integer> ITEM_HAZARD_DROP_TICKRATE = new ConfigWrapper(2);
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ public class ServerConfig extends RunningConfig {
|
|||||||
configMap.put("MINE_NUKE_DAMAGE", MINE_NUKE_DAMAGE);
|
configMap.put("MINE_NUKE_DAMAGE", MINE_NUKE_DAMAGE);
|
||||||
configMap.put("MINE_NAVAL_DAMAGE", MINE_NAVAL_DAMAGE);
|
configMap.put("MINE_NAVAL_DAMAGE", MINE_NAVAL_DAMAGE);
|
||||||
configMap.put("TAINT_TRAILS", TAINT_TRAILS);
|
configMap.put("TAINT_TRAILS", TAINT_TRAILS);
|
||||||
configMap.put("CRATE_ALLOW_OPEN_HELD", CRATE_ALLOW_OPEN_HELD);
|
configMap.put("CRATE_OPEN_HELD", CRATE_OPEN_HELD);
|
||||||
configMap.put("CRATE_KEEP_CONTENTS", CRATE_KEEP_CONTENTS);
|
configMap.put("CRATE_KEEP_CONTENTS", CRATE_KEEP_CONTENTS);
|
||||||
configMap.put("ITEM_HAZARD_DROP_TICKRATE", ITEM_HAZARD_DROP_TICKRATE);
|
configMap.put("ITEM_HAZARD_DROP_TICKRATE", ITEM_HAZARD_DROP_TICKRATE);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
|
|
||||||
public class ContainerCrateBase extends ContainerBase {
|
public class ContainerCrateBase extends ContainerBase {
|
||||||
|
|
||||||
//just there so prev stuff doesnt break
|
|
||||||
protected IInventory crate = tile;
|
|
||||||
|
|
||||||
public ContainerCrateBase(InventoryPlayer invPlayer, IInventory tedf) {
|
public ContainerCrateBase(InventoryPlayer invPlayer, IInventory tedf) {
|
||||||
super(invPlayer, tedf);
|
super(invPlayer, tedf);
|
||||||
tile.openInventory();
|
tile.openInventory();
|
||||||
@ -35,7 +32,7 @@ public class ContainerCrateBase extends ContainerBase {
|
|||||||
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
|
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
|
||||||
// prevents the player from moving around the currently open box
|
// prevents the player from moving around the currently open box
|
||||||
if(player.inventory.getStackInSlot(player.inventory.currentItem) != null &&
|
if(player.inventory.getStackInSlot(player.inventory.currentItem) != null &&
|
||||||
player.inventory.getStackInSlot(player.inventory.currentItem).getItem() instanceof ItemBlockStorageCrate && !(this.crate instanceof TileEntity)) {
|
player.inventory.getStackInSlot(player.inventory.currentItem).getItem() instanceof ItemBlockStorageCrate && !(this.tile instanceof TileEntity)) {
|
||||||
if (mode == 2 && button == player.inventory.currentItem) {
|
if (mode == 2 && button == player.inventory.currentItem) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -66,7 +63,7 @@ public class ContainerCrateBase extends ContainerBase {
|
|||||||
public boolean canTakeStack(EntityPlayer player) {
|
public boolean canTakeStack(EntityPlayer player) {
|
||||||
if(player.inventory.currentItem == this.getSlotIndex() && // If this slot is the current held slot.
|
if(player.inventory.currentItem == this.getSlotIndex() && // If this slot is the current held slot.
|
||||||
this.getStack() != null && this.getStack().getItem() instanceof ItemBlockStorageCrate && // If the slot contains a storage crate.
|
this.getStack() != null && this.getStack().getItem() instanceof ItemBlockStorageCrate && // If the slot contains a storage crate.
|
||||||
player.openContainer instanceof ContainerCrateBase && !(ContainerCrateBase.this.crate instanceof TileEntity)) // If the player is currently inside a crate container.
|
player.openContainer instanceof ContainerCrateBase && !(ContainerCrateBase.this.tile instanceof TileEntity)) // If the player is currently inside a crate container.
|
||||||
return false;
|
return false;
|
||||||
return super.canTakeStack(player);
|
return super.canTakeStack(player);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,11 +39,11 @@ public class ContainerDroneRequester extends ContainerCrateBase {
|
|||||||
|
|
||||||
if(par2 < 9) return null; //ignore filters
|
if(par2 < 9) return null; //ignore filters
|
||||||
|
|
||||||
if(par2 <= crate.getSizeInventory() - 1) {
|
if(par2 <= tile.getSizeInventory() - 1) {
|
||||||
if(!this.mergeItemStack(var5, crate.getSizeInventory(), this.inventorySlots.size(), true)) {
|
if(!this.mergeItemStack(var5, tile.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if(!this.mergeItemStack(var5, 9, crate.getSizeInventory(), false)) {
|
} else if(!this.mergeItemStack(var5, 9, tile.getSizeInventory(), false)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ public class ContainerDroneRequester extends ContainerCrateBase {
|
|||||||
|
|
||||||
ItemStack ret = null;
|
ItemStack ret = null;
|
||||||
ItemStack held = player.inventory.getItemStack();
|
ItemStack held = player.inventory.getItemStack();
|
||||||
TileEntityDroneRequester requester = (TileEntityDroneRequester) crate;
|
TileEntityDroneRequester requester = (TileEntityDroneRequester) tile;
|
||||||
|
|
||||||
if(slot.getHasStack())
|
if(slot.getHasStack())
|
||||||
ret = slot.getStack().copy();
|
ret = slot.getStack().copy();
|
||||||
|
|||||||
@ -336,7 +336,7 @@ public class Fluids {
|
|||||||
BLOOD_HOT = new FluidType("BLOOD_HOT", 0xF22419, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).setTemp(666); //it's funny because it's the satan number
|
BLOOD_HOT = new FluidType("BLOOD_HOT", 0xF22419, 3, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS).setTemp(666); //it's funny because it's the satan number
|
||||||
SYNGAS = new FluidType("SYNGAS", 0x131313, 1, 4, 2, EnumSymbol.NONE).addContainers(new CD_Gastank(0xFFFFFF, 0x131313)).addTraits(GASEOUS);
|
SYNGAS = new FluidType("SYNGAS", 0x131313, 1, 4, 2, EnumSymbol.NONE).addContainers(new CD_Gastank(0xFFFFFF, 0x131313)).addTraits(GASEOUS);
|
||||||
OXYHYDROGEN = new FluidType("OXYHYDROGEN", 0x483FC1, 0, 4, 2, EnumSymbol.NONE).addTraits(GASEOUS);
|
OXYHYDROGEN = new FluidType("OXYHYDROGEN", 0x483FC1, 0, 4, 2, EnumSymbol.NONE).addTraits(GASEOUS);
|
||||||
RADIOSOLVENT = new FluidType("RADIOSOLVENT", 0xA4D7DD, 3, 3, 0, EnumSymbol.NONE).addTraits(LIQUID, LEADCON, new FT_Corrosive(50), new FT_VentRadiation(0.01F));
|
RADIOSOLVENT = new FluidType("RADIOSOLVENT", 0xA4D7DD, 3, 3, 0, EnumSymbol.NONE).addTraits(LIQUID, new FT_Corrosive(50));
|
||||||
CHLORINE = new FluidType("CHLORINE", 0xBAB572, 3, 0, 0, EnumSymbol.OXIDIZER).addContainers(new CD_Gastank(0xBAB572, 0x887B34)).addTraits(GASEOUS, new FT_Corrosive(25));
|
CHLORINE = new FluidType("CHLORINE", 0xBAB572, 3, 0, 0, EnumSymbol.OXIDIZER).addContainers(new CD_Gastank(0xBAB572, 0x887B34)).addTraits(GASEOUS, new FT_Corrosive(25));
|
||||||
HEAVYOIL_VACUUM = new FluidType("HEAVYOIL_VACUUM", 0x131214, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS, P_OIL).addContainers(new CD_Canister(0x513F39));
|
HEAVYOIL_VACUUM = new FluidType("HEAVYOIL_VACUUM", 0x131214, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS, P_OIL).addContainers(new CD_Canister(0x513F39));
|
||||||
REFORMATE = new FluidType("REFORMATE", 0x835472, 2, 2, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS, P_FUEL).addContainers(new CD_Canister(0xD180D6));
|
REFORMATE = new FluidType("REFORMATE", 0x835472, 2, 2, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS, P_FUEL).addContainers(new CD_Canister(0xD180D6));
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public class MatDistribution extends SerializableRecipe {
|
|||||||
registerOre(OreDictManager.COAL.ore(), MAT_CARBON, GEM.q(3), MAT_STONE, QUART.q(1));
|
registerOre(OreDictManager.COAL.ore(), MAT_CARBON, GEM.q(3), MAT_STONE, QUART.q(1));
|
||||||
registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||||
registerOre(OreDictManager.U.ore(), MAT_URANIUM, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
registerOre(OreDictManager.U.ore(), MAT_URANIUM, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) registerOre(ore, MAT_THORIUM, INGOT.q(2), MAT_URANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
for(String ore : OreDictManager.TH232.all(MaterialShapes.ONLY_ORE)) registerOre(ore, MAT_THORIUM, INGOT.q(2), MAT_URANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||||
registerOre(OreDictManager.CU.ore(), MAT_COPPER, INGOT.q(2), MAT_STONE, QUART.q(1));
|
registerOre(OreDictManager.CU.ore(), MAT_COPPER, INGOT.q(2), MAT_STONE, QUART.q(1));
|
||||||
registerOre(OreDictManager.PB.ore(), MAT_LEAD, INGOT.q(2), MAT_GOLD, NUGGET.q(1), MAT_STONE, QUART.q(1));
|
registerOre(OreDictManager.PB.ore(), MAT_LEAD, INGOT.q(2), MAT_GOLD, NUGGET.q(1), MAT_STONE, QUART.q(1));
|
||||||
registerOre(OreDictManager.BE.ore(), MAT_BERYLLIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
|
registerOre(OreDictManager.BE.ore(), MAT_BERYLLIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
|
||||||
|
|||||||
@ -28,21 +28,27 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
|||||||
super(block);
|
super(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IF WE PUT ROCKS IN THE SHAPE OF A RUNWAY GOD WILL GIVE US HIGH-FRUCTOSE CORN SYRUP
|
||||||
|
@Override
|
||||||
|
public int getMaxItemUseDuration(ItemStack stack) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
if(!ServerConfig.CRATE_ALLOW_OPEN_HELD.get()) return stack;
|
if(!ServerConfig.CRATE_OPEN_HELD.get()) return stack;
|
||||||
|
|
||||||
Block block = Block.getBlockFromItem(player.getHeldItem().getItem());
|
Block block = Block.getBlockFromItem(player.getHeldItem().getItem());
|
||||||
if(block == ModBlocks.mass_storage) return stack; // Genuinely can't figure out how to make this part work, so I'm just not gonna mess with it.
|
if(block == ModBlocks.mass_storage) return stack; // Genuinely can't figure out how to make this part work, so I'm just not gonna mess with it.
|
||||||
|
|
||||||
if(!world.isRemote && stack.stackSize == 1) {
|
if(!world.isRemote && stack.stackSize == 1) {
|
||||||
if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("lock")) {
|
if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("lock")) {
|
||||||
for (ItemStack item : player.inventory.mainInventory) {
|
for(ItemStack item : player.inventory.mainInventory) {
|
||||||
|
|
||||||
if(item == null) continue; // Skip if no item.
|
if(item == null) continue; // Skip if no item.
|
||||||
if(!(item.getItem() instanceof ItemKey)) continue; // Skip if item isn't a key.
|
if(!(item.getItem() instanceof ItemKey)) continue; // Skip if item isn't a key.
|
||||||
if(item.stackTagCompound == null) continue; // Skip if there is no NBT (wouldn't open it anyway).
|
if(item.stackTagCompound == null) continue; // Skip if there is no NBT (wouldn't open it anyway).
|
||||||
if (item.stackTagCompound.getInteger("pins") == stack.stackTagCompound.getInteger("lock")) { // Check if pins are equal (if it can open it)
|
if(item.stackTagCompound.getInteger("pins") == stack.stackTagCompound.getInteger("lock")) { // Check if pins are equal (if it can open it)
|
||||||
TileEntityCrateBase.spawnSpiders(player, world, stack);
|
TileEntityCrateBase.spawnSpiders(player, world, stack);
|
||||||
player.openGui(MainRegistry.instance, 0, world, 0, 0, 0);
|
player.openGui(MainRegistry.instance, 0, world, 0, 0, 0);
|
||||||
break;
|
break;
|
||||||
@ -84,13 +90,9 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
|||||||
|
|
||||||
public static class InventoryCrate extends ItemInventory {
|
public static class InventoryCrate extends ItemInventory {
|
||||||
|
|
||||||
public int heldIndex;
|
|
||||||
|
|
||||||
public InventoryCrate(EntityPlayer player, ItemStack crate) {
|
public InventoryCrate(EntityPlayer player, ItemStack crate) {
|
||||||
|
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.target = crate;
|
this.target = crate;
|
||||||
this.heldIndex = player.inventory.currentItem;
|
|
||||||
|
|
||||||
this.slots = new ItemStack[this.getSizeInventory()];
|
this.slots = new ItemStack[this.getSizeInventory()];
|
||||||
if(target.stackTagCompound == null) {
|
if(target.stackTagCompound == null) {
|
||||||
@ -129,42 +131,35 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markDirty() { // I HATE THIS SO MUCH
|
public void markDirty() { // You have been blessed by the unfuck
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
|
||||||
|
// Preserve existing NBT so we keep lock data and piders
|
||||||
|
NBTTagCompound nbt = target.stackTagCompound != null ? target.stackTagCompound : new NBTTagCompound();
|
||||||
int invSize = this.getSizeInventory();
|
int invSize = this.getSizeInventory();
|
||||||
|
|
||||||
for(int i = 0; i < invSize; i++) {
|
for(int i = 0; i < invSize; i++) {
|
||||||
|
|
||||||
ItemStack stack = this.getStackInSlot(i);
|
ItemStack stack = this.getStackInSlot(i);
|
||||||
if(stack == null) continue;
|
if(stack == null) {
|
||||||
|
nbt.removeTag("slot" + i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
NBTTagCompound slot = new NBTTagCompound();
|
NBTTagCompound slot = new NBTTagCompound();
|
||||||
stack.writeToNBT(slot);
|
stack.writeToNBT(slot);
|
||||||
nbt.setTag("slot" + i, slot);
|
nbt.setTag("slot" + i, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(target.stackTagCompound != null) { // yes it's a bit jank, but it wants to clear otherwise so...
|
target.setTagCompound(nbt);
|
||||||
if(target.stackTagCompound.hasKey("lock")) nbt.setInteger("lock", target.stackTagCompound.getInteger("lock"));
|
|
||||||
if(target.stackTagCompound.hasKey("lockMod")) nbt.setDouble("lockMod", target.stackTagCompound.getDouble("lockMod"));
|
|
||||||
if(target.stackTagCompound.hasKey("spiders")) nbt.setBoolean("spiders", target.stackTagCompound.getBoolean("spiders")); // fuck you!!
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// i have completely given up
|
|
||||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == this.target.getItem() && player.inventory.currentItem == this.heldIndex) {
|
|
||||||
player.getHeldItem().setTagCompound(nbt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {
|
public void closeInventory() {
|
||||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:block.crateClose", 1.0F, 0.8F);
|
super.closeInventory();
|
||||||
|
|
||||||
/*
|
// Check for 6kb item vomit
|
||||||
* realistically, we only need one NBT size check (and we only *want* one because CompressedStreamTools is expensive) so we do that part only when closing
|
target.setTagCompound(checkNBT(target.getTagCompound()));
|
||||||
*/
|
player.inventoryContainer.detectAndSendChanges();
|
||||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == this.target.getItem() && player.inventory.currentItem == this.heldIndex) {
|
|
||||||
player.getHeldItem().setTagCompound(checkNBT(player.getHeldItem().getTagCompound()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,11 @@ public class ItemToolBox extends Item implements IGUIProvider {
|
|||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxItemUseDuration(ItemStack stack) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister iconRegister) {
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
@ -285,9 +290,11 @@ public class ItemToolBox extends Item implements IGUIProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {
|
public void closeInventory() {
|
||||||
this.target.getTagCompound().removeTag("isOpen");
|
|
||||||
this.player.inventory.setInventorySlotContents(this.player.inventory.currentItem, this.target);
|
|
||||||
super.closeInventory();
|
super.closeInventory();
|
||||||
|
|
||||||
|
this.target.getTagCompound().removeTag("isOpen");
|
||||||
|
this.target.getTagCompound().setInteger("rand", player.worldObj.rand.nextInt()); // a boolean changing isn't sufficient to detect the change
|
||||||
|
player.inventoryContainer.detectAndSendChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
|||||||
public class RefStrings {
|
public class RefStrings {
|
||||||
public static final String MODID = "hbm";
|
public static final String MODID = "hbm";
|
||||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||||
public static final String VERSION = "1.0.27 BETA (5335)";
|
public static final String VERSION = "1.0.27 BETA (5336)";
|
||||||
//HBM's Beta Naming Convention:
|
//HBM's Beta Naming Convention:
|
||||||
//V T (X)
|
//V T (X)
|
||||||
//V -> next release version
|
//V -> next release version
|
||||||
|
|||||||
@ -1,16 +1,47 @@
|
|||||||
package com.hbm.tileentity.bomb;
|
package com.hbm.tileentity.bomb;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
|
import com.hbm.blocks.bomb.BlockCrashedBomb.EnumDudType;
|
||||||
|
import com.hbm.util.ContaminationUtil;
|
||||||
|
import com.hbm.util.EnumUtil;
|
||||||
|
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||||
|
import com.hbm.util.ContaminationUtil.HazardType;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
|
||||||
public class TileEntityCrashedBomb extends TileEntity {
|
public class TileEntityCrashedBomb extends TileEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AxisAlignedBB getRenderBoundingBox() { return TileEntity.INFINITE_EXTENT_AABB; }
|
public void updateEntity() {
|
||||||
|
|
||||||
@Override
|
if(!worldObj.isRemote) {
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public double getMaxRenderDistanceSquared() { return 65536.0D; }
|
if(worldObj.getTotalWorldTime() % 2 == 0) {
|
||||||
|
EnumDudType type = EnumUtil.grabEnumSafely(EnumDudType.class, this.getBlockMetadata());
|
||||||
|
|
||||||
|
if(type == type.BALEFIRE) affectEntities((entity, intensity) -> { ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, 1F * intensity); }, 15D);
|
||||||
|
if(type == type.NUKE) affectEntities((entity, intensity) -> { ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, 0.25F * intensity); }, 10D);
|
||||||
|
if(type == type.SALTED) affectEntities((entity, intensity) -> { ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, 0.5F * intensity); }, 10D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void affectEntities(BiConsumer<EntityLivingBase, Float> effect, double range) {
|
||||||
|
List<EntityLivingBase> list = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(range, range, range));
|
||||||
|
for(EntityLivingBase entity : list) {
|
||||||
|
double dist = Math.sqrt(getDistanceFrom(entity.posX, entity.posY + entity.height / 2, entity.posZ));
|
||||||
|
if(dist > range) continue;
|
||||||
|
float intensity = (float) (1D - dist / range);
|
||||||
|
effect.accept(entity, intensity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public AxisAlignedBB getRenderBoundingBox() { return TileEntity.INFINITE_EXTENT_AABB; }
|
||||||
|
@Override @SideOnly(Side.CLIENT) public double getMaxRenderDistanceSquared() { return 65536.0D; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
|||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.tileentity.*;
|
import com.hbm.tileentity.*;
|
||||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
import com.hbm.util.I18nUtil;
|
import com.hbm.util.I18nUtil;
|
||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
@ -92,14 +93,16 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements
|
|||||||
upgradeManager.checkSlots(this, slots, 6, 7);
|
upgradeManager.checkSlots(this, slots, 6, 7);
|
||||||
int redLevel = upgradeManager.getLevel(UpgradeType.SPEED);
|
int redLevel = upgradeManager.getLevel(UpgradeType.SPEED);
|
||||||
int blueLevel = upgradeManager.getLevel(UpgradeType.POWER);
|
int blueLevel = upgradeManager.getLevel(UpgradeType.POWER);
|
||||||
|
int blackLevel = upgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||||
|
|
||||||
if(recipe != null) {
|
if(recipe != null) {
|
||||||
this.processTime = recipe.duration - (recipe.duration * redLevel / 6) + (recipe.duration * blueLevel / 3);
|
this.processTime = recipe.duration - (recipe.duration * redLevel / 6) + (recipe.duration * blueLevel / 3);
|
||||||
this.consumption = recipe.consumption + (recipe.consumption * redLevel) - (recipe.consumption * blueLevel / 6);
|
this.consumption = recipe.consumption + (recipe.consumption * redLevel) - (recipe.consumption * blueLevel / 6);
|
||||||
|
this.consumption *= Math.pow(2, blackLevel);
|
||||||
intendedMaxPower = recipe.consumption * 20;
|
intendedMaxPower = recipe.consumption * 20;
|
||||||
|
|
||||||
if(canProcess(recipe)) {
|
if(canProcess(recipe)) {
|
||||||
this.progress++;
|
this.progress += (1 + blackLevel);
|
||||||
this.power -= this.consumption;
|
this.power -= this.consumption;
|
||||||
|
|
||||||
if(progress >= processTime) {
|
if(progress >= processTime) {
|
||||||
@ -369,7 +372,7 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER;
|
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -383,6 +386,9 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements
|
|||||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 100 / 6) + "%"));
|
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 100 / 6) + "%"));
|
||||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 100 / 3) + "%"));
|
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 100 / 3) + "%"));
|
||||||
}
|
}
|
||||||
|
if(type == UpgradeType.OVERDRIVE) {
|
||||||
|
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -390,6 +396,7 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements
|
|||||||
HashMap<UpgradeType, Integer> upgrades = new HashMap<>();
|
HashMap<UpgradeType, Integer> upgrades = new HashMap<>();
|
||||||
upgrades.put(UpgradeType.SPEED, 3);
|
upgrades.put(UpgradeType.SPEED, 3);
|
||||||
upgrades.put(UpgradeType.POWER, 3);
|
upgrades.put(UpgradeType.POWER, 3);
|
||||||
|
upgrades.put(UpgradeType.OVERDRIVE, 3);
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import com.hbm.packet.toclient.AuxParticlePacketNT;
|
|||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
import com.hbm.util.I18nUtil;
|
import com.hbm.util.I18nUtil;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
@ -98,14 +99,16 @@ public class TileEntityMachineSolderingStation extends TileEntityMachineBase imp
|
|||||||
upgradeManager.checkSlots(this, slots, 9, 10);
|
upgradeManager.checkSlots(this, slots, 9, 10);
|
||||||
int redLevel = upgradeManager.getLevel(UpgradeType.SPEED);
|
int redLevel = upgradeManager.getLevel(UpgradeType.SPEED);
|
||||||
int blueLevel = upgradeManager.getLevel(UpgradeType.POWER);
|
int blueLevel = upgradeManager.getLevel(UpgradeType.POWER);
|
||||||
|
int blackLevel = upgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||||
|
|
||||||
if(recipe != null) {
|
if(recipe != null) {
|
||||||
this.processTime = recipe.duration - (recipe.duration * redLevel / 6) + (recipe.duration * blueLevel / 3);
|
this.processTime = recipe.duration - (recipe.duration * redLevel / 6) + (recipe.duration * blueLevel / 3);
|
||||||
this.consumption = recipe.consumption + (recipe.consumption * redLevel) - (recipe.consumption * blueLevel / 6);
|
this.consumption = recipe.consumption + (recipe.consumption * redLevel) - (recipe.consumption * blueLevel / 6);
|
||||||
|
this.consumption *= Math.pow(2, blackLevel);
|
||||||
intendedMaxPower = recipe.consumption * 20;
|
intendedMaxPower = recipe.consumption * 20;
|
||||||
|
|
||||||
if(canProcess(recipe)) {
|
if(canProcess(recipe)) {
|
||||||
this.progress++;
|
this.progress += (1 + blackLevel);
|
||||||
this.power -= this.consumption;
|
this.power -= this.consumption;
|
||||||
|
|
||||||
if(progress >= processTime) {
|
if(progress >= processTime) {
|
||||||
@ -360,7 +363,7 @@ public class TileEntityMachineSolderingStation extends TileEntityMachineBase imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER;
|
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -374,6 +377,9 @@ public class TileEntityMachineSolderingStation extends TileEntityMachineBase imp
|
|||||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 100 / 6) + "%"));
|
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 100 / 6) + "%"));
|
||||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 100 / 3) + "%"));
|
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 100 / 3) + "%"));
|
||||||
}
|
}
|
||||||
|
if(type == UpgradeType.OVERDRIVE) {
|
||||||
|
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -381,6 +387,7 @@ public class TileEntityMachineSolderingStation extends TileEntityMachineBase imp
|
|||||||
HashMap<UpgradeType, Integer> upgrades = new HashMap<>();
|
HashMap<UpgradeType, Integer> upgrades = new HashMap<>();
|
||||||
upgrades.put(UpgradeType.SPEED, 3);
|
upgrades.put(UpgradeType.SPEED, 3);
|
||||||
upgrades.put(UpgradeType.POWER, 3);
|
upgrades.put(UpgradeType.POWER, 3);
|
||||||
|
upgrades.put(UpgradeType.OVERDRIVE, 3);
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6060,8 +6060,11 @@ item.ammo_standard.ct_mortar_charge.name=重型炸药包
|
|||||||
item.gun_charge_thrower.name=炸药投掷器
|
item.gun_charge_thrower.name=炸药投掷器
|
||||||
tile.sandbags.name=沙袋
|
tile.sandbags.name=沙袋
|
||||||
tile.wood_barrier.name=木制围栏
|
tile.wood_barrier.name=木制围栏
|
||||||
item.ammo_standard.nuke_balefire.name=Mini Nuke, Balefire Egg
|
item.ammo_standard.nuke_balefire.name=迷你野火炸弹
|
||||||
item.gun_minigun_dual.name=双联转管机枪
|
item.gun_minigun_dual.name=双联转管机枪
|
||||||
tile.wood_structure.ceiling.name=木质顶棚
|
tile.wood_structure.ceiling.name=木质顶棚
|
||||||
tile.wood_structure.roof.name=木质顶板
|
tile.wood_structure.roof.name=木质地板
|
||||||
tile.wood_structure.scaffold.name=木质脚手架
|
tile.wood_structure.scaffold.name=木质脚手架
|
||||||
|
item.gun_amat.name=反器材步枪
|
||||||
|
tile.fluid_pump.name=流量控制泵
|
||||||
|
tile.vine_phosphor.large.name=磷藤蔓
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Loading…
x
Reference in New Issue
Block a user