mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
Compare commits
2 Commits
7805bacbd0
...
f42775cfcf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f42775cfcf | ||
|
|
11668d2412 |
@ -12,6 +12,7 @@
|
||||
* Chicago pile control rods can either be fully withdrawn with redstone or fine tuned with RoR
|
||||
* Additionally, channels can be drilled by right clicking a pile addon device with the hand drill, the addon doesn't need to be removed beforehand
|
||||
* This is mainly for convenience when disassembling and reassembling the reactor, which requires all channels to be drilled again
|
||||
* Piles that overheat will explode, throwing flaming graphite everywhere
|
||||
|
||||
## Changed
|
||||
* Updated all oil well GUI textures
|
||||
|
||||
@ -1510,7 +1510,7 @@ public class ModBlocks {
|
||||
reinforced_ducrete = new BlockNoSpawn(Material.rock).setBlockName("reinforced_ducrete").setCreativeTab(MainRegistry.blockTab).setHardness(20.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_ducrete");
|
||||
|
||||
lightstone = new BlockLightstone(Material.rock, LightstoneType.class, true, true).setBlockName("lightstone").setCreativeTab(MainRegistry.blockTab).setHardness(2F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":lightstone");
|
||||
brick_forgotten = new BlockPillar(Material.rock, RefStrings.MODID + ":brick_forgotten_top").setBlockName("brick_forgotten").setBlockUnbreakable().setResistance(666_666F).setBlockTextureName(RefStrings.MODID + ":brick_forgotten");
|
||||
brick_forgotten = new BlockForgottenBrick().setBlockName("brick_forgotten").setBlockUnbreakable().setResistance(666_666F).setBlockTextureName(RefStrings.MODID + ":brick_forgotten");
|
||||
brick_forgotten_lock = new BlockForgottenLock(Material.rock, RefStrings.MODID + ":brick_forgotten_top").setBlockName("brick_forgotten_lock").setBlockUnbreakable().setResistance(666_666F).setBlockTextureName(RefStrings.MODID + ":brick_forgotten_lock");
|
||||
|
||||
concrete_slab = new BlockMultiSlab(null, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
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;
|
||||
|
||||
public class BlockForgottenBrick extends BlockMulti {
|
||||
|
||||
private IIcon iconTop;
|
||||
private IIcon iconAlt;
|
||||
private IIcon iconAltTop;
|
||||
private IIcon iconStone;
|
||||
private IIcon iconHole;
|
||||
private IIcon iconEmpty;
|
||||
private IIcon iconPlanks;
|
||||
|
||||
public BlockForgottenBrick() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.iconTop = reg.registerIcon(RefStrings.MODID + ":brick_forgotten_top");
|
||||
this.iconAlt = reg.registerIcon(RefStrings.MODID + ":brick_forgotten_bw");
|
||||
this.iconAltTop = reg.registerIcon(RefStrings.MODID + ":brick_forgotten_bw_top");
|
||||
this.iconStone = reg.registerIcon(RefStrings.MODID + ":playground/nullstone_demo_1_wip");
|
||||
this.iconHole = reg.registerIcon(RefStrings.MODID + ":brick_forgotten_hole");
|
||||
this.iconEmpty = reg.registerIcon(RefStrings.MODID + ":brick_forgotten_hole_empty");
|
||||
this.iconPlanks = reg.registerIcon(RefStrings.MODID + ":nr_planks");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
if(meta == 1) {
|
||||
if(side == 0 || side == 1) return this.iconAltTop;
|
||||
return this.iconAlt;
|
||||
}
|
||||
if(meta == 2) {
|
||||
return this.iconStone;
|
||||
}
|
||||
if(meta == 3) {
|
||||
if(side == 0 || side == 1) return this.iconTop;
|
||||
return this.iconHole;
|
||||
}
|
||||
if(meta == 4) {
|
||||
if(side == 0 || side == 1) return this.iconTop;
|
||||
return this.iconEmpty;
|
||||
}
|
||||
if(meta == 5) {
|
||||
return this.iconPlanks;
|
||||
}
|
||||
|
||||
if(side == 0 || side == 1) return this.iconTop;
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override public int getSubCount() { return 6; }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < getSubCount(); ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,6 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource;
|
||||
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -53,7 +52,8 @@ public class BlockPASource extends BlockDummyable implements ITooltipProvider {
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX * 2, y, z - dir.offsetZ + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - dir.offsetX - rot.offsetX * 2, y, z - dir.offsetZ - rot.offsetZ * 2);
|
||||
this.makeExtra(world, x,y - 1, z);
|
||||
|
||||
this.makeExtra(world, x, y - 1, z);
|
||||
this.makeExtra(world, x + rot.offsetX * 2, y - 1, z + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - rot.offsetX * 2, y - 1, z - rot.offsetZ * 2);
|
||||
}
|
||||
|
||||
@ -98,19 +98,21 @@ public class BlockPile extends BlockContainer implements IBlockCT, IToolable, IL
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile instanceof TileEntityPileBaseMK2) {
|
||||
TileEntityPileBaseMK2 pile = (TileEntityPileBaseMK2) tile;
|
||||
world.removeTileEntity(x, y, z);
|
||||
if(pile.coreY >= 0) world.setBlock(x, y, z, ModBlocks.pile_brick);
|
||||
if(!TileEntityPileCore.meltingDown) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
TileEntityPileCore core = pile.getCore();
|
||||
if(core != null && !core.isInvalid()) core.destroy();
|
||||
|
||||
} else {
|
||||
world.removeTileEntity(x, y, z);
|
||||
world.setBlock(x, y, z, ModBlocks.pile_brick);
|
||||
if(tile instanceof TileEntityPileBaseMK2) {
|
||||
TileEntityPileBaseMK2 pile = (TileEntityPileBaseMK2) tile;
|
||||
world.removeTileEntity(x, y, z);
|
||||
if(pile.coreY >= 0) world.setBlock(x, y, z, ModBlocks.pile_brick);
|
||||
|
||||
TileEntityPileCore core = pile.getCore();
|
||||
if(core != null && !core.isInvalid()) core.destroy();
|
||||
|
||||
} else {
|
||||
world.removeTileEntity(x, y, z);
|
||||
world.setBlock(x, y, z, ModBlocks.pile_brick);
|
||||
}
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
@ -151,6 +153,15 @@ public class BlockPile extends BlockContainer implements IBlockCT, IToolable, IL
|
||||
if(meta == META_AIR_IN) text.add("Air Inlet");
|
||||
if(meta == META_AIR_OUT) text.add("Air Outlet");
|
||||
if(meta == META_CONTROL) text.add("Control Rod Channel");
|
||||
|
||||
if(meta == META_CORE) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TileEntityPileCore) {
|
||||
TileEntityPileCore core = (TileEntityPileCore) tile;
|
||||
text.add("Max Temp: " + (int) Math.round(core.highestHeat) + " / " + core.MAX_HEAT + "°C");
|
||||
}
|
||||
}
|
||||
|
||||
if(!text.isEmpty()) ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.machine.pile;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockFlammable;
|
||||
import com.hbm.blocks.machine.MachinePWRController;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileBaseMK2;
|
||||
@ -10,7 +11,6 @@ import com.hbm.tileentity.machine.pile.TileEntityPileCore.PileOrientation;
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -18,13 +18,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPileBrick extends Block implements IToolable {
|
||||
public class BlockPileBrick extends BlockFlammable implements IToolable {
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconSide;
|
||||
|
||||
public BlockPileBrick() {
|
||||
super(Material.rock);
|
||||
super(Material.rock, 30, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -127,7 +127,7 @@ public class BlockPileBrick extends Block implements IToolable {
|
||||
world.setBlock(iX, iY, iZ, ModBlocks.pile_block, BlockPile.META_CORE, 3);
|
||||
TileEntityPileCore core = (TileEntityPileCore) world.getTileEntity(iX, iY, iZ);
|
||||
core.orientation = PileOrientation.getOrientation(dir);
|
||||
core.setupSize(posHeight + negHeight + 1, left, right, depth + 1);
|
||||
core.setupSize(posHeight, negHeight, left, right, depth + 1);
|
||||
} else {
|
||||
int edgeCount = 0;
|
||||
if(h == -negHeight || h == posHeight) edgeCount++;
|
||||
|
||||
@ -9,7 +9,7 @@ import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.NTMSounds;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileControl;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileDeviceBase;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileCore;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileLoader;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileVent;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
@ -157,14 +157,20 @@ public class BlockPileDevice extends BlockContainer implements IBlockMulti, ILoo
|
||||
List<String> text = new ArrayList();
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile instanceof TileEntityPileDeviceBase) {
|
||||
/*if(tile instanceof TileEntityPileDeviceBase) {
|
||||
TileEntityPileDeviceBase device = (TileEntityPileDeviceBase) tile;
|
||||
text.add("#" + (device.chanNum + 1));
|
||||
}
|
||||
}*/
|
||||
|
||||
if(tile instanceof TileEntityPileLoader) {
|
||||
TileEntityPileLoader device = (TileEntityPileLoader) tile;
|
||||
text.add("Temp: " + (int) Math.round(device.channelTemp) + " / " + TileEntityPileCore.MAX_HEAT + "°C");
|
||||
if(device.syncStack != null) text.add("Loading: " + device.syncStack.getDisplayName());
|
||||
|
||||
if(device.channelStack != null) {
|
||||
text.add("Last rod: " + device.channelStack.getDisplayName());
|
||||
if(device.channelDepletion > 0) text.add("Depletion: " + (int) Math.round(device.channelDepletion) + "%");
|
||||
}
|
||||
}
|
||||
|
||||
if(tile instanceof TileEntityPileControl) {
|
||||
|
||||
@ -37,11 +37,11 @@ public class ItemPileRodMK2 extends ItemEnumMulti {
|
||||
public static enum EnumPileRod {
|
||||
/* 0 */ RA226BE(1D),
|
||||
/* 1 */ PO210BE(1D),
|
||||
/* 2 */ ZR( 0D, 0D, 0D, 2),
|
||||
/* 3 */ NU( 1D, 1_000D, 1D, 4),
|
||||
/* 4 */ PU239( 1D, 1_000D, 1D, 5),
|
||||
/* 5 */ RGP( 1D, 1_000D, 1D, 6),
|
||||
/* 6 */ WASTE( 1D, 0D, 1D, 6);
|
||||
/* 2 */ ZR( 0D, 0D, 0D, 2),
|
||||
/* 3 */ NU( 1D, 25_000D, 0.25D, 4),
|
||||
/* 4 */ PU239( 1D, 500D, 0.5D, 5),
|
||||
/* 5 */ RGP( 1D, 1_000D, 0.5D, 6),
|
||||
/* 6 */ WASTE( 1D, 0D, 1.5D, 6);
|
||||
|
||||
public double reactionMult = 1.0D;
|
||||
public double life = 1_000D;
|
||||
@ -66,6 +66,13 @@ public class ItemPileRodMK2 extends ItemEnumMulti {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
EnumPileRod rod = EnumUtil.grabEnumSafely(EnumPileRod.class, stack.getItemDamage());
|
||||
|
||||
if(rod.life > 0) {
|
||||
list.add("Lifetime: " + (int) Math.round(rod.life));
|
||||
double depletion = getDepletionPercent(stack);
|
||||
if(depletion > 0) list.add("Depletion: " + (int) Math.round(depletion) + "%");
|
||||
}
|
||||
|
||||
for(String loc : I18nUtil.autoBreak(Minecraft.getMinecraft().fontRenderer, I18nUtil.resolveKey(this.getUnlocalizedName(stack) + ".desc"), 225)) {
|
||||
list.add(EnumChatFormatting.YELLOW + loc);
|
||||
@ -85,6 +92,14 @@ public class ItemPileRodMK2 extends ItemEnumMulti {
|
||||
return getDepletion(stack) / life;
|
||||
}
|
||||
|
||||
public static double getDepletionPercent(ItemStack stack) {
|
||||
if(stack == null) return 0D;
|
||||
EnumPileRod rod = EnumUtil.grabEnumSafely(EnumPileRod.class, stack.getItemDamage());
|
||||
double life = rod.life;
|
||||
if(life <= 0) return 0D;
|
||||
return (getDepletion(stack) / life) * 100;
|
||||
}
|
||||
|
||||
public static double getDepletion(ItemStack stack) {
|
||||
if(!stack.hasTagCompound()) return 0D;
|
||||
return stack.stackTagCompound.getDouble(KEY_NBT_DEPLETION);
|
||||
|
||||
@ -33,6 +33,7 @@ import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.weapon.sedna.*;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileCore;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBatterySocket;
|
||||
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
@ -250,6 +251,8 @@ public class GunFactoryClient {
|
||||
setRendererBulk(LegoClient.RENDER_FRAGMENTATION, ItemGrenadeFilling.fragmentation, ItemGrenadeFilling.pellets, ItemGrenadeFilling.pellets_heavy);
|
||||
ItemGrenadeFilling.laser.setRendererBeam(LegoClient.RENDER_LASER_RED);
|
||||
|
||||
TileEntityPileCore.pile_debris.setRenderer(LegoClient.RENDER_GRAPHITE);
|
||||
|
||||
//HUDS
|
||||
((ItemGunBaseNT) ModItems.gun_debug) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO, LegoClient.HUD_COMPONENT_AMMO_SECOND);
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.items.weapon.sedna.hud.HUDComponentDurabilityBar;
|
||||
import com.hbm.items.weapon.sedna.impl.ItemGunChargeThrower;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.entity.projectile.RenderRBMKDebris;
|
||||
import com.hbm.render.item.weapon.sedna.ItemRenderFatMan;
|
||||
import com.hbm.render.tileentity.RenderArcFurnace;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
@ -210,6 +211,14 @@ public class LegoClient {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_GRAPHITE = (bullet, interp) -> {
|
||||
GL11.glScalef(2F, 2F, 2F);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(RenderRBMKDebris.tex_graphite);
|
||||
ResourceManager.deb_graphite.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_GRENADE = (bullet, interp) -> {
|
||||
GL11.glScalef(0.25F, 0.25F, 0.25F);
|
||||
GL11.glRotated(90, 0, 0, 1);
|
||||
|
||||
@ -134,7 +134,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModItems.gas_empty, 2), new Object[] { "S ", "AA", "AA", 'A', STEEL.plate(), 'S', CU.plate() });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.block_waste_painted, 1), new Object[] { KEY_YELLOW, ModBlocks.block_waste });
|
||||
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.ingot_aluminium, 1), new Object[] { "###", "###", "###", '#', AL.wireFine() });
|
||||
addRecipeAuto(new ItemStack(ModItems.ingot_copper, 1), new Object[] { "###", "###", "###", '#', CU.wireFine() });
|
||||
addRecipeAuto(new ItemStack(ModItems.ingot_tungsten, 1), new Object[] { "###", "###", "###", '#', W.wireFine() });
|
||||
@ -312,6 +311,10 @@ public class CraftingManager {
|
||||
addRecipeAuto(DictFrame.fromOne(ModItems.arc_electrode, EnumElectrodeType.DESH), new Object[] { "C", "T", "C", 'C', DESH.ingot(), 'T', W.ingot() });
|
||||
addRecipeAuto(DictFrame.fromOne(ModItems.arc_electrode, EnumElectrodeType.SATURNITE), new Object[] { "C", "T", "C", 'C', BIGMT.ingot(), 'T', NB.ingot() });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.pile_device, 1, 0), new Object[] { " A ", "CBS", 'A', AL.plate(), 'C', STEEL.plateCast(), 'B', B.ingot(), 'S', STEEL.shell() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.pile_device, 1, 1), new Object[] { " M ", "ACA", " S ", 'M', ModItems.motor, 'A', AL.plate(), 'C', CU.shell(), 'S', STEEL.plateCast() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.pile_device, 1, 2), new Object[] { " B ", "SBS", "SBS", 'B', B.ingot(), 'S', STEEL.plate() });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.detonator, 1), new Object[] { "C", "S", 'S', STEEL.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), });
|
||||
addShapelessAuto(new ItemStack(ModItems.detonator_multi, 1), new Object[] { ModItems.detonator, DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
|
||||
addShapelessAuto(new ItemStack(ModItems.detonator_laser, 1), new Object[] { ModItems.rangefinder, DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), RUBBER.ingot(), GOLD.wireDense() });
|
||||
|
||||
@ -14,12 +14,12 @@ import net.minecraft.util.ResourceLocation;
|
||||
public class RenderRBMKDebris extends Render {
|
||||
|
||||
//for fallback only
|
||||
private static final ResourceLocation tex_base = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_side.png");
|
||||
private static final ResourceLocation tex_element = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_fuel.png");
|
||||
private static final ResourceLocation tex_control = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_control.png");
|
||||
private static final ResourceLocation tex_blank = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_blank_side.png");
|
||||
private static final ResourceLocation tex_lid = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_blank_cover_top.png");
|
||||
private static final ResourceLocation tex_graphite = new ResourceLocation(RefStrings.MODID + ":textures/blocks/block_graphite.png");
|
||||
public static final ResourceLocation tex_base = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_side.png");
|
||||
public static final ResourceLocation tex_element = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_fuel.png");
|
||||
public static final ResourceLocation tex_control = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_control.png");
|
||||
public static final ResourceLocation tex_blank = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_blank_side.png");
|
||||
public static final ResourceLocation tex_lid = new ResourceLocation(RefStrings.MODID + ":textures/blocks/rbmk/rbmk_blank_cover_top.png");
|
||||
public static final ResourceLocation tex_graphite = new ResourceLocation(RefStrings.MODID + ":textures/blocks/block_graphite.png");
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
@ -14,7 +14,6 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.redstoneoverradio.IRORValueProvider;
|
||||
import api.hbm.redstoneoverradio.IRORInteractive;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@ -3,30 +3,35 @@ package com.hbm.tileentity.machine.pile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachinePWRController;
|
||||
import com.hbm.blocks.machine.pile.BlockPile;
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.items.machine.ItemPileRodMK2;
|
||||
import com.hbm.items.machine.ItemPileRodMK2.EnumPileRod;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.NTMSounds;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.packet.toclient.PlayerInformPacket;
|
||||
import com.hbm.particle.helper.FlameCreator;
|
||||
import com.hbm.tileentity.TileEntityTickingBase;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@NotableComments
|
||||
@ -65,11 +70,16 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
|
||||
public int left;
|
||||
public int right;
|
||||
public int up;
|
||||
/**
|
||||
* Segments are fuel and control channels grouped by vertical slices viewed from the front, this makes the simulation part easier.
|
||||
*/
|
||||
public PileSegment[] segments = new PileSegment[0];
|
||||
|
||||
public double highestHeat;
|
||||
public static final int MAX_HEAT = 800;
|
||||
public static boolean meltingDown = false;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
@ -78,16 +88,19 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
depth = nbt.getInteger("depth");
|
||||
left = nbt.getInteger("left");
|
||||
right = nbt.getInteger("right");
|
||||
up = nbt.getInteger("up");
|
||||
|
||||
orientation = EnumUtil.grabEnumSafely(PileOrientation.class, nbt.getInteger("orientation"));
|
||||
|
||||
segments = new PileSegment[width];
|
||||
|
||||
int fuelCount = nbt.getByte("fc");
|
||||
int ventCount = nbt.getByte("vc");
|
||||
int contCount = nbt.getByte("cc");
|
||||
|
||||
fuelChannels.clear();
|
||||
ventilationChannels.clear();
|
||||
controlChannels.clear();
|
||||
|
||||
int fuelCount = nbt.getByte("fc");
|
||||
int ventCount = nbt.getByte("vc");
|
||||
int contCount = nbt.getByte("cc");
|
||||
|
||||
for(int i = 0; i < fuelCount; i++) fuelChannels.add(readChannelFromNBT(nbt, "f" + i));
|
||||
for(int i = 0; i < ventCount; i++) ventilationChannels.add(readChannelFromNBT(nbt, "v" + i));
|
||||
@ -104,6 +117,9 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
nbt.setInteger("depth", depth);
|
||||
nbt.setInteger("left", left);
|
||||
nbt.setInteger("right", right);
|
||||
nbt.setInteger("up", up);
|
||||
|
||||
nbt.setInteger("orientation", orientation.ordinal());
|
||||
|
||||
int fuelCount = fuelChannels.size();
|
||||
int ventCount = ventilationChannels.size();
|
||||
@ -135,12 +151,13 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
return list.indexOf(chan); // more reliable when channels change and not that big of a deal because we have lists in single digit length
|
||||
}
|
||||
|
||||
public TileEntityPileCore setupSize(int h, int l, int r, int d) {
|
||||
this.height = h;
|
||||
public TileEntityPileCore setupSize(int up, int down, int l, int r, int d) {
|
||||
this.height = up + 1 + down;
|
||||
this.width = l + 1 + r;
|
||||
this.depth = d;
|
||||
this.left = l;
|
||||
this.right = r;
|
||||
this.up = up;
|
||||
this.segments = new PileSegment[width];
|
||||
return this;
|
||||
}
|
||||
@ -228,8 +245,23 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
|
||||
this.runSimulation();
|
||||
this.handleVentilation();
|
||||
this.handleMeltdown();
|
||||
|
||||
this.networkPackNT(25);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeDouble(this.highestHeat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.highestHeat = buf.readDouble();
|
||||
}
|
||||
|
||||
protected void runSimulation() {
|
||||
|
||||
@ -237,7 +269,6 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
for(PileChannel chan : this.fuelChannels) {
|
||||
if(chan.length <= 0) continue;
|
||||
double producedNeutrons = 0;
|
||||
double latestDepletion = 0D;
|
||||
|
||||
for(int i = 0; i < chan.rods.length; i++) {
|
||||
ItemStack stack = chan.rods[i];
|
||||
@ -246,25 +277,10 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
producedNeutrons += neut;
|
||||
chan.heat += neut * ItemPileRodMK2.getHeatPerNeutron(stack);
|
||||
chan.rods[i] = ItemPileRodMK2.react(stack, neut);
|
||||
EnumPileRod rod = EnumUtil.grabEnumSafely(EnumPileRod.class, stack.getItemDamage());
|
||||
double life = rod.life < 1 ? 1 : rod.life;
|
||||
latestDepletion = ItemPileRodMK2.getDepletion(chan.rods[i]) / life;
|
||||
}
|
||||
}
|
||||
chan.outgoingNeutrons = producedNeutrons;
|
||||
chan.incomingNeutrons = 0;
|
||||
|
||||
/// DEBUG ///
|
||||
int hash = BlockPos.getIdentity(xCoord, yCoord, zCoord);
|
||||
|
||||
for(Object o : worldObj.playerEntities) {
|
||||
if(o instanceof EntityPlayerMP) {
|
||||
EntityPlayerMP player = (EntityPlayerMP) o;
|
||||
int index = this.getFuelChannelNum(chan);
|
||||
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket("#" + index + " " + Math.round(chan.heat) + "TU " + Math.round(chan.outgoingNeutrons) + "n " + Math.round(latestDepletion * 100) + "%", hash + index), player);
|
||||
}
|
||||
}
|
||||
/// DEBUG ///
|
||||
}
|
||||
|
||||
// intra-segment propagation
|
||||
@ -313,7 +329,7 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
|
||||
for(PileChannel fuel : this.fuelChannels) {
|
||||
if(Math.abs(fuel.entry.getY() - chan.entry.getY()) <= 1) {
|
||||
fuel.heat *= (1D - airCap * 0.5D); // channel can hold up to 1000mB, turning into a 0.5 heat mult for connected fuel channels
|
||||
fuel.heat *= (1D - airCap * 0.05D); // channel can hold up to 1000mB, turning into a 0.95 heat mult for connected fuel channels
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,6 +354,40 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
data.setInteger("color", 0xa0a0a0);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
|
||||
}
|
||||
|
||||
for(PileChannel chan : this.fuelChannels) {
|
||||
chan.heat *= 0.999;
|
||||
if(chan.heat < 20) chan.heat = 20;
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleMeltdown() {
|
||||
|
||||
this.highestHeat = 0;
|
||||
for(PileChannel chan : this.fuelChannels) {
|
||||
if(chan.heat > this.highestHeat) this.highestHeat = chan.heat;
|
||||
}
|
||||
|
||||
if(this.highestHeat > this.MAX_HEAT) {
|
||||
this.destroy();
|
||||
double avgX = 0;
|
||||
double avgZ = 0;
|
||||
for(PileChannel chan : this.fuelChannels) {
|
||||
avgX += chan.entry.getX() + 0.5 + chan.entry.getDir().offsetX * (chan.length - 1) / 2D;
|
||||
avgZ += chan.entry.getZ() + 0.5 + chan.entry.getDir().offsetZ * (chan.length - 1) / 2D;
|
||||
}
|
||||
avgX /= this.fuelChannels.size();
|
||||
avgZ /= this.fuelChannels.size();
|
||||
meltingDown = true;
|
||||
worldObj.newExplosion(null, avgX, yCoord + up, avgZ, 15F, true, true);
|
||||
meltingDown= false;
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
double mY = worldObj.rand.nextDouble() * 0.5 + 1D;
|
||||
EntityBulletBaseMK4 fragment = new EntityBulletBaseMK4(worldObj, null, pile_debris, 100F, 0.35F, avgX, yCoord + up + 1, avgZ, 0, mY, 0);
|
||||
worldObj.spawnEntityInWorld(fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void recalculateSegments() {
|
||||
@ -440,29 +490,29 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
nbt.setInteger(name + "_y", entry.getY());
|
||||
nbt.setInteger(name + "_z", entry.getZ());
|
||||
nbt.setByte(name + "_d", (byte) entry.getDir().ordinal());
|
||||
|
||||
|
||||
if(type == type.FUEL) {
|
||||
NBTTagList list = new NBTTagList();
|
||||
for(int i = 0; i < rods.length; i++) {
|
||||
if(rods[i] != null) {
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
nbt1.setByte("slot", (byte) i);
|
||||
rods[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
nbt.setTag(name + "items", list);
|
||||
|
||||
nbt.setDouble("heat", heat);
|
||||
nbt.setDouble("neutrons", incomingNeutrons);
|
||||
nbt.setDouble(name + "heat", heat);
|
||||
nbt.setDouble(name + "neutrons", incomingNeutrons);
|
||||
}
|
||||
|
||||
if(type == type.VENTILATION) {
|
||||
nbt.setInteger("air", air);
|
||||
nbt.setInteger(name + "air", air);
|
||||
}
|
||||
|
||||
if(type == type.CONTROL) {
|
||||
nbt.setDouble("control", control);
|
||||
nbt.setDouble(name + "control", control);
|
||||
}
|
||||
}
|
||||
|
||||
@ -490,6 +540,11 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
int y = entry.getY();
|
||||
int z = entry.getZ() + entry.getDir().offsetZ * depth;
|
||||
|
||||
if(stack.hasTagCompound() && stack.stackTagCompound.hasKey(ItemPileRodMK2.KEY_NBT_DEPLETION)) {
|
||||
stack.stackTagCompound.removeTag(ItemPileRodMK2.KEY_NBT_DEPLETION);
|
||||
if(stack.stackTagCompound.hasNoTags()) stack.stackTagCompound = null;
|
||||
}
|
||||
|
||||
EntityItem item = new EntityItem(worldObj, x + 0.5, y + 0.5, z + 0.5, stack);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
@ -502,9 +557,9 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(nbt.getByte(name + "_d"));
|
||||
|
||||
PileChannel chan = new PileChannel(x, y, z, dir);
|
||||
|
||||
|
||||
if(chan.type == chan.type.FUEL) {
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
NBTTagList list = nbt.getTagList(name + "items", 10);
|
||||
for(int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
@ -513,16 +568,16 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
}
|
||||
}
|
||||
|
||||
chan.heat = nbt.getDouble("heat");
|
||||
chan.incomingNeutrons = nbt.getDouble("neutrons");
|
||||
chan.heat = nbt.getDouble(name + "heat");
|
||||
chan.incomingNeutrons = nbt.getDouble(name + "neutrons");
|
||||
}
|
||||
|
||||
if(chan.type == chan.type.VENTILATION) {
|
||||
chan.air = nbt.getInteger("air");
|
||||
chan.air = nbt.getInteger(name + "air");
|
||||
}
|
||||
|
||||
if(chan.type == chan.type.CONTROL) {
|
||||
chan.control = nbt.getDouble("control");
|
||||
chan.control = nbt.getDouble(name + "control");
|
||||
}
|
||||
|
||||
return chan;
|
||||
@ -569,4 +624,19 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
return MathHelper.clamp_double(total / size, 0D, 0.5D);
|
||||
}
|
||||
}
|
||||
|
||||
public static BulletConfig pile_debris;
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_EXPLODE = (bullet, mop) -> {
|
||||
bullet.worldObj.newExplosion(bullet, bullet.posX, bullet.posY, bullet.posZ, 5F, true, false);
|
||||
bullet.setDead();
|
||||
};
|
||||
|
||||
public static Consumer<Entity> LAMBDA_FIRE = (bullet) -> {
|
||||
if(bullet.worldObj.isRemote && MainRegistry.proxy.me().getDistanceToEntity(bullet) < 100) FlameCreator.composeEffectClient(bullet.worldObj, bullet.posX, bullet.posY - 0.125, bullet.posZ, FlameCreator.META_FIRE);
|
||||
};
|
||||
|
||||
static {
|
||||
pile_debris = new BulletConfig().setLife(200).setVel(1F).setGrav(0.1D).setOnUpdate(LAMBDA_FIRE).setOnImpact(LAMBDA_STANDARD_EXPLODE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,10 +3,14 @@ package com.hbm.tileentity.machine.pile;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.pile.BlockPile;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemPileRodMK2;
|
||||
import com.hbm.items.machine.ItemPileRodMK2.EnumPileRod;
|
||||
import com.hbm.main.NTMSounds;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileCore.PileChannel;
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import api.hbm.redstoneoverradio.IRORValueProvider;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -15,7 +19,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPileLoader extends TileEntityPileDeviceBase implements ISidedInventory{
|
||||
public class TileEntityPileLoader extends TileEntityPileDeviceBase implements ISidedInventory, IRORValueProvider {
|
||||
|
||||
public double syncLevel;
|
||||
public double level;
|
||||
@ -30,6 +34,10 @@ public class TileEntityPileLoader extends TileEntityPileDeviceBase implements IS
|
||||
public ItemStack syncStack;
|
||||
public ItemStack stack;
|
||||
public boolean wasRedstone;
|
||||
|
||||
public ItemStack channelStack;
|
||||
public double channelDepletion;
|
||||
public double channelTemp;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
@ -38,6 +46,9 @@ public class TileEntityPileLoader extends TileEntityPileDeviceBase implements IS
|
||||
|
||||
ForgeDirection dir = getOrientation();
|
||||
PileChannel fuelChan = null;
|
||||
this.channelStack = null;
|
||||
this.channelDepletion = 0D;
|
||||
this.channelTemp = 0D;
|
||||
|
||||
int x = xCoord - dir.offsetX;
|
||||
int y = yCoord;
|
||||
@ -55,6 +66,9 @@ public class TileEntityPileLoader extends TileEntityPileDeviceBase implements IS
|
||||
|
||||
if(fuelChan != null) {
|
||||
this.chanNum = core.getFuelChannelNum(fuelChan);
|
||||
this.channelStack = fuelChan.rods[fuelChan.rods.length - 1];
|
||||
this.channelDepletion = ItemPileRodMK2.getDepletionPercent(channelStack);
|
||||
this.channelTemp = fuelChan.heat;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -114,12 +128,23 @@ public class TileEntityPileLoader extends TileEntityPileDeviceBase implements IS
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeDouble(this.level);
|
||||
|
||||
if(this.stack != null) {
|
||||
buf.writeInt(Item.getIdFromItem(this.stack.getItem()));
|
||||
buf.writeShort(this.stack.getItemDamage());
|
||||
} else {
|
||||
buf.writeInt(-1);
|
||||
}
|
||||
|
||||
if(this.channelStack != null) {
|
||||
buf.writeInt(Item.getIdFromItem(this.channelStack.getItem()));
|
||||
buf.writeShort(this.channelStack.getItemDamage());
|
||||
} else {
|
||||
buf.writeInt(-1);
|
||||
}
|
||||
|
||||
buf.writeDouble(this.channelDepletion);
|
||||
buf.writeDouble(this.channelTemp);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -127,9 +152,17 @@ public class TileEntityPileLoader extends TileEntityPileDeviceBase implements IS
|
||||
super.deserialize(buf);
|
||||
double lastSync = this.syncLevel;
|
||||
this.syncLevel = buf.readDouble();
|
||||
|
||||
int itemId = buf.readInt();
|
||||
if(itemId != -1) this.syncStack = new ItemStack(Item.getItemById(itemId), 1, buf.readShort());
|
||||
else this.syncStack = null;
|
||||
|
||||
int chanId = buf.readInt();
|
||||
if(chanId != -1) this.channelStack = new ItemStack(Item.getItemById(chanId), 1, buf.readShort());
|
||||
else this.channelStack = null;
|
||||
|
||||
this.channelDepletion = buf.readDouble();
|
||||
this.channelTemp = buf.readDouble();
|
||||
|
||||
if(this.syncLevel != lastSync) this.turnProgress = 2;
|
||||
}
|
||||
@ -169,4 +202,40 @@ public class TileEntityPileLoader extends TileEntityPileDeviceBase implements IS
|
||||
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return isItemLoadable(stack); }
|
||||
@Override public boolean canInsertItem(int slot, ItemStack stack, int side) { return isItemLoadable(stack); }
|
||||
@Override public boolean canExtractItem(int slot, ItemStack stack, int side) { return false; }
|
||||
|
||||
@Override
|
||||
public String[] getFunctionInfo() {
|
||||
return new String[] {
|
||||
PREFIX_VALUE + "meta",
|
||||
PREFIX_VALUE + "depletion",
|
||||
PREFIX_VALUE + "deppercent",
|
||||
PREFIX_VALUE + "lifetime",
|
||||
PREFIX_VALUE + "temp",
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String provideRORValue(String name) {
|
||||
|
||||
if(name.equals(PREFIX_VALUE + "meta")) {
|
||||
return this.channelStack == null ? "-1" : this.channelStack.getItemDamage() + "";
|
||||
}
|
||||
if(name.equals(PREFIX_VALUE + "deppercent")) {
|
||||
return "" + (int) Math.round(this.channelDepletion);
|
||||
}
|
||||
if(name.equals(PREFIX_VALUE + "depletion")) {
|
||||
if(this.channelStack == null) return "0";
|
||||
return "" + (int) Math.round(ItemPileRodMK2.getDepletionPercent(this.channelStack));
|
||||
}
|
||||
if(name.equals(PREFIX_VALUE + "lifetime")) {
|
||||
if(this.channelStack == null) return "0";
|
||||
EnumPileRod rod = EnumUtil.grabEnumSafely(EnumPileRod.class, this.channelStack.getItemDamage());
|
||||
return "" + (int) Math.round(rod.life);
|
||||
}
|
||||
if(name.equals(PREFIX_VALUE + "meta")) {
|
||||
return "" + (int) Math.round(this.channelTemp);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsJSpawnWeight : 0;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("tower_base") {{
|
||||
canSpawn = biome -> biome.heightVariation <= 0.3F && !isInvalidBiome(biome);
|
||||
canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome);
|
||||
structure = new JigsawPiece("tower_base", StructureManager.tower_base, -6);
|
||||
spawnWeight = StructureConfig.towerBaseSpawnWeight;
|
||||
}});
|
||||
|
||||
@ -495,26 +495,21 @@ public class LogicBlockActions {
|
||||
if(tile.phase == 1) {
|
||||
world.setBlock(x, y, z, ModBlocks.skeleton_holder);
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
EntityPlayer player = (EntityPlayer) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(25, 25, 25)).get(0);
|
||||
|
||||
if (te instanceof BlockSkeletonHolder.TileEntitySkeletonHolder) {
|
||||
if(te instanceof BlockSkeletonHolder.TileEntitySkeletonHolder) {
|
||||
BlockSkeletonHolder.TileEntitySkeletonHolder skeleton = (BlockSkeletonHolder.TileEntitySkeletonHolder) te;
|
||||
int roll = world.rand.nextInt(100);
|
||||
int roll = world.rand.nextInt(100);
|
||||
|
||||
if (roll < 44) {
|
||||
skeleton.item = new ItemStack(ModItems.ammo_standard, 3, 91);
|
||||
|
||||
} else if (roll < 71) {
|
||||
skeleton.item = new ItemStack(ModItems.ammo_standard, 1, 92);
|
||||
|
||||
} else if (roll < 92) {
|
||||
skeleton.item = new ItemStack(ModItems.ammo_standard, 1, 73);
|
||||
|
||||
} else if (roll < 96) {
|
||||
skeleton.item = new ItemStack(ModItems.item_secret, 1, 3);
|
||||
|
||||
} else {
|
||||
skeleton.item = new ItemStack(ModItems.item_secret, 1, 4);
|
||||
if(roll < 44) {
|
||||
skeleton.item = new ItemStack(ModItems.ammo_standard, 3, 91);
|
||||
} else if(roll < 71) {
|
||||
skeleton.item = new ItemStack(ModItems.ammo_standard, 1, 92);
|
||||
} else if(roll < 92) {
|
||||
skeleton.item = new ItemStack(ModItems.ammo_standard, 1, 73);
|
||||
} else if(roll < 96) {
|
||||
skeleton.item = new ItemStack(ModItems.item_secret, 1, 3);
|
||||
} else {
|
||||
skeleton.item = new ItemStack(ModItems.item_secret, 1, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -539,7 +534,7 @@ public class LogicBlockActions {
|
||||
actions.put("BOMB_TRAP", BOMB_TRAP);
|
||||
actions.put("BOMB_CRANE", BOMB_CRANE);
|
||||
actions.put("DEAD_GUY_CRANE", DEAD_GUY_CRANE);
|
||||
actions.put("DEAD_GUY_TOWER_BASE", DEAD_GUY_TOWER_BASE);
|
||||
//actions.put("DEAD_GUY_TOWER_BASE", DEAD_GUY_TOWER_BASE);
|
||||
|
||||
//Mob Block Actions
|
||||
actions.put("SKELETON_GUN_TIER_1", SKELETONS_GUN_TIER_1);
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/nr_planks.png
Normal file
BIN
src/main/resources/assets/hbm/textures/blocks/nr_planks.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 839 B |
Binary file not shown.
|
Before Width: | Height: | Size: 134 B |
Binary file not shown.
|
Before Width: | Height: | Size: 547 B |
Binary file not shown.
|
Before Width: | Height: | Size: 607 B |
Loading…
x
Reference in New Issue
Block a user