Merge remote-tracking branch 'upstream/master' into Optimization

This commit is contained in:
BallOfEnergy 2025-03-28 18:06:33 -05:00
commit b1a778c949
190 changed files with 4085 additions and 1245 deletions

View File

@ -12,7 +12,7 @@
* NTM Reloaded: https://github.com/TheOriginalGolem/Hbm-s-Nuclear-Tech-GIT/releases
* NTM Extended Edition (Alcater): https://github.com/Alcatergit/Hbm-s-Nuclear-Tech-GIT/releases
* NTM WarFactory: https://github.com/MisterNorwood/Hbm-s-Nuclear-Tech-GIT/releases
* NTM Community Edition (WarFactory): https://codeberg.org/MrNorwood/Hbm-s-Nuclear-Tech-CE
For 1.18, try Martin's remake: https://codeberg.org/MartinTheDragon/Nuclear-Tech-Mod-Remake/releases

View File

@ -1,58 +1,17 @@
## Added
* `/ntmserver`
* Functions like `/ntmclient` but for common settings
* Can toggle `DAMAGE_COMPATIBILITY_MODE`, off by default, enables a more compatible (but slightly jankier) version of the bullet damage code
* `MINE_<xxx>_DAMAGE` can be used to adjust landmine damage
* `TAINT_TRAILS` now replaces the hardcore taint config option, making taint blocks more potent and the potion effect trail taint blocks
* New ammo types
* Explosive 7.62mm
* Explosive .50 BMG
* Explosive 10 gauge buckshot (unlike 12 gauge which has explosive slugs)
* Lincoln's repeater, a b-side to the lever action rifle
* Weapon modification table
* All weapon tiers have generic upgrades for increasing damage and durability
* Many guns have specialized attachments. Some examples:
* The assault rifle can use silencers, scopes, can have its stock removed and has two different polymer furnitures
* .44 revolvers can use scopes
* All full-length shotguns can have their barrel sawed off
* Most shotguns can make use of a choke to decrease projectile spread (does not work with sawed-offs)
* The grease gun has a modernization package, replacing most parts and increasing most stats
* Some guns have special mod combos that will change the name
## Changed
* Fat mines now use the standardized mini nuke code
* Fat mines now have a base damage of exactly 100, being identical to demolition mini nukes
* Fat mines now gib affected entities
* IV bags now use `setHealth` operations instead of dealing damage, preventing health duplication by just avoiding the damage
* The settings tool can now copy and paste the "paint" from paintable cables and fluid ducts
* Changed the way taint works
* Instead of neon purple vines, taint is bow a greyish sludge
* Taint now actively replaces blocks instead of growing along them
* Taint is still limited in spread, however taint spread is lower underground, taint decays three times faster in intensity if the block is not exposed to air, making taint spread more along the surface
* Taint has a 25% chance of splashing down when replacing a block with no supports, causing structures to collapse and taint to spread faster
* Similar to soil sand, entities will sink in taint and get slowed down
* The sludge consumeth
* `enableGuns` config option now applies to SEDNA system guns, simply canceling all gun-related keybinds
* Cinnabar dust, if registered by another mod, can now be acidized into cinnabar using hydrogen peroxide
* Copper wires, like AA and gold, can now be welded into dense wires
* Removed the crafting recipe for the small geothermal generator and ZPE generators
* Removed the gemothermal, ZPE and ambient radiation generators from the creative menu
* Disabled the horrid flicker on the quad rocket launcher's antenna, making steered mode look less terrible
* All non-legendary .357 revolvers now fire a quarter of a second faster
* Changed the detonator's recipe to be less archaic
* Crates can now be opened when held
* Crates will not longer show their contents when locked
* Crates found in structures will sometimes contain things that aren't items
* .75 bolts now work as advertised
* Updated lead pipe texture
* Removed recipes from a few ancient melee weapons, as well as the creative tab listing
* Removed flat magnets
* Taint should now also affect non-solid blocks that are full cubes
* Reduced the AoE size of 7.62mm, .50 BMG and 10 gauge explosive projectiles
* Removed the old gun mechanism items, turrets now use the new cast parts
* A secret weapon and its variant have become craftable
* NEI now shows RBMK fuel rod recycling and cooling
* Removed most of the old unused siege mobs
## Fixed
* Fixed animation errors on the MAS-36
* Fixed drone docks, requester and provider crates not dropping their contents when broken
* Fixed all missing texture errors that appear in the startup log
* Potentially fixed a crash with mekanism during the recipe change phase
* Removed the coke to heavy oil recipe for allowing infinite oil loops
* Coke to syngas and coalgas recipes should be fine though, so they stay
* Potentially fixed another issue regarding NPCs firing belt-fed guns
* Chunk-loading drones may or may not be fixed
* Fixed disperser canisters not actually despawning on impact, endlessly spawning mist clouds
* Fixed issues where the new packet system didn't play nice with machines that are being sent packets by other machines, like watz segments and radar screens
* Fixed fat man's piston not being extended correctly in non-first person rendering when unloaded
* Fixed taint destroying bedrock
* Fixed ferrouranium plate not being castable
* Fixed bayonet not rendering properly in third person
* Fixed xenon poison gauge in the RBMK control panel not showing up on colums (oops)

View File

@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=5257
mod_build_number=5279
credits=HbMinecraft,\
\ rodolphito (explosion algorithms),\

View File

@ -18,7 +18,7 @@ public interface IFluidStandardReceiver extends IFluidStandardReceiverMK2 {
public default void subscribeToAllAround(FluidType type, World world, int x, int y, int z) {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
trySubscribe(type, world, x, y, z, dir);
trySubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
}
}

View File

@ -88,9 +88,11 @@ public class FluidNetMK2 extends NodeNet<IFluidReceiverMK2, IFluidProviderMK2, F
for(int p = 0; p <= IFluidUserMK2.HIGHEST_VALID_PRESSURE; p++) { // if the pressure range were ever to increase, we might have to rethink this
long totalAvailable = fluidAvailable[p];
for(int i = ConnectionPriority.values().length - 1; i >= 0; i--) {
long toTransfer = Math.min(fluidDemand[p][i], fluidAvailable[p]);
long toTransfer = Math.min(fluidDemand[p][i], totalAvailable);
if(toTransfer <= 0) continue;
long priorityDemand = fluidDemand[p][i];
@ -102,6 +104,8 @@ public class FluidNetMK2 extends NodeNet<IFluidReceiverMK2, IFluidProviderMK2, F
received[p] += toSend;
fluidTracker += toSend;
}
totalAvailable -= received[p];
}
notAccountedFor[p] = received[p];

View File

@ -46,7 +46,7 @@ public interface IFluidStandardSenderMK2 extends IFluidProviderMK2 {
}
}
if(te instanceof IFluidReceiverMK2 && te != this) {
if(te != this && te instanceof IFluidReceiverMK2) {
IFluidReceiverMK2 rec = (IFluidReceiverMK2) te;
if(rec.canConnect(type, dir.getOpposite())) {
long provides = Math.min(this.getFluidAvailable(type, pressure), this.getProviderSpeed(type, pressure));

View File

@ -275,6 +275,7 @@ public class ModBlocks {
public static Block part_emitter;
public static Block deco_loot;
public static Block pedestal;
public static Block skeleton_holder;
public static Block bobblehead;
public static Block snowglobe;
public static Block plushie;
@ -1464,6 +1465,7 @@ public class ModBlocks {
part_emitter = new PartEmitter().setBlockName("part_emitter").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":part_top");
deco_loot = new BlockLoot().setBlockName("deco_loot").setCreativeTab(null).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
pedestal = new BlockPedestal().setBlockName("pedestal").setCreativeTab(null).setHardness(2.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":pedestal_top");
skeleton_holder = new BlockSkeletonHolder().setBlockName("skeleton_holder").setCreativeTab(null).setHardness(2.0F).setResistance(10.0F).setBlockTextureName("soul_sand");
bobblehead = new BlockBobble().setBlockName("bobblehead").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
snowglobe = new BlockSnowglobe().setBlockName("snowglobe").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":glass_boron");
plushie = new BlockPlushie().setBlockName("plushie").setStepSound(Block.soundTypeCloth).setResistance(50_0000.0F).setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_fiberglass_side");
@ -2608,6 +2610,7 @@ public class ModBlocks {
GameRegistry.registerBlock(part_emitter, ItemBlockBase.class, part_emitter.getUnlocalizedName());
GameRegistry.registerBlock(deco_loot, deco_loot.getUnlocalizedName());
GameRegistry.registerBlock(pedestal, pedestal.getUnlocalizedName());
register(skeleton_holder);
GameRegistry.registerBlock(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName());
GameRegistry.registerBlock(snowglobe, ItemBlockMeta.class, snowglobe.getUnlocalizedName());
GameRegistry.registerBlock(plushie, ItemBlockBase.class, plushie.getUnlocalizedName());

View File

@ -19,6 +19,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
@ -46,7 +47,7 @@ public class BlockTaint extends Block implements ITooltipProvider {
if(Math.abs(i) + Math.abs(j) + Math.abs(k) > 4) continue;
if(rand.nextFloat() > 0.25F) continue;
Block b = world.getBlock(x + i, y + j, z + k);
if(!b.isNormalCube() || b.isAir(world, x + i, y + j, z + k)) continue;
if(!b.renderAsNormalBlock() || b.isAir(world, x + i, y + j, z + k) || b == Blocks.bedrock) continue;
int targetMeta = meta + 1;
boolean hasAir = false;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {

View File

@ -4,6 +4,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.world.gen.INBTTransformable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -20,7 +21,7 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockModDoor extends Block {
public class BlockModDoor extends Block implements INBTTransformable {
@SideOnly(Side.CLIENT)
private IIcon[] field_150017_a;
@SideOnly(Side.CLIENT)
@ -396,4 +397,9 @@ public class BlockModDoor extends Block {
p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_);
}
}
@Override
public int transformMeta(int meta, int coordBaseMode) {
return INBTTransformable.transformMetaDoor(meta, coordBaseMode);
}
}

View File

@ -5,6 +5,8 @@ import java.util.Random;
import com.hbm.blocks.IBlockMulti;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.world.gen.INBTTileEntityTransformable;
import com.hbm.world.gen.INBTTransformable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -27,7 +29,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
public class BlockPlushie extends BlockContainer implements IBlockMulti, ITooltipProvider {
public class BlockPlushie extends BlockContainer implements IBlockMulti, ITooltipProvider, INBTTransformable {
public BlockPlushie() {
super(Material.cloth);
@ -104,7 +106,12 @@ public class BlockPlushie extends BlockContainer implements IBlockMulti, IToolti
}
}
public static class TileEntityPlushie extends TileEntity {
@Override
public int transformMeta(int meta, int coordBaseMode) {
return (meta + coordBaseMode * 4) % 16;
}
public static class TileEntityPlushie extends TileEntity implements INBTTileEntityTransformable {
public PlushieType type = PlushieType.NONE;
public int squishTimer;
@ -137,6 +144,11 @@ public class BlockPlushie extends BlockContainer implements IBlockMulti, IToolti
super.writeToNBT(nbt);
nbt.setByte("type", (byte) type.ordinal());
}
@Override
public void transformTE(World world, int coordBaseMode) {
type = PlushieType.values()[world.rand.nextInt(PlushieType.values().length - 1) + 1];
}
}
public static enum PlushieType {

View File

@ -0,0 +1,114 @@
package com.hbm.blocks.generic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockSkeletonHolder extends BlockContainer {
public BlockSkeletonHolder() {
super(Material.rock);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntitySkeletonHolder();
}
@Override public int getRenderType() { return -1; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) return true;
if(player.isSneaking()) return false;
TileEntitySkeletonHolder pedestal = (TileEntitySkeletonHolder) world.getTileEntity(x, y, z);
if(pedestal.item == null && player.getHeldItem() != null) {
pedestal.item = player.getHeldItem().copy();
player.inventory.mainInventory[player.inventory.currentItem] = null;
pedestal.markDirty();
world.markBlockForUpdate(x, y, z);
return true;
} else if(pedestal.item != null && player.getHeldItem() == null) {
player.inventory.mainInventory[player.inventory.currentItem] = pedestal.item.copy();
pedestal.item = null;
pedestal.markDirty();
world.markBlockForUpdate(x, y, z);
return true;
}
return false;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
if(!world.isRemote) {
TileEntitySkeletonHolder entity = (TileEntitySkeletonHolder) world.getTileEntity(x, y, z);
if(entity != null && entity.item != null) {
EntityItem item = new EntityItem(world, x + 0.5, y, z + 0.5, entity.item.copy());
world.spawnEntityInWorld(item);
}
}
super.breakBlock(world, x, y, z, block, meta);
}
public static class TileEntitySkeletonHolder extends TileEntity {
public ItemStack item;
@Override public boolean canUpdate() { return false; }
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
this.writeToNBT(nbt);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
this.readFromNBT(pkt.func_148857_g());
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.item = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item"));
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
if(this.item != null) {
NBTTagCompound stack = new NBTTagCompound();
this.item.writeToNBT(stack);
nbt.setTag("item", stack);
}
}
}
}

View File

@ -9,6 +9,7 @@ import com.hbm.blocks.IBlockSideRotation;
import com.hbm.blocks.ILookOverlay;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
@ -144,6 +145,8 @@ public class BlockWandJigsaw extends BlockContainer implements IBlockSideRotatio
return true;
}
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.wand_s) return false;
if(world.isRemote) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
return true;

View File

@ -12,6 +12,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.config.StructureConfig;
import com.hbm.itempool.ItemPool;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.BufferUtil;
import com.hbm.util.I18nUtil;
@ -248,6 +249,11 @@ public class BlockWandLoot extends BlockContainer implements ILookOverlay, ITool
}
private void replace() {
if(!(worldObj.getBlock(xCoord, yCoord, zCoord) instanceof BlockWandLoot)) {
MainRegistry.logger.warn("Somehow the block at: " + xCoord + ", " + yCoord + ", " + zCoord + " isn't a loot block but we're doing a TE update as if it is, cancelling!");
return;
}
WeightedRandomChestContent[] pool = ItemPool.getPool(poolName);
worldObj.setBlock(xCoord, yCoord, zCoord, replaceBlock, replaceMeta, 2);

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine;
import com.hbm.main.MainRegistry;
import com.hbm.world.gen.INBTTransformable;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
@ -16,7 +17,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public abstract class BlockMachineBase extends BlockContainer {
public abstract class BlockMachineBase extends BlockContainer implements INBTTransformable {
int guiID = -1;
protected boolean rotatable = false;
@ -110,4 +111,10 @@ public abstract class BlockMachineBase extends BlockContainer {
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
@Override
public int transformMeta(int meta, int coordBaseMode) {
if(!rotatable) return meta;
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
}
}

View File

@ -4,6 +4,7 @@ import java.util.Random;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineEPress;
import com.hbm.world.gen.INBTTransformable;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
@ -19,7 +20,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class MachineEPress extends BlockContainer {
public class MachineEPress extends BlockContainer implements INBTTransformable {
private final Random field_149933_a = new Random();
private static boolean keepInventory;
@ -120,4 +121,9 @@ public class MachineEPress extends BlockContainer {
return false;
}
}
@Override
public int transformMeta(int meta, int coordBaseMode) {
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
}
}

View File

@ -15,6 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -26,6 +27,8 @@ import net.minecraftforge.common.util.ForgeDirection;
public class Spotlight extends Block implements ISpotlight, INBTTransformable {
public static boolean disableOnGeneration = true;
// I'd be extending the ReinforcedLamp class if it wasn't for the inverted behaviour of these specific lights
// I want these blocks to be eminently useful, so removing the need for redstone by default is desired,
// these act more like redstone torches, in that applying a signal turns them off
@ -220,6 +223,31 @@ public class Spotlight extends Block implements ISpotlight, INBTTransformable {
return ForgeDirection.getOrientation(metadata >> 1);
}
// Replace bulbs on broken lights with a click
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
int meta = world.getBlockMetadata(x, y, z);
if(!isBroken(meta)) return false;
repair(world, x, y, z);
return true;
}
private void repair(World world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
if(!isBroken(meta)) return;
world.setBlock(x, y, z, getOn(), meta - 1, 2);
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
int ox = x + dir.offsetX;
int oy = y + dir.offsetY;
int oz = z + dir.offsetZ;
Block block = world.getBlock(ox, oy, oz);
if(block == this) repair(world, ox, oy, oz);
}
}
public boolean isBroken(int metadata) {
return (metadata & 1) == 1;
}
@ -326,11 +354,13 @@ public class Spotlight extends Block implements ISpotlight, INBTTransformable {
@Override
public int transformMeta(int meta, int coordBaseMode) {
// +1 to set as broken, won't turn on until broken and replaced
return (INBTTransformable.transformMetaDeco(meta >> 1, coordBaseMode) << 1) + 1;
int disabled = disableOnGeneration ? 1 : 0;
return (INBTTransformable.transformMetaDeco(meta >> 1, coordBaseMode) << 1) + disabled;
}
@Override
public Block transformBlock(Block block) {
if(!disableOnGeneration) return block;
if(block == ModBlocks.spotlight_incandescent) return ModBlocks.spotlight_incandescent_off;
if(block == ModBlocks.spotlight_fluoro) return ModBlocks.spotlight_fluoro_off;
if(block == ModBlocks.spotlight_halogen) return ModBlocks.spotlight_halogen_off;

View File

@ -206,4 +206,9 @@ public abstract class RBMKBase extends BlockDummyable implements IToolable, ILoo
public static int renderIDRods = RenderingRegistry.getNextAvailableRenderId();
public static int renderIDPassive = RenderingRegistry.getNextAvailableRenderId();
public static int renderIDControl = RenderingRegistry.getNextAvailableRenderId();
@Override
public int transformMeta(int meta, int coordBaseMode) {
return meta;
}
}

View File

@ -108,11 +108,6 @@ public class ToolRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.lead_gavel, 1), new Object[] { "PIP", "IGI", "PIP", 'P', ModItems.pellet_buckshot, 'I', PB.ingot(), 'G', ModItems.wood_gavel });
//Misc weapons
CraftingManager.addRecipeAuto(new ItemStack(ModItems.saw, 1), new Object[] { "IIL", "PP ", 'P', STEEL.plate(), 'I', STEEL.ingot(), 'L', Items.leather });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bat, 1), new Object[] { "P", "P", "S", 'S', STEEL.plate(), 'P', KEY_PLANKS });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.bat_nail, 1), new Object[] { ModItems.bat, STEEL.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.golf_club, 1), new Object[] { "IP", " P", " P", 'P', STEEL.plate(), 'I', STEEL.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pipe_rusty, 1), new Object[] { "II", " I", " I", 'I', IRON.pipe() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pipe_lead, 1), new Object[] { "II", " I", " I", 'I', PB.pipe() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ullapool_caber, 1), new Object[] { "ITI", " S ", " S ", 'I', IRON.plate(), 'T', Blocks.tnt, 'S', KEY_STICK });
@ -197,14 +192,6 @@ public class ToolRecipes {
addShovel( SA326.ingot(), ModItems.schrabidium_shovel);
addHoe( SA326.ingot(), ModItems.schrabidium_hoe);
} else {
/*
CraftingManager.addRecipeAuto(new ItemStack(ModItems.cobalt_decorated_sword, 1), new Object[] { " I ", " I ", "SBS", 'I', CO.ingot(), 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_sword });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.cobalt_decorated_pickaxe, 1), new Object[] { "III", " B ", " S ", 'I', CO.ingot(), 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_pickaxe });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.cobalt_decorated_axe, 1), new Object[] { "II", "IB", " S", 'I', CO.ingot(), 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_axe });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.cobalt_decorated_shovel, 1), new Object[] { "I", "B", "S", 'I', CO.ingot(), 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_shovel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.cobalt_decorated_hoe, 1), new Object[] { "II", " B", " S", 'I', CO.ingot(), 'S', ModItems.ingot_meteorite_forged, 'B', ModItems.cobalt_hoe });
*/
CraftingManager.addRecipeAuto(new ItemStack(ModItems.starmetal_sword, 1), new Object[] { " I ", " B ", "ISI", 'I', STAR.ingot(), 'S', ModItems.ring_starmetal, 'B', ModItems.cobalt_decorated_sword });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.starmetal_pickaxe, 1), new Object[] { "ISI", " B ", " I ", 'I', STAR.ingot(), 'S', ModItems.ring_starmetal, 'B', ModItems.cobalt_decorated_pickaxe });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.starmetal_axe, 1), new Object[] { "IS", "IB", " I", 'I', STAR.ingot(), 'S', ModItems.ring_starmetal, 'B', ModItems.cobalt_decorated_axe });

View File

@ -16,6 +16,8 @@ import com.hbm.items.ModItems;
import com.hbm.items.weapon.GunB92Cell;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumModGeneric;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumModSpecial;
import com.hbm.main.CraftingManager;
import net.minecraft.init.Blocks;
@ -84,7 +86,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_minigun, 1), new Object[] { "BMG", "BRE", "BGM", 'B', ANY_RESISTANTALLOY.lightBarrel(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip(), 'R', ANY_RESISTANTALLOY.heavyReceiver(), 'E', ModItems.motor_desh });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_missile_launcher, 1), new Object[] { " CM", "BBB", "G ", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', WEAPONSTEEL.mechanism(), 'B', ANY_RESISTANTALLOY.heavyBarrel(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_tesla_cannon, 1), new Object[] { "CCC", "BRB", "MGE", 'C', ModItems.coil_advanced_alloy, 'B', ANY_RESISTANTALLOY.heavyBarrel(), 'R', ANY_RESISTANTALLOY.heavyReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip(), 'E', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stg77, 1), new Object[] { " D ", "BRS", "GM ", 'D', DIAMOND.gem(), 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stg77, 1), new Object[] { " D ", "BRS", "GGM", 'D', DictFrame.fromOne(ModItems.weapon_mod_special, EnumModSpecial.SCOPE), 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fatman, 1), new Object[] { "PPP", "BSR", "G M", 'P', BIGMT.plate(), 'B', BIGMT.heavyBarrel(), 'S', BIGMT.shell(), 'R', BIGMT.heavyReceiver(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_tau, 1), new Object[] { " RD", "CTT", "GMS", 'D', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'C', CU.pipe(), 'T', ModItems.coil_advanced_torus, 'G', ANY_HARDPLASTIC.grip(), 'R', BIGMT.lightReceiver(), 'M', BIGMT.mechanism(), 'S', ANY_HARDPLASTIC.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lasrifle, 1), new Object[] { "LC ", "BRS", "MG ", 'L', ModItems.crystal_redstone, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'B', ANY_BISMOIDBRONZE.lightBarrel(), 'R', ANY_BISMOIDBRONZE.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'M', BIGMT.mechanism(), 'G', ANY_HARDPLASTIC.grip() });
@ -96,6 +98,39 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE_SHOT, 6), new Object[] { "C", "P", "G", 'C', Blocks.gravel, 'P', Items.paper, 'G', Items.gunpowder });
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE_IRON, 6), new Object[] { "C", "P", "G", 'C', IRON.ingot(), 'P', Items.paper, 'G', Items.gunpowder });
//SEDNA Mods
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.IRON_DAMAGE.ordinal()), new Object[] { GUNMETAL.ingot(), IRON.ingot(), IRON.ingot(), IRON.ingot(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.IRON_DURA.ordinal()), new Object[] { GUNMETAL.ingot(), IRON.ingot(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.STEEL_DAMAGE.ordinal()), new Object[] { GUNMETAL.mechanism(), STEEL.plateCast(), STEEL.plateCast(), STEEL.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.STEEL_DURA.ordinal()), new Object[] { GUNMETAL.plate(), STEEL.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.DURA_DAMAGE.ordinal()), new Object[] { GUNMETAL.mechanism(), DURA.plateCast(), DURA.plateCast(), DURA.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.DURA_DURA.ordinal()), new Object[] { GUNMETAL.plate(), DURA.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.DESH_DAMAGE.ordinal()), new Object[] { GUNMETAL.mechanism(), DESH.plateCast(), DESH.plateCast(), DESH.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.DESH_DURA.ordinal()), new Object[] { GUNMETAL.plate(), DESH.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.WSTEEL_DAMAGE.ordinal()), new Object[] { WEAPONSTEEL.mechanism(), WEAPONSTEEL.plateCast(), WEAPONSTEEL.plateCast(), WEAPONSTEEL.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.WSTEEL_DURA.ordinal()), new Object[] { WEAPONSTEEL.plate(), WEAPONSTEEL.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.FERRO_DAMAGE.ordinal()), new Object[] { WEAPONSTEEL.mechanism(), FERRO.plateCast(), FERRO.plateCast(), FERRO.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.FERRO_DURA.ordinal()), new Object[] { WEAPONSTEEL.plate(), FERRO.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.TCALLOY_DAMAGE.ordinal()), new Object[] { WEAPONSTEEL.mechanism(), ANY_RESISTANTALLOY.plateCast(), ANY_RESISTANTALLOY.plateCast(), ANY_RESISTANTALLOY.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.TCALLOY_DURA.ordinal()), new Object[] { WEAPONSTEEL.plate(), ANY_RESISTANTALLOY.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.BIGMT_DAMAGE.ordinal()), new Object[] { BIGMT.mechanism(), BIGMT.plateCast(), BIGMT.plateCast(), BIGMT.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.BIGMT_DURA.ordinal()), new Object[] { BIGMT.plate(), BIGMT.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.BRONZE_DAMAGE.ordinal()), new Object[] { BIGMT.mechanism(), ANY_BISMOIDBRONZE.plateCast(), ANY_BISMOIDBRONZE.plateCast(), ANY_BISMOIDBRONZE.plateCast(), ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.BRONZE_DURA.ordinal()), new Object[] { BIGMT.plate(), ANY_BISMOIDBRONZE.plateCast(), ModItems.ducttape });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SILENCER.ordinal()), new Object[] { "P", "B", "P", 'P', ANY_PLASTIC.ingot(), 'B', STEEL.lightBarrel() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SCOPE.ordinal()), new Object[] { "SPS", "G G", "SPS", 'P', ANY_PLASTIC.ingot(), 'S', STEEL.plate(), 'G', KEY_ANYPANE });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SAW.ordinal()), new Object[] { "BBS", "BHB", 'B', STEEL.bolt(), 'S', KEY_STICK, 'H', DURA.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SPEEDLOADER.ordinal()), new Object[] { " B ", "BSB", " B ", 'B', STEEL.bolt(), 'S', WEAPONSTEEL.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SLOWDOWN.ordinal()), new Object[] { " I ", " M ", "I I", 'I', WEAPONSTEEL.ingot(), 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SPEEDUP.ordinal()), new Object[] { "PIP", "WWW", "PIP", 'P', WEAPONSTEEL.plate(), 'I', GUNMETAL.ingot(), 'W', GOLD.wireDense() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.GREASEGUN.ordinal()), new Object[] { "BRM", "P G", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'P', DURA.plate(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.CHOKE.ordinal()), new Object[] { "P", "B", "P", 'P', WEAPONSTEEL.plate(), 'B', DURA.lightBarrel() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.FURNITURE_GREEN.ordinal()), new Object[] { "PDS", " G", 'P', ANY_PLASTIC.ingot(), 'D', KEY_GREEN, 'S', ANY_PLASTIC.stock(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.FURNITURE_BLACK.ordinal()), new Object[] { "PDS", " G", 'P', ANY_PLASTIC.ingot(), 'D', KEY_BLACK, 'S', ANY_PLASTIC.stock(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SKIN_SATURNITE.ordinal()), new Object[] { "BRM", " P ", 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'M', BIGMT.mechanism(), 'P', BIGMT.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.STACK_MAG.ordinal()), new Object[] { "P P", "P P", "PMP", 'P', WEAPONSTEEL.plate(), 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.weapon_mod_special, 1, EnumModSpecial.BAYONET.ordinal()), new Object[] { " P", "BBB", 'P', WEAPONSTEEL.plate(), 'B', STEEL.bolt() });
//Nitra!
CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP, 6), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP), ModItems.nitra });
CraftingManager.addShapelessAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M44_SP, 6), new Object[] { DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M44_SP), ModItems.nitra });
@ -152,7 +187,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.mp_chip_5, 1), new Object[] { "P", "C", "S", 'P', ANY_RUBBER.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'S', ModBlocks.steel_scaffold });
//Turrets
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.turret_sentry, 1), new Object[] { "PPL", " MD", " SC", 'P', STEEL.plate(), 'M', ModItems.motor, 'L', ModItems.mechanism_rifle_1, 'S', ModBlocks.steel_scaffold, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'D', ModItems.crt_display });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.turret_sentry, 1), new Object[] { "PPL", " MD", " SC", 'P', STEEL.plate(), 'M', ModItems.motor, 'L', GUNMETAL.mechanism(), 'S', ModBlocks.steel_scaffold, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'D', ModItems.crt_display });
//Guns
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b92), new Object[] { "DDD", "SSC", " R", 'D', ModItems.plate_dineutronium, 'S', STAR.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'R', ModItems.gun_lasrifle });

View File

@ -17,7 +17,6 @@ import com.hbm.entity.missile.EntityMissileTier4.*;
import com.hbm.entity.mob.*;
import com.hbm.entity.mob.botprime.*;
import com.hbm.entity.mob.glyphid.*;
import com.hbm.entity.mob.siege.*;
import com.hbm.entity.particle.*;
import com.hbm.entity.projectile.*;
import com.hbm.entity.train.EntityRailCarBase.BoundingBoxDummyEntity;
@ -198,7 +197,6 @@ public class EntityMappings {
addEntity(EntityNukeTorex.class, "entity_effect_torex", 250, false);
addEntity(EntityArtilleryShell.class, "entity_artillery_shell", 1000);
addEntity(EntityArtilleryRocket.class, "entity_himars", 1000);
addEntity(EntitySiegeTunneler.class, "entity_meme_tunneler", 1000);
addEntity(EntityCog.class, "entity_stray_cog", 1000);
addEntity(EntitySawblade.class, "entity_stray_saw", 1000);
addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000);
@ -237,10 +235,6 @@ public class EntityMappings {
addMob(EntityFBI.class, "entity_ntm_fbi", 0x008000, 0x404040);
addMob(EntityFBIDrone.class, "entity_ntm_fbi_drone", 0x008000, 0x404040);
addMob(EntityRADBeast.class, "entity_ntm_radiation_blaze", 0x303030, 0x008000);
addMob(EntitySiegeZombie.class, "entity_meme_zombie", 0x303030, 0x008000);
addMob(EntitySiegeSkeleton.class, "entity_meme_skeleton", 0x303030, 0x000080);
addMob(EntitySiegeUFO.class, "entity_meme_ufo", 0x303030, 0x800000);
addMob(EntitySiegeCraft.class, "entity_meme_craft", 0x303030, 0x808000);
addMob(EntityGlyphid.class, "entity_glyphid", 0x724A21, 0xD2BB72);
addMob(EntityGlyphidBrawler.class, "entity_glyphid_brawler", 0x273038, 0xD2BB72);
addMob(EntityGlyphidBehemoth.class, "entity_glyphid_behemoth", 0x267F00, 0xD2BB72);
@ -253,6 +247,7 @@ public class EntityMappings {
addMob(EntityPlasticBag.class, "entity_plastic_bag", 0xd0d0d0, 0x808080);
addMob(EntityParasiteMaggot.class, "entity_parasite_maggot", 0xd0d0d0, 0x808080);
addMob(EntityDummy.class, "entity_ntm_test_dummy", 0xffffff, 0x000000);
addMob(EntityUndeadSoldier.class, "entity_ntm_undead_soldier", 0x749F30, 0x6C5B44);
addSpawn(EntityCreeperPhosgene.class, 5, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());
addSpawn(EntityCreeperVolatile.class, 10, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());

View File

@ -0,0 +1,111 @@
package com.hbm.entity.mob;
import com.hbm.items.ModItems;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntityUndeadSoldier extends EntityMob {
public static final int DW_TYPE = 12;
public static final byte TYPE_ZOMBIE = 0;
public static final byte TYPE_SKELETON = 1;
public EntityUndeadSoldier(World world) {
super(world);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, true));
}
protected void entityInit() {
super.entityInit();
this.getDataWatcher().addObject(DW_TYPE, Byte.valueOf((byte) 0));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D);
}
@Override
protected boolean isAIEnabled() {
return true;
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
this.addRandomArmor();
this.dataWatcher.updateObject(DW_TYPE, rand.nextBoolean() ? TYPE_ZOMBIE : TYPE_SKELETON);
return super.onSpawnWithEgg(data);
}
@Override
protected void addRandomArmor() {
this.setCurrentItemOrArmor(4, new ItemStack(ModItems.taurun_helmet));
this.setCurrentItemOrArmor(3, new ItemStack(ModItems.taurun_plate));
this.setCurrentItemOrArmor(2, new ItemStack(ModItems.taurun_legs));
this.setCurrentItemOrArmor(1, new ItemStack(ModItems.taurun_boots));
this.setCurrentItemOrArmor(0, new ItemStack(ModItems.gun_heavy_revolver));
}
@Override
protected String getLivingSound() {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) return "mob.zombie.say";
if(type == TYPE_SKELETON) return "mob.skeleton.say";
return super.getLivingSound();
}
@Override
protected String getHurtSound() {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) return "mob.zombie.hurt";
if(type == TYPE_SKELETON) return "mob.skeleton.hurt";
return super.getHurtSound();
}
@Override
protected String getDeathSound() {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) return "mob.zombie.death";
if(type == TYPE_SKELETON) return "mob.skeleton.death";
return super.getDeathSound();
}
@Override
protected void func_145780_a(int x, int y, int z, Block blck) {
byte type = this.dataWatcher.getWatchableObjectByte(DW_TYPE);
if(type == TYPE_ZOMBIE) this.playSound("mob.zombie.step", 0.15F, 1.0F);
if(type == TYPE_SKELETON) this.playSound("mob.skeleton.step", 0.15F, 1.0F);
}
@Override
public EnumCreatureAttribute getCreatureAttribute() {
return EnumCreatureAttribute.UNDEAD;
}
@Override protected void dropFewItems(boolean player, int loot) { }
@Override protected void dropEquipment(boolean player, int loot) { }
}

View File

@ -1,181 +0,0 @@
package com.hbm.entity.mob.siege;
import com.hbm.entity.projectile.EntitySiegeLaser;
import com.hbm.items.ModItems;
import api.hbm.entity.IRadiationImmune;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIArrowAttack;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntitySiegeSkeleton extends EntityMob implements IRangedAttackMob, IRadiationImmune {
public EntitySiegeSkeleton(World world) {
super(world);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F));
this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
}
@Override
public boolean attackEntityFrom(DamageSource source, float damage) {
if(this.isEntityInvulnerable())
return false;
SiegeTier tier = this.getTier();
if(tier.fireProof && source.isFireDamage()) {
this.extinguish();
return false;
}
if(tier.noFall && source == DamageSource.fall)
return false;
//noFF can't be harmed by other mobs
if(tier.noFriendlyFire && source instanceof EntityDamageSource && !(((EntityDamageSource) source).getEntity() instanceof EntityPlayer))
return false;
damage -= tier.dt;
if(damage < 0) {
worldObj.playSoundAtEntity(this, "random.break", 5F, 1.0F + rand.nextFloat() * 0.5F);
return false;
}
damage *= (1F - tier.dr);
return super.attackEntityFrom(source, damage);
}
@Override
protected void entityInit() {
super.entityInit();
this.getDataWatcher().addObject(12, (int) 0);
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);
}
public void setTier(SiegeTier tier) {
this.getDataWatcher().updateObject(12, tier.id);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Tier Speed Mod", tier.speedMod, 1));
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier("Tier Damage Mod", tier.damageMod, 1));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health);
this.setHealth(this.getMaxHealth());
}
public SiegeTier getTier() {
SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
return tier != null ? tier : SiegeTier.CLAY;
}
@Override
protected void addRandomArmor() {
super.addRandomArmor();
this.setCurrentItemOrArmor(0, new ItemStack(ModItems.detonator_laser));
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger("siegeTier", this.getTier().id);
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
this.addRandomArmor();
return super.onSpawnWithEgg(data);
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase target, float f) {
double x = posX;
double y = posY + this.getEyeHeight();
double z = posZ;
Vec3 vec = Vec3.createVectorHelper(target.posX - x, target.posY + target.getYOffset() + target.height * 0.5 - y, target.posZ - z).normalize();
SiegeTier tier = this.getTier();
for(int i = 0; i < 3; i++) {
EntitySiegeLaser laser = new EntitySiegeLaser(worldObj, this);
laser.setPosition(x, y, z);
laser.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, 1F, i == 1 ? 0.15F : 5F);
laser.setColor(0x808000);
laser.setDamage(tier.damageMod);
laser.setExplosive(tier.laserExplosive);
laser.setBreakChance(tier.laserBreak);
if(tier.laserIncendiary) laser.setIncendiary();
worldObj.spawnEntityInWorld(laser);
}
this.playSound("hbm:weapon.ballsLaser", 2.0F, 0.9F + rand.nextFloat() * 0.2F);
}
@Override
protected boolean isAIEnabled() {
return true;
}
@Override
protected String getLivingSound() {
return "hbm:entity.siegeIdle";
}
@Override
protected String getHurtSound() {
return "hbm:entity.siegeHurt";
}
@Override
protected String getDeathSound() {
return "hbm:entity.siegeDeath";
}
@Override
protected void dropFewItems(boolean byPlayer, int fortune) {
if(byPlayer) {
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
}
}
}

View File

@ -1,144 +0,0 @@
package com.hbm.entity.mob.siege;
import com.hbm.entity.mob.EntityUFOBase;
import com.hbm.entity.projectile.EntitySiegeLaser;
import api.hbm.entity.IRadiationImmune;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntitySiegeUFO extends EntityUFOBase implements IRadiationImmune {
private int attackCooldown;
public EntitySiegeUFO(World world) {
super(world);
this.setSize(1.5F, 1F);
}
@Override
protected void entityInit() {
super.entityInit();
this.getDataWatcher().addObject(12, (int) 0);
}
public void setTier(SiegeTier tier) {
this.getDataWatcher().updateObject(12, tier.id);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(tier.speedMod);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health * 0.25);
this.setHealth(this.getMaxHealth());
}
public SiegeTier getTier() {
SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
return tier != null ? tier : SiegeTier.CLAY;
}
@Override
public boolean attackEntityFrom(DamageSource source, float damage) {
if(this.isEntityInvulnerable())
return false;
SiegeTier tier = this.getTier();
if(tier.fireProof && source.isFireDamage()) {
this.extinguish();
return false;
}
//noFF can't be harmed by other mobs
if(tier.noFriendlyFire && source instanceof EntityDamageSource && !(((EntityDamageSource) source).getEntity() instanceof EntityPlayer))
return false;
damage -= tier.dt;
if(damage < 0) {
worldObj.playSoundAtEntity(this, "random.break", 5F, 1.0F + rand.nextFloat() * 0.5F);
return false;
}
damage *= (1F - tier.dr);
return super.attackEntityFrom(source, damage);
}
@Override
protected void updateEntityActionState() {
super.updateEntityActionState();
if(this.courseChangeCooldown > 0) {
this.courseChangeCooldown--;
}
if(this.scanCooldown > 0) {
this.scanCooldown--;
}
if(!worldObj.isRemote) {
if(this.attackCooldown > 0) {
this.attackCooldown--;
}
if(this.attackCooldown == 0 && this.target != null) {
this.attackCooldown = 20 + rand.nextInt(5);
double x = posX;
double y = posY;
double z = posZ;
Vec3 vec = Vec3.createVectorHelper(target.posX - x, target.posY + target.height * 0.5 - y, target.posZ - z).normalize();
SiegeTier tier = this.getTier();
EntitySiegeLaser laser = new EntitySiegeLaser(worldObj, this);
laser.setPosition(x, y, z);
laser.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, 1F, 0.15F);
laser.setColor(0x802000);
laser.setDamage(tier.damageMod);
laser.setExplosive(tier.laserExplosive);
laser.setBreakChance(tier.laserBreak);
if(tier.laserIncendiary) laser.setIncendiary();
worldObj.spawnEntityInWorld(laser);
this.playSound("hbm:weapon.ballsLaser", 2.0F, 1.0F);
}
}
if(this.courseChangeCooldown > 0) {
approachPosition(this.target == null ? 0.25D : 0.5D + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue() * 1);
}
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger("siegeTier", this.getTier().id);
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
return super.onSpawnWithEgg(data);
}
@Override
protected void dropFewItems(boolean byPlayer, int fortune) {
if(byPlayer) {
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
}
}
}

View File

@ -1,156 +0,0 @@
package com.hbm.entity.mob.siege;
import api.hbm.entity.IRadiationImmune;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.world.World;
public class EntitySiegeZombie extends EntityMob implements IRadiationImmune {
public EntitySiegeZombie(World world) {
super(world);
this.getNavigator().setBreakDoors(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 1.0D));
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.setSize(0.6F, 1.8F);
}
@Override
public boolean attackEntityFrom(DamageSource source, float damage) {
if(this.isEntityInvulnerable())
return false;
SiegeTier tier = this.getTier();
if(tier.fireProof && source.isFireDamage()) {
this.extinguish();
return false;
}
if(tier.noFall && source == DamageSource.fall)
return false;
//noFF can't be harmed by other mobs
if(tier.noFriendlyFire && source instanceof EntityDamageSource && !(((EntityDamageSource) source).getEntity() instanceof EntityPlayer))
return false;
damage -= tier.dt;
if(damage < 0) {
worldObj.playSoundAtEntity(this, "random.break", 5F, 1.0F + rand.nextFloat() * 0.5F);
return false;
}
damage *= (1F - tier.dr);
return super.attackEntityFrom(source, damage);
}
@Override
protected void entityInit() {
super.entityInit();
this.getDataWatcher().addObject(12, (int) 0);
this.getDataWatcher().addObject(13, (byte) 0);
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);
}
public void setTier(SiegeTier tier) {
this.getDataWatcher().updateObject(12, tier.id);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).applyModifier(new AttributeModifier("Tier Speed Mod", tier.speedMod, 1));
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier("Tier Damage Mod", tier.damageMod, 1));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(tier.health);
this.setHealth(this.getMaxHealth());
}
public SiegeTier getTier() {
SiegeTier tier = SiegeTier.tiers[this.getDataWatcher().getWatchableObjectInt(12)];
return tier != null ? tier : SiegeTier.CLAY;
}
@Override
protected boolean isAIEnabled() {
return true;
}
@Override
protected String getLivingSound() {
return "hbm:entity.siegeIdle";
}
@Override
protected String getHurtSound() {
return "hbm:entity.siegeHurt";
}
@Override
protected String getDeathSound() {
return "hbm:entity.siegeDeath";
}
@Override
protected void dropFewItems(boolean byPlayer, int fortune) {
if(byPlayer) {
for(ItemStack drop : this.getTier().dropItem) {
this.entityDropItem(drop.copy(), 0F);
}
}
}
@Override
public void onUpdate() {
super.onUpdate();
if(!worldObj.isRemote) {
this.dataWatcher.updateObject(13, (byte)(this.getAttackTarget() != null ? 1 : 0));
}
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger("siegeTier", this.getTier().id);
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.setTier(SiegeTier.tiers[nbt.getInteger("siegeTier")]);
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
this.setTier(SiegeTier.tiers[rand.nextInt(SiegeTier.getLength())]);
return super.onSpawnWithEgg(data);
}
}

View File

@ -2,6 +2,9 @@ package com.hbm.handler.nei;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.recipes.FuelPoolRecipes;
import com.hbm.items.machine.ItemRBMKRod;
import net.minecraft.item.ItemStack;
public class FuelPoolHandler extends NEIUniversalHandler {
@ -13,4 +16,22 @@ public class FuelPoolHandler extends NEIUniversalHandler {
public String getKey() {
return "ntmSpentDrum";
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
if(ingredient != null && ingredient.getItem() != null && ingredient.getItem() instanceof ItemRBMKRod) {
if(ItemRBMKRod.getCoreHeat(ingredient) < 50 && ItemRBMKRod.getHullHeat(ingredient) < 50) return;
}
super.loadUsageRecipes(ingredient);
}
@Override
public void loadCraftingRecipes(ItemStack ingredient) {
if(ingredient != null && ingredient.getItem() != null && ingredient.getItem() instanceof ItemRBMKRod) {
if(ItemRBMKRod.getCoreHeat(ingredient) >= 50 || ItemRBMKRod.getHullHeat(ingredient) >= 50) return;
}
super.loadCraftingRecipes(ingredient);
}
}

View File

@ -0,0 +1,94 @@
package com.hbm.handler.nei;
import java.util.HashMap;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.machine.ItemRBMKRod;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class RBMKRodDisassemblyHandler extends NEIUniversalHandler {
public RBMKRodDisassemblyHandler() {
super("RBMK Rod Disassembly", Blocks.crafting_table, getRecipes());
}
@Override
public String getKey() {
return "ntmRBMKDisassembly";
}
public static HashMap<ComparableStack, ItemStack> getRecipes() {
HashMap<ComparableStack, ItemStack> map = new HashMap<>();
for(ItemRBMKRod rod : ItemRBMKRod.craftableRods) {
for(int enrichment = 0; enrichment <= 4; enrichment++) {
ItemStack result = new ItemStack(rod.pellet, 8, enrichment);
map.put(new ComparableStackHeat(rod, false, enrichment, false), result);
if(rod.pellet.isXenonEnabled()) {
ItemStack resultPoison = new ItemStack(rod.pellet, 8, enrichment + 5);
map.put(new ComparableStackHeat(rod, false, enrichment, true), resultPoison);
}
}
}
return map;
}
// Don't show recipes for hot rods (which will cause it to only show cooling recipes)
@Override
public void loadUsageRecipes(ItemStack ingredient) {
if(ingredient != null && ingredient.getItem() != null && ingredient.getItem() instanceof ItemRBMKRod) {
if(ItemRBMKRod.getCoreHeat(ingredient) > 50 || ItemRBMKRod.getHullHeat(ingredient) > 50) return;
}
super.loadUsageRecipes(ingredient);
}
public static class ComparableStackHeat extends ComparableStack {
// I was going to filter by all of these, but found it is just best to show all possible recipes for everything but heat
private final boolean isHot;
private final int enrichment;
private final boolean hasPoison;
public ComparableStackHeat(Item item, boolean isHot) {
this(item, isHot, -1, false);
}
public ComparableStackHeat(Item item, boolean isHot, int enrichment, boolean hasPoison) {
super(item);
this.isHot = isHot;
this.enrichment = enrichment;
this.hasPoison = hasPoison;
}
public ItemStack toStack() {
ItemStack stack = super.toStack();
ItemRBMKRod rod = (ItemRBMKRod) stack.getItem();
if(enrichment >= 0) {
ItemRBMKRod.setYield(stack, Math.min(1 - ((double) enrichment) / 5, 0.99) * rod.yield);
} else {
ItemRBMKRod.setYield(stack, 0.2 * rod.yield);
}
if(hasPoison) ItemRBMKRod.setPoison(stack, 50);
if(!isHot) return stack;
ItemRBMKRod.setCoreHeat(stack, 100);
ItemRBMKRod.setHullHeat(stack, 50);
return stack;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + enrichment;
result = prime * result + (hasPoison ? 1 : 0);
return result;
}
}
}

View File

@ -0,0 +1,40 @@
package com.hbm.handler.nei;
import java.util.HashMap;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemWasteLong;
import com.hbm.items.special.ItemWasteShort;
import net.minecraft.item.ItemStack;
public class RBMKWasteDecayHandler extends NEIUniversalHandler {
public RBMKWasteDecayHandler() {
super("Nuclear Waste Decay", ModBlocks.machine_storage_drum, getRecipes());
}
@Override
public String getKey() {
return "ntmRBMKWaste";
}
public static HashMap<ComparableStack, ItemStack> getRecipes() {
HashMap<ComparableStack, ItemStack> map = new HashMap<>();
for(ItemWasteShort.WasteClass waste : ItemWasteShort.WasteClass.values()) {
map.put(new ComparableStack(ModItems.nuclear_waste_short, 1, waste), new ItemStack(ModItems.nuclear_waste_short_depleted, 1, waste.ordinal()));
map.put(new ComparableStack(ModItems.nuclear_waste_short_tiny, 1, waste), new ItemStack(ModItems.nuclear_waste_short_depleted_tiny, 1, waste.ordinal()));
}
for(ItemWasteLong.WasteClass waste : ItemWasteLong.WasteClass.values()) {
map.put(new ComparableStack(ModItems.nuclear_waste_long, 1, waste), new ItemStack(ModItems.nuclear_waste_long_depleted, 1, waste.ordinal()));
map.put(new ComparableStack(ModItems.nuclear_waste_long_tiny, 1, waste), new ItemStack(ModItems.nuclear_waste_long_depleted_tiny, 1, waste.ordinal()));
}
return map;
}
}

View File

@ -1,5 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.items.block.ItemBlockStorageCrate;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
@ -18,8 +19,15 @@ public class ContainerCrateBase extends ContainerBase {
@Override
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
// prevents the player from moving around the currently open box
if(mode == 2 && button == player.inventory.currentItem) return null;
if(index == player.inventory.currentItem + 27 + this.tile.getSizeInventory()) return null;
if(player.inventory.getStackInSlot(player.inventory.currentItem) != null &&
player.inventory.getStackInSlot(player.inventory.currentItem).getItem() instanceof ItemBlockStorageCrate) {
if (mode == 2 && button == player.inventory.currentItem) {
return null;
}
if (index == player.inventory.currentItem + 27 + this.tile.getSizeInventory()) {
return null;
}
}
return super.slotClick(index, button, mode, player);
}

View File

@ -2,6 +2,7 @@ package com.hbm.inventory.container;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
import com.hbm.util.InventoryUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@ -26,7 +27,7 @@ public class ContainerWeaponTable extends Container {
@Override
public boolean isItemValid(ItemStack stack) {
return stack.getItem() instanceof ItemGunBaseNT;
return gun.getStackInSlot(0) == null && stack.getItem() instanceof ItemGunBaseNT;
}
@Override
@ -152,8 +153,33 @@ public class ContainerWeaponTable extends Container {
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
return null;
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack copy = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack stack = slot.getStack();
copy = stack.copy();
if(index < 8) {
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 8, this.inventorySlots.size(), true)) return null;
slot.onPickupFromSlot(player, stack);
} else {
if(stack.getItem() instanceof ItemGunBaseNT) {
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 7, 8, false)) return null;
} else {
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 0, 7, false)) return null;
}
}
if(stack.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
}
return copy;
}
public class ModSlot extends Slot {
@ -171,12 +197,14 @@ public class ContainerWeaponTable extends Container {
public void putStack(ItemStack stack) {
super.putStack(stack);
refreshInstalledMods();
WeaponModManager.onInstallStack(gun.getStackInSlot(0), stack, index);
}
@Override
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
super.onPickupFromSlot(player, stack);
refreshInstalledMods();
WeaponModManager.onUninstallStack(gun.getStackInSlot(0), stack, index);
}
public void refreshInstalledMods() {

View File

@ -366,6 +366,10 @@ public class GUIRBMKConsole extends GuiScreen {
int fe = (int)Math.ceil((col.data.getDouble("enrichment")) * 8);
if(fe > 8) fe = 8;
drawTexturedModalRect(guiLeft + x + 4, guiTop + y + size - fe - 1, 14, 191 - fe, 2, fe);
int fx = (int)Math.ceil((col.data.getDouble("xenon")) * 8 / 100);
if(fx > 8) fx = 8;
drawTexturedModalRect(guiLeft + x + 7, guiTop + y + size - fx - 1, 17, 191 - fx, 2, fx);
}
break;

View File

@ -138,10 +138,10 @@ public class Mats {
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0xAFAFAF, 0x0F0F0F, 0x4A4A4A).setAutogen(DUSTTINY, BOLT, WIRE, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, GRIP).m();
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xFFBA7D, 0xAF1700, 0xE44C0F).setAutogen(WIRE, DUST, BLOCK).m();
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF8330, 0x700000, 0xFF7318).setAutogen(WIRE, DUST, DENSEWIRE, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x183039, 0x030B0B, 0x376373).setAutogen(BOLT, DUST, PIPE, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, GRIP).m();
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x183039, 0x030B0B, 0x376373).setAutogen(BOLT, DUST, PLATE, CASTPLATE, PIPE, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, GRIP).m();
public static final NTMMaterial MAT_DESH = makeSmeltable(_AS + 12, DESH, 0xFF6D6D, 0x720000, 0xF22929).setAutogen(DUST, CASTPLATE, BLOCK, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, STOCK, GRIP).m();
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0xCCCCEA, 0x11111A, 0xA5A5D3).setAutogen(DUST, DENSEWIRE, BLOCK).m();
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).setAutogen(HEAVYBARREL, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).setAutogen(CASTPLATE, HEAVYBARREL, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setAutogen(DUST, CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setAutogen(CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_BBRONZE = makeSmeltable(_AS + 16, BBRONZE, 0xE19A69, 0x485353, 0x987D65).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER).m();
@ -154,7 +154,7 @@ public class Mats {
public static final NTMMaterial MAT_SLAG = makeSmeltable(_AS + 11, SLAG, 0x554940, 0x34281F, 0x6C6562).setAutogen(BLOCK).n();
public static final NTMMaterial MAT_MUD = makeSmeltable(_AS + 14, MUD, 0xBCB5A9, 0x481213, 0x96783B).n();
public static final NTMMaterial MAT_GUNMETAL = makeSmeltable(_AS + 19, GUNMETAL, 0xFFEF3F, 0xAD3600, 0xF9C62C).setAutogen(LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
public static final NTMMaterial MAT_WEAPONSTEEL = makeSmeltable(_AS + 20, WEAPONSTEEL, 0xA0A0A0, 0x000000, 0x808080).setAutogen(SHELL, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
public static final NTMMaterial MAT_WEAPONSTEEL = makeSmeltable(_AS + 20, WEAPONSTEEL, 0xA0A0A0, 0x000000, 0x808080).setAutogen(CASTPLATE, SHELL, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0x3AC4DA, 0x09282C, 0x30A4B7).setAutogen(PLATE, CASTPLATE, SHELL, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).m();
//Extension

View File

@ -39,6 +39,7 @@ public class AmmoPressRecipes extends SerializableRecipe {
OreDictStack copper = new OreDictStack(CU.ingot());
OreDictStack plastic = new OreDictStack(ANY_PLASTIC.ingot());
OreDictStack uranium = new OreDictStack(U238.ingot());
OreDictStack ferro = new OreDictStack(FERRO.ingot());
ComparableStack smokeful = new ComparableStack(Items.gunpowder);
OreDictStack smokeless = new OreDictStack(ANY_SMOKELESS.dust());
ComparableStack rocket = new ComparableStack(ModItems.rocket_fuel);
@ -137,6 +138,27 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, smokeless.copy(2), null,
null, sSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P45_SP, 8),
null, lead, null,
null, smokeless, null,
null, cSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P45_FMJ, 8),
null, steel, null,
null, smokeless, null,
null, cSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P45_JHP, 8),
plastic, copper, null,
null, smokeless, null,
null, cSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P45_AP, 8),
null, wSteel, null,
null, smokeless.copy(2), null,
null, sSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.P45_DU, 8),
null, uranium, null,
null, smokeless.copy(2), null,
null, sSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.R556_SP, 16),
null, lead.copy(2), null,
null, smokeless.copy(2), null,
@ -174,6 +196,10 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, uranium.copy(2), null,
null, smokeless.copy(4), null,
null, sSmall.copy(2), null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.R762_HE, 12),
he, ferro, null,
null, smokeless.copy(4), null,
null, sSmall.copy(2), null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.BMG50_SP, 12),
null, lead.copy(2), null,
@ -195,6 +221,10 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, uranium.copy(2), null,
null, smokeless.copy(6), null,
null, sBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.BMG50_HE, 12),
he, ferro, null,
null, smokeless.copy(6), null,
null, sBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G12_BP, 6),
null, nugget.copy(6), null,
@ -238,21 +268,22 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, nugget.copy(8), null,
null, smokeless.copy(2), null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G10_SHRAPNEL, 4),
plastic, nugget.copy(8), null,
null, smokeless.copy(2), null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G10_DU, 4),
null, uranium, null,
null, smokeless.copy(2), null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G10_SLUG, 4),
null, lead, null,
null, smokeless.copy(2), null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G10_EXPLOSIVE, 4),
he, ferro, null,
null, smokeless.copy(2), null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G26_FLARE, 4),
null, rp, null,
@ -366,7 +397,6 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, lPlate , null));
OreDictStack tungsten = new OreDictStack(W.ingot());
OreDictStack ferro = new OreDictStack(FERRO.ingot());
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.COIL_TUNGSTEN, 4),
null, null, null,
null, tungsten, null,

View File

@ -74,7 +74,6 @@ public class AssemblerRecipes extends SerializableRecipe {
makeRecipe(new ComparableStack(ModItems.asbestos_cloth, 4), new AStack[] {new OreDictStack(ASBESTOS.ingot(), 2), new ComparableStack(Items.string, 6), new ComparableStack(Blocks.wool, 1), },50);
makeRecipe(new ComparableStack(ModItems.filter_coal, 1), new AStack[] {new OreDictStack(COAL.dust(), 4), new ComparableStack(Items.string, 2), new ComparableStack(Items.paper, 1), },50);
makeRecipe(new ComparableStack(ModItems.centrifuge_element, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 4), new OreDictStack(TI.plate528(), 4), new ComparableStack(ModItems.motor, 1), }, 100);
makeRecipe(new ComparableStack(ModItems.magnet_circular, 1), new AStack[] {new ComparableStack(ModBlocks.fusion_conductor, 5), new OreDictStack(STEEL.ingot(), 4), new OreDictStack(ALLOY.plate(), 6), },150);
makeRecipe(new ComparableStack(ModItems.reactor_core, 1), new AStack[] {new OreDictStack(PB.ingot(), 8), new OreDictStack(BE.ingot(), 6), new OreDictStack(STEEL.plate(), 16), new OreDictStack(OreDictManager.getReflector(), 8), new OreDictStack(FIBER.ingot(), 2) },100);
makeRecipe(new ComparableStack(ModItems.rtg_unit, 1), new AStack[] {new ComparableStack(ModItems.thermo_element, 2), new OreDictStack(CU.plateCast(), 1), new OreDictStack(PB.ingot(), 2), new OreDictStack(STEEL.plate(), 2), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.CAPACITOR.ordinal()), },100);
makeRecipe(new ComparableStack(ModItems.levitation_unit, 1), new AStack[] {new ComparableStack(ModItems.coil_copper, 4), new ComparableStack(ModItems.coil_tungsten, 2), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.nugget_schrabidium, 2), },100);
@ -626,34 +625,31 @@ public class AssemblerRecipes extends SerializableRecipe {
makeRecipe(new ComparableStack(ModBlocks.turret_chekhov, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 16),
new OreDictStack(DURA.ingot(), 4),
new ComparableStack(ModItems.motor, 3),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED),
new OreDictStack(STEEL.pipe(), 3),
new ComparableStack(ModItems.mechanism_rifle_2, 1),
new OreDictStack(GUNMETAL.mechanism(), 3),
new ComparableStack(ModBlocks.crate_iron, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_friendly, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 16),
new OreDictStack(DURA.ingot(), 4),
new ComparableStack(ModItems.motor, 3),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BASIC),
new OreDictStack(STEEL.pipe(), 3),
new ComparableStack(ModItems.mechanism_rifle_1, 1),
new OreDictStack(GUNMETAL.mechanism(), 1),
new ComparableStack(ModBlocks.crate_iron, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_jeremy, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 16),
new OreDictStack(DURA.ingot(), 4),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED),
new ComparableStack(ModItems.motor_desh, 1),
new OreDictStack(STEEL.shell(), 3),
new ComparableStack(ModItems.mechanism_launcher_2, 1),
new OreDictStack(WEAPONSTEEL.mechanism(), 3),
new ComparableStack(ModBlocks.crate_steel, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
@ -665,42 +661,39 @@ public class AssemblerRecipes extends SerializableRecipe {
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED),
new ComparableStack(ModItems.motor_desh, 1),
new OreDictStack(CU.ingot(), 32),
new ComparableStack(ModItems.mechanism_special, 1),
new OreDictStack(BIGMT.mechanism(), 3),
new ComparableStack(ModItems.battery_lithium, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_richard, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 16),
new OreDictStack(DURA.ingot(), 4),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED),
new OreDictStack(ANY_PLASTIC.ingot(), 2),
new OreDictStack(STEEL.shell(), 8),
new ComparableStack(ModItems.mechanism_launcher_2, 1),
new OreDictStack(WEAPONSTEEL.mechanism(), 3),
new ComparableStack(ModBlocks.crate_steel, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_howard, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 24),
new OreDictStack(DURA.ingot(), 6),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.motor_desh, 2),
new ComparableStack(ModItems.circuit, 3, EnumCircuitType.ADVANCED),
new OreDictStack(STEEL.pipe(), 10),
new ComparableStack(ModItems.mechanism_rifle_2, 2),
new OreDictStack(WEAPONSTEEL.mechanism(), 3),
new ComparableStack(ModBlocks.crate_steel, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_maxwell, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_lithium_battery, 1),
new OreDictStack(STEEL.ingot(), 24),
new OreDictStack(DURA.ingot(), 6),
new ComparableStack(ModItems.motor, 2),
new ComparableStack(ModItems.circuit, 2, EnumCircuitType.ADVANCED),
new OreDictStack(STEEL.pipe(), 4),
new ComparableStack(ModItems.mechanism_special, 3),
new OreDictStack(BIGMT.mechanism(), 3),
new ComparableStack(ModItems.magnetron, 16),
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 8),
new ComparableStack(ModItems.crt_display, 1)
@ -708,33 +701,30 @@ public class AssemblerRecipes extends SerializableRecipe {
makeRecipe(new ComparableStack(ModBlocks.turret_fritz, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 16),
new OreDictStack(DURA.ingot(), 4),
new ComparableStack(ModItems.motor, 3),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED),
new OreDictStack(STEEL.pipe(), 8),
new ComparableStack(ModItems.mechanism_launcher_1, 1),
new OreDictStack(GUNMETAL.mechanism(), 3),
new ComparableStack(ModBlocks.barrel_steel, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_arty, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 128),
new OreDictStack(DURA.ingot(), 32),
new ComparableStack(ModItems.motor_desh, 5),
new ComparableStack(ModItems.circuit, 3, EnumCircuitType.ADVANCED),
new OreDictStack(STEEL.pipe(), 12),
new ComparableStack(ModItems.mechanism_launcher_2, 3),
new OreDictStack(WEAPONSTEEL.mechanism(), 16),
new ComparableStack(ModBlocks.machine_radar, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.turret_himars, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_battery, 1),
new OreDictStack(STEEL.ingot(), 128),
new OreDictStack(DURA.ingot(), 64),
new OreDictStack(ANY_PLASTIC.ingot(), 64),
new ComparableStack(ModItems.motor_desh, 5),
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.ADVANCED),
new ComparableStack(ModItems.mechanism_launcher_2, 5),
new OreDictStack(BIGMT.mechanism(), 8),
new ComparableStack(ModBlocks.machine_radar, 1),
new ComparableStack(ModItems.crt_display, 1)
}, 300);

View File

@ -8,10 +8,12 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.handler.nei.RBMKRodDisassemblyHandler;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
import com.hbm.items.machine.ItemRBMKRod;
import net.minecraft.item.ItemStack;
@ -40,6 +42,12 @@ public class FuelPoolRecipes extends SerializableRecipe {
recipes.put(new ComparableStack(ModItems.waste_plate_pu238be, 1, 1), new ItemStack(ModItems.waste_plate_pu238be));
for(EnumPWRFuel pwr : EnumPWRFuel.values()) recipes.put(new ComparableStack(ModItems.pwr_fuel_hot, 1, pwr.ordinal()), new ItemStack(ModItems.pwr_fuel_depleted, 1, pwr.ordinal()));
for(ItemRBMKRod rod : ItemRBMKRod.craftableRods) {
ItemStack result = new ItemStack(rod);
ItemRBMKRod.setYield(result, 0.2 * rod.yield);
recipes.put(new RBMKRodDisassemblyHandler.ComparableStackHeat(rod, true), result);
}
}
@Override

View File

@ -74,6 +74,15 @@ public class PedestalRecipes extends SerializableRecipe {
new ComparableStack(ModItems.item_secret, 4, EnumSecretType.SELENIUM_STEEL), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.CONTROLLER), new ComparableStack(ModItems.item_secret, 4, EnumSecretType.SELENIUM_STEEL))
.extra(PedestalExtraCondition.FULL_MOON));
recipes.add(new PedestalRecipe(new ItemStack(ModItems.gun_aberrator),
null, new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), null,
new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), new OreDictStack(BIGMT.mechanism(), 4), new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR),
null, new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), null));
recipes.add(new PedestalRecipe(new ItemStack(ModItems.gun_aberrator_eott),
new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR),
new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), new OreDictStack(BIGMT.mechanism(), 16), new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR),
new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR)));
recipes.add(new PedestalRecipe(new ItemStack(ModItems.ammo_secret, 1, EnumAmmoSecret.FOLLY_SM.ordinal()),
new OreDictStack(STAR.ingot(), 1), new ComparableStack(ModItems.powder_magic), new OreDictStack(STAR.ingot(), 1),
new ComparableStack(ModItems.powder_magic), new ComparableStack(ModBlocks.moon_turf), new ComparableStack(ModItems.powder_magic),
@ -84,6 +93,10 @@ public class PedestalRecipes extends SerializableRecipe {
new ComparableStack(ModItems.powder_magic), new ComparableStack(ModItems.ammo_standard, 4, EnumAmmo.NUKE_HIGH), new ComparableStack(ModItems.powder_magic),
new OreDictStack(STAR.ingot(), 1), new ComparableStack(ModItems.powder_magic), new OreDictStack(STAR.ingot(), 1))
.extra(PedestalExtraCondition.FULL_MOON));
recipes.add(new PedestalRecipe(new ItemStack(ModItems.ammo_secret, 5, EnumAmmoSecret.P35_800.ordinal()),
null, null, null,
null, new ComparableStack(ModItems.item_secret, 1, EnumSecretType.ABERRATOR), null,
null, null, null));
}
@Override

View File

@ -3,6 +3,7 @@ package com.hbm.itempool;
import static com.hbm.lib.HbmChestContents.weighted;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.material.Mats;
import com.hbm.items.ItemEnums.EnumCokeType;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
@ -23,6 +24,7 @@ public class ItemPoolsComponent {
public static final String POOL_VAULT_LAB = "POOL_VAULT_LAB";
public static final String POOL_VAULT_LOCKERS = "POOL_VAULT_LOCKERS";
public static final String POOL_METEOR_SAFE = "POOL_METEOR_SAFE";
public static final String POOL_OIL_RIG = "POOL_OIL_RIG";
public static void init() {
@ -197,5 +199,16 @@ public class ItemPoolsComponent {
weighted(ModItems.stamp_book, 7, 1, 1, 1),
};
}};
new ItemPool(POOL_OIL_RIG) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.oil_detector, 0, 1, 1, 1),
weighted(ModItems.canister_full, Fluids.OIL.getID(), 1, 4, 5),
weighted(ModBlocks.machine_fraction_tower,0, 0, 1, 1),
weighted(ModBlocks.fraction_spacer,0, 0, 1, 1),
weighted(ModItems.circuit,EnumCircuitType.ANALOG.ordinal(), 1, 4, 1),
weighted(ModItems.circuit, EnumCircuitType.CAPACITOR.ordinal(), 1, 1, 3),
};
}};
}
}

View File

@ -79,7 +79,7 @@ public class ItemEnums {
}
public static enum EnumSecretType {
CANISTER, CONTROLLER, SELENIUM_STEEL
CANISTER, CONTROLLER, SELENIUM_STEEL, ABERRATOR
}
public static enum EnumCasingType {

View File

@ -570,7 +570,6 @@ public class ModItems {
public static Item coil_magnetized_tungsten;
public static Item coil_gold;
public static Item coil_gold_torus;
public static Item magnet_circular;
public static Item component_limiter;
public static Item component_emitter;
public static Item chlorine_pinwheel;
@ -585,14 +584,6 @@ public class ModItems {
public static ItemEnumMulti circuit_star_component;
public static Item circuit_star;
public static Item mechanism_revolver_1;
public static Item mechanism_revolver_2;
public static Item mechanism_rifle_1;
public static Item mechanism_rifle_2;
public static Item mechanism_launcher_1;
public static Item mechanism_launcher_2;
public static Item mechanism_special;
public static Item assembly_nuke;
public static Item casing;
@ -1864,6 +1855,10 @@ public class ModItems {
public static Item dns_plate;
public static Item dns_legs;
public static Item dns_boots;
public static Item taurun_helmet;
public static Item taurun_plate;
public static Item taurun_legs;
public static Item taurun_boots;
public static Item trenchmaster_helmet;
public static Item trenchmaster_plate;
public static Item trenchmaster_legs;
@ -2747,7 +2742,6 @@ public class ModItems {
coil_magnetized_tungsten = new Item().setUnlocalizedName("coil_magnetized_tungsten").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_magnetized_tungsten");
coil_gold = new Item().setUnlocalizedName("coil_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_gold");
coil_gold_torus = new Item().setUnlocalizedName("coil_gold_torus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_gold_torus");
magnet_circular = new Item().setUnlocalizedName("magnet_circular").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":magnet_circular");
component_limiter = new Item().setUnlocalizedName("component_limiter").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":component_limiter");
component_emitter = new Item().setUnlocalizedName("component_emitter").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":component_emitter");
chlorine_pinwheel = new ItemInfiniteFluid(Fluids.CHLORINE, 1, 2).setUnlocalizedName("chlorine_pinwheel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":chlorine_pinwheel");
@ -2832,13 +2826,6 @@ public class ModItems {
circuit_star_piece = (ItemEnumMulti) new ItemEnumMulti(ScrapType.class, true, true).setUnlocalizedName("circuit_star_piece").setCreativeTab(null);
circuit_star_component = (ItemEnumMulti) new ItemCircuitStarComponent().setUnlocalizedName("circuit_star_component").setCreativeTab(null);
circuit_star = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_star").setCreativeTab(null).setTextureName(RefStrings.MODID + ":circuit_star");
mechanism_revolver_1 = new Item().setUnlocalizedName("mechanism_revolver_1").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_1");
mechanism_revolver_2 = new Item().setUnlocalizedName("mechanism_revolver_2").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_3");
mechanism_rifle_1 = new Item().setUnlocalizedName("mechanism_rifle_1").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_2");
mechanism_rifle_2 = new Item().setUnlocalizedName("mechanism_rifle_2").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_4");
mechanism_launcher_1 = new Item().setUnlocalizedName("mechanism_launcher_1").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_5");
mechanism_launcher_2 = new Item().setUnlocalizedName("mechanism_launcher_2").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_6");
mechanism_special = new Item().setUnlocalizedName("mechanism_special").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_7");
assembly_nuke = new Item().setUnlocalizedName("assembly_nuke").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nuke");
casing = new ItemEnumMulti(ItemEnums.EnumCasingType.class, true, true).setUnlocalizedName("casing").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":casing");
@ -4495,6 +4482,16 @@ public class ModItems {
dns_legs = new ArmorDNT(aMatDNS, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000000, 1000000, 100000, 115).cloneStats((ArmorFSB) dns_helmet).setUnlocalizedName("dns_legs").setTextureName(RefStrings.MODID + ":dns_legs");
dns_boots = new ArmorDNT(aMatDNS, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000000, 1000000, 100000, 115).cloneStats((ArmorFSB) dns_helmet).setUnlocalizedName("dns_boots").setTextureName(RefStrings.MODID + ":dns_boots");
ArmorMaterial aMatTaurun = EnumHelper.addArmorMaterial("HBM_TRENCH", 150, new int[] { 3, 8, 6, 3 }, 100);
aMatTaurun.customCraftingMaterial = ModItems.plate_iron;
taurun_helmet = new ArmorTaurun(aMatTaurun, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png")
.addEffect(new PotionEffect(Potion.damageBoost.id, 20, 0))
.setStepSize(1)
.hides(EnumPlayerPart.HAT)
.setUnlocalizedName("taurun_helmet").setTextureName(RefStrings.MODID + ":taurun_helmet");
taurun_plate = new ArmorTaurun(aMatTaurun, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) taurun_helmet).setUnlocalizedName("taurun_plate").setTextureName(RefStrings.MODID + ":taurun_plate");
taurun_legs = new ArmorTaurun(aMatTaurun, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) taurun_helmet).setUnlocalizedName("taurun_legs").setTextureName(RefStrings.MODID + ":taurun_legs");
taurun_boots = new ArmorTaurun(aMatTaurun, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) taurun_helmet).setUnlocalizedName("taurun_boots").setTextureName(RefStrings.MODID + ":taurun_boots");
ArmorMaterial aMatTrench = EnumHelper.addArmorMaterial("HBM_TRENCH", 150, new int[] { 3, 8, 6, 3 }, 100);
aMatTrench.customCraftingMaterial = ModItems.plate_iron;
trenchmaster_helmet = new ArmorTrenchmaster(aMatTrench, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png")
@ -4940,11 +4937,11 @@ public class ModItems {
multitool_joule = new ItemMultitoolPassive().setUnlocalizedName("multitool_joule").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_fist");
multitool_decon = new ItemMultitoolPassive().setUnlocalizedName("multitool_decon").setCreativeTab(null).setTextureName(RefStrings.MODID + ":multitool_fist");
saw = new ModSword(MainRegistry.enumToolMaterialSaw).setUnlocalizedName("weapon_saw").setFull3D().setTextureName(RefStrings.MODID + ":saw");
bat = new ModSword(MainRegistry.enumToolMaterialBat).setUnlocalizedName("weapon_bat").setFull3D().setTextureName(RefStrings.MODID + ":bat");
bat_nail = new ModSword(MainRegistry.enumToolMaterialBatNail).setUnlocalizedName("weapon_bat_nail").setFull3D().setTextureName(RefStrings.MODID + ":bat_nail");
golf_club = new ModSword(MainRegistry.enumToolMaterialGolfClub).setUnlocalizedName("weapon_golf_club").setFull3D().setTextureName(RefStrings.MODID + ":golf_club");
pipe_rusty = new ModSword(MainRegistry.enumToolMaterialPipeRusty).setUnlocalizedName("weapon_pipe_rusty").setFull3D().setTextureName(RefStrings.MODID + ":pipe_rusty");
saw = new ModSword(MainRegistry.enumToolMaterialSaw).setUnlocalizedName("weapon_saw").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":saw");
bat = new ModSword(MainRegistry.enumToolMaterialBat).setUnlocalizedName("weapon_bat").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":bat");
bat_nail = new ModSword(MainRegistry.enumToolMaterialBatNail).setUnlocalizedName("weapon_bat_nail").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":bat_nail");
golf_club = new ModSword(MainRegistry.enumToolMaterialGolfClub).setUnlocalizedName("weapon_golf_club").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":golf_club");
pipe_rusty = new ModSword(MainRegistry.enumToolMaterialPipeRusty).setUnlocalizedName("weapon_pipe_rusty").setCreativeTab(null).setFull3D().setTextureName(RefStrings.MODID + ":pipe_rusty");
pipe_lead = new ModSword(MainRegistry.enumToolMaterialPipeLead).setUnlocalizedName("weapon_pipe_lead").setFull3D().setTextureName(RefStrings.MODID + ":pipe_lead");
reer_graar = new ModSword(MainRegistry.tMatTitan).setUnlocalizedName("reer_graar").setFull3D().setTextureName(RefStrings.MODID + ":reer_graar_hd");
stopsign = new WeaponSpecial(MainRegistry.tMatAlloy).setUnlocalizedName("stopsign").setTextureName(RefStrings.MODID + ":stopsign");
@ -5562,7 +5559,6 @@ public class ModItems {
GameRegistry.registerItem(motor_desh, motor_desh.getUnlocalizedName());
GameRegistry.registerItem(motor_bismuth, motor_bismuth.getUnlocalizedName());
GameRegistry.registerItem(centrifuge_element, centrifuge_element.getUnlocalizedName());
GameRegistry.registerItem(magnet_circular, magnet_circular.getUnlocalizedName());
GameRegistry.registerItem(reactor_core, reactor_core.getUnlocalizedName());
GameRegistry.registerItem(rtg_unit, rtg_unit.getUnlocalizedName());
GameRegistry.registerItem(levitation_unit, levitation_unit.getUnlocalizedName());
@ -5669,15 +5665,6 @@ public class ModItems {
GameRegistry.registerItem(circuit_star_component, circuit_star_component.getUnlocalizedName());
GameRegistry.registerItem(circuit_star, circuit_star.getUnlocalizedName());
//Gun Mechanisms
GameRegistry.registerItem(mechanism_revolver_1, mechanism_revolver_1.getUnlocalizedName());
GameRegistry.registerItem(mechanism_revolver_2, mechanism_revolver_2.getUnlocalizedName());
GameRegistry.registerItem(mechanism_rifle_1, mechanism_rifle_1.getUnlocalizedName());
GameRegistry.registerItem(mechanism_rifle_2, mechanism_rifle_2.getUnlocalizedName());
GameRegistry.registerItem(mechanism_launcher_1, mechanism_launcher_1.getUnlocalizedName());
GameRegistry.registerItem(mechanism_launcher_2, mechanism_launcher_2.getUnlocalizedName());
GameRegistry.registerItem(mechanism_special, mechanism_special.getUnlocalizedName());
//Casing
GameRegistry.registerItem(casing, casing.getUnlocalizedName());
@ -7023,6 +7010,10 @@ public class ModItems {
GameRegistry.registerItem(dns_plate, dns_plate.getUnlocalizedName());
GameRegistry.registerItem(dns_legs, dns_legs.getUnlocalizedName());
GameRegistry.registerItem(dns_boots, dns_boots.getUnlocalizedName());
GameRegistry.registerItem(taurun_helmet, taurun_helmet.getUnlocalizedName());
GameRegistry.registerItem(taurun_plate, taurun_plate.getUnlocalizedName());
GameRegistry.registerItem(taurun_legs, taurun_legs.getUnlocalizedName());
GameRegistry.registerItem(taurun_boots, taurun_boots.getUnlocalizedName());
GameRegistry.registerItem(trenchmaster_helmet, trenchmaster_helmet.getUnlocalizedName());
GameRegistry.registerItem(trenchmaster_plate, trenchmaster_plate.getUnlocalizedName());
GameRegistry.registerItem(trenchmaster_legs, trenchmaster_legs.getUnlocalizedName());

View File

@ -0,0 +1,34 @@
package com.hbm.items.armor;
import com.hbm.render.model.ModelArmorTaurun;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ArmorTaurun extends ArmorFSB {
public ArmorTaurun(ArmorMaterial material, int slot, String texture) {
super(material, slot, texture);
this.setMaxDamage(0);
}
@SideOnly(Side.CLIENT)
ModelArmorTaurun[] models;
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if(models == null) {
models = new ModelArmorTaurun[4];
for(int i = 0; i < 4; i++)
models[i] = new ModelArmorTaurun(i);
}
return models[armorSlot];
}
}

View File

@ -32,6 +32,10 @@ public class ItemRBMKPellet extends ItemNuclearWaste {
return this;
}
public boolean isXenonEnabled() {
return hasXenon;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list) {

View File

@ -1,5 +1,6 @@
package com.hbm.items.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.function.BiFunction;
@ -56,9 +57,13 @@ public class ItemRBMKRod extends Item {
* i drew a fuel rod yay
*/
public static List<ItemRBMKRod> craftableRods = new ArrayList<>();
public ItemRBMKRod(ItemRBMKPellet pellet) {
this(pellet.fullName);
this.pellet = pellet;
craftableRods.add(this);
}
public ItemRBMKRod(String fullName) {
@ -281,7 +286,7 @@ public class ItemRBMKRod extends Item {
break;
case LOG_TEN: function = "log10(%1$s + 1) * 0.5 * %2$s";
break;
case PLATEU: function = "(1 - e^-%1$s / 25)) * %2$s";
case PLATEU: function = "(1 - e^(-%1$s / 25)) * %2$s";
break;
case ARCH: function = "(%1$s - %1$s² / 10000) / 100 * %2$s [0;∞]";
break;
@ -420,6 +425,10 @@ public class ItemRBMKRod extends Item {
if(this == ModItems.rbmk_fuel_drx) {
if(ItemRBMKRod.getHullHeat(stack) >= 50 || ItemRBMKRod.getCoreHeat(stack) >= 50) {
list.add(EnumChatFormatting.GOLD + I18nUtil.resolveKey("desc.item.wasteCooling"));
}
if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) {
list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.source"));
}
@ -440,6 +449,10 @@ public class ItemRBMKRod extends Item {
} else {
if(ItemRBMKRod.getHullHeat(stack) >= 50 || ItemRBMKRod.getCoreHeat(stack) >= 50) {
list.add(EnumChatFormatting.GOLD + I18nUtil.resolveKey("desc.item.wasteCooling"));
}
if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) {
list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmk.source"));
}

View File

@ -2,8 +2,11 @@ package com.hbm.items.tool;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -12,76 +15,67 @@ import net.minecraft.world.World;
public class ItemWand extends Item {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add("Creative-only item");
list.add("\"Destruction brings creation\"");
list.add("(Set positions with right click,");
list.add("set block with shift-right click!)");
if(itemstack.stackTagCompound != null &&
!(itemstack.stackTagCompound.getInteger("x") == 0 &&
itemstack.stackTagCompound.getInteger("y") == 0 &&
itemstack.stackTagCompound.getInteger("z") == 0))
{
list.add("Pos: " + itemstack.stackTagCompound.getInteger("x") + ", " + itemstack.stackTagCompound.getInteger("y") + ", " + itemstack.stackTagCompound.getInteger("z"));
if(stack.stackTagCompound != null && !(stack.stackTagCompound.getInteger("x") == 0 && stack.stackTagCompound.getInteger("y") == 0 && stack.stackTagCompound.getInteger("z") == 0)) {
list.add("Pos: " + stack.stackTagCompound.getInteger("x") + ", " + stack.stackTagCompound.getInteger("y") + ", " + stack.stackTagCompound.getInteger("z"));
} else {
list.add("Positions not set!");
}
if(itemstack.stackTagCompound != null)
list.add("Block saved: " + Block.getBlockById(itemstack.stackTagCompound.getInteger("block")).getUnlocalizedName());
if(stack.stackTagCompound != null)
list.add("Block saved: " + Block.getBlockById(stack.stackTagCompound.getInteger("block")).getUnlocalizedName());
}
@Override
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
if(p_77648_1_.stackTagCompound == null)
{
p_77648_1_.stackTagCompound = new NBTTagCompound();
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fx, float fy, float fz) {
if(stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
}
if(p_77648_2_.isSneaking())
{
p_77648_1_.stackTagCompound.setInteger("block", Block.getIdFromBlock(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_)));
p_77648_1_.stackTagCompound.setInteger("meta", p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_));
if(p_77648_3_.isRemote)
p_77648_2_.addChatMessage(new ChatComponentText("Set block " + Block.getBlockById(p_77648_1_.stackTagCompound.getInteger("block")).getUnlocalizedName()));
if(player.isSneaking()) {
stack.stackTagCompound.setInteger("block", Block.getIdFromBlock(world.getBlock(x, y, z)));
stack.stackTagCompound.setInteger("meta", world.getBlockMetadata(x, y, z));
if(world.isRemote)
player.addChatMessage(new ChatComponentText("Set block " + Block.getBlockById(stack.stackTagCompound.getInteger("block")).getUnlocalizedName()));
} else {
if(p_77648_1_.stackTagCompound.getInteger("x") == 0 &&
p_77648_1_.stackTagCompound.getInteger("y") == 0 &&
p_77648_1_.stackTagCompound.getInteger("z") == 0)
{
p_77648_1_.stackTagCompound.setInteger("x", p_77648_4_);
p_77648_1_.stackTagCompound.setInteger("y", p_77648_5_);
p_77648_1_.stackTagCompound.setInteger("z", p_77648_6_);
if(p_77648_3_.isRemote)
p_77648_2_.addChatMessage(new ChatComponentText("Position set!"));
if(stack.stackTagCompound.getInteger("x") == 0 && stack.stackTagCompound.getInteger("y") == 0 && stack.stackTagCompound.getInteger("z") == 0) {
stack.stackTagCompound.setInteger("x", x);
stack.stackTagCompound.setInteger("y", y);
stack.stackTagCompound.setInteger("z", z);
if(world.isRemote)
player.addChatMessage(new ChatComponentText("Position set!"));
} else {
int x = p_77648_1_.stackTagCompound.getInteger("x");
int y = p_77648_1_.stackTagCompound.getInteger("y");
int z = p_77648_1_.stackTagCompound.getInteger("z");
int ox = stack.stackTagCompound.getInteger("x");
int oy = stack.stackTagCompound.getInteger("y");
int oz = stack.stackTagCompound.getInteger("z");
p_77648_1_.stackTagCompound.setInteger("x", 0);
p_77648_1_.stackTagCompound.setInteger("y", 0);
p_77648_1_.stackTagCompound.setInteger("z", 0);
stack.stackTagCompound.setInteger("x", 0);
stack.stackTagCompound.setInteger("y", 0);
stack.stackTagCompound.setInteger("z", 0);
if(!p_77648_3_.isRemote)
{
for(int i = Math.min(x, p_77648_4_); i <= Math.max(x, p_77648_4_); i++)
{
for(int j = Math.min(y, p_77648_5_); j <= Math.max(y, p_77648_5_); j++)
{
for(int k = Math.min(z, p_77648_6_); k <= Math.max(z, p_77648_6_); k++)
{
p_77648_3_.setBlock(i, j, k, Block.getBlockById(p_77648_1_.stackTagCompound.getInteger("block")), p_77648_1_.stackTagCompound.getInteger("meta"), 3);
if(!world.isRemote) {
Block block = Block.getBlockById(stack.stackTagCompound.getInteger("block"));
int meta = stack.stackTagCompound.getInteger("meta");
boolean replaceAir = block == ModBlocks.wand_air;
for(int i = Math.min(ox, x); i <= Math.max(ox, x); i++) {
for(int j = Math.min(oy, y); j <= Math.max(oy, y); j++) {
for(int k = Math.min(oz, z); k <= Math.max(oz, z); k++) {
if(replaceAir && world.getBlock(i, j, k) != Blocks.air) continue;
world.setBlock(i, j, k, block, meta, 3);
}
}
}
}
if(p_77648_3_.isRemote)
p_77648_2_.addChatMessage(new ChatComponentText("Selection filled!"));
if(world.isRemote)
player.addChatMessage(new ChatComponentText("Selection filled!"));
}
}
@ -90,12 +84,10 @@ public class ItemWand extends Item {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(stack.stackTagCompound == null)
{
if(stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
}
if(player.isSneaking())
{
if(player.isSneaking()) {
stack.stackTagCompound.setInteger("block", 0);
stack.stackTagCompound.setInteger("meta", 0);
if(world.isRemote)

View File

@ -14,7 +14,6 @@ import com.hbm.handler.HbmKeybinds.EnumKeybind;
import com.hbm.interfaces.IItemHUD;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.gui.GUIWeaponTable;
import com.hbm.items.IEquipReceiver;
import com.hbm.items.IKeybindReceiver;
import com.hbm.items.weapon.sedna.hud.IHUDComponent;
import com.hbm.items.weapon.sedna.mags.IMagazine;
@ -48,7 +47,7 @@ import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipReceiver, IItemHUD {
public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD {
/** Timestamp for rendering smoke nodes and muzzle flashes */
public long[] lastShot;
@ -96,6 +95,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
public static final String KEY_LOCKONTARGET = "lockontarget";
public static final String KEY_LOCKEDON = "lockedon";
public static final String KEY_CANCELRELOAD = "cancel";
public static final String KEY_EQUIPPED = "eqipped";
public static ConcurrentHashMap<EntityLivingBase, AudioWrapper> loopedSounds = new ConcurrentHashMap();
@ -228,7 +228,6 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
}
}
@Override
public void onEquip(EntityPlayer player, ItemStack stack) {
for(int i = 0; i < this.configs_DNA.length; i++) {
playAnimation(player, stack, AnimType.EQUIP, i);
@ -291,6 +290,17 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
return;
}
/// ON EQUIP ///
if(player != null) {
boolean wasHeld = this.getIsEquipped(stack);
if(!wasHeld && isHeld && player != null) {
this.onEquip(player, stack);
}
}
this.setIsEquipped(stack, isHeld);
/// RESET WHEN NOT EQUIPPED ///
if(!isHeld) {
for(int i = 0; i < confNo; i++) {
@ -359,6 +369,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
// RELOAD CANCEL //
public static boolean getReloadCancel(ItemStack stack) { return getValueBool(stack, KEY_CANCELRELOAD); }
public static void setReloadCancel(ItemStack stack, boolean value) { setValueBool(stack, KEY_CANCELRELOAD, value); }
// EQUIPPED //
public static boolean getIsEquipped(ItemStack stack) { return getValueBool(stack, KEY_EQUIPPED); }
public static void setIsEquipped(ItemStack stack, boolean value) { setValueBool(stack, KEY_EQUIPPED, value); }
/// UTIL ///

View File

@ -139,7 +139,8 @@ public class GunFactory {
}
public static enum EnumModTest {
FIRERATE, DAMAGE, MULTI;
FIRERATE, DAMAGE, MULTI,
OVERRIDE_2_5, OVERRIDE_5, OVERRIDE_7_5, OVERRIDE_10, OVERRIDE_12_5, OVERRIDE_15, OVERRIDE_20;
}
public static enum EnumModGeneric {
@ -158,7 +159,7 @@ public class GunFactory {
SILENCER, SCOPE, SAW, GREASEGUN, SLOWDOWN,
SPEEDUP, CHOKE, SPEEDLOADER,
FURNITURE_GREEN, FURNITURE_BLACK, BAYONET,
STACK_MAG,
STACK_MAG, SKIN_SATURNITE,
}
public static enum EnumModCaliber {

View File

@ -920,7 +920,7 @@ public class Orchestras {
if(type == AnimType.CYCLE) {
if(timer == 0) {
int rounds = WeaponModManager.hasUpgrade(stack, ctx.configIndex, 208) ? 2 : 1;
int rounds = WeaponModManager.hasUpgrade(stack, ctx.configIndex, WeaponModManager.ID_MINIGUN_SPEED) ? 3 : 1;
for(int i = 0; i < rounds; i++) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.5, aiming ? -0.125 : -0.25, aiming ? -0.25 : -0.5D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 15F, (float)entity.getRNG().nextGaussian() * 15F, casing.getName());
@ -1301,7 +1301,7 @@ public class Orchestras {
if(timer == 1) {
int cba = (stack.getItem() == ModItems.gun_aberrator_eott && ctx.configIndex == 0) ? -1 : 1;
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D * cba, -0.05, 0.25, -0.05 * cba, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 12.5F, casing.getName());
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D * cba, -0.05, 0.25, -0.05 * cba, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 12.5F, casing.getName());
}
}

View File

@ -35,7 +35,7 @@ public class XFactory10ga {
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_TINY_EXPLODE = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
Lego.tinyExplode(bullet, mop, 2F); bullet.setDead();
Lego.tinyExplode(bullet, mop, 1.5F); bullet.setDead();
};
public static void init() {

View File

@ -36,7 +36,7 @@ public class XFactory50 {
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_EXPLODE = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
Lego.tinyExplode(bullet, mop, 3.5F); bullet.setDead();
Lego.tinyExplode(bullet, mop, 2F); bullet.setDead();
};
public static void init() {

View File

@ -111,7 +111,7 @@ public class XFactory556mm {
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
case CYCLE: return new BusAnimation()
.addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 20).addPos(0, 0, -4.5, 40).addPos(0, 0, 0, 40))
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -0.75, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_FULL));
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, (ItemGunBaseNT.getIsAiming(stack) || !WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_NO_STOCK)) ? -0.25 : -0.75, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_FULL));
case CYCLE_DRY: return new BusAnimation()
.addBus("BOLT", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -0.3125, 100).hold(25).addPos(0, 0, -2.75, 130).hold(50).addPos(0, 0, -2.4375, 50).addPos(0, 0, 0, 85))
.addBus("PLUG", new BusAnimationSequence().addPos(0, 0, 0, 250).hold(125).addPos(0, 0, -2.4375, 130).hold(100).addPos(0, 0, 0, 85))

View File

@ -3,6 +3,8 @@ package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair;
@ -19,7 +21,9 @@ import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
public class XFactory75Bolt {
@ -27,15 +31,29 @@ public class XFactory75Bolt {
public static BulletConfig b75_inc;
public static BulletConfig b75_exp;
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_TINY_EXPLODE = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
Lego.tinyExplode(bullet, mop, 2F); bullet.setDead();
};
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_INC = (bullet, mop) -> {
if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase) {
HbmLivingProps data = HbmLivingProps.getData((EntityLivingBase) mop.entityHit);
if(data.phosphorus < 300) data.phosphorus = 300;
}
};
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_EXPLODE = (bullet, mop) -> {
Lego.standardExplode(bullet, mop, 5F); bullet.setDead();
};
public static void init() {
SpentCasing casing75 = new SpentCasing(CasingType.STRAIGHT).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(2F, 2F, 1.5F);
b75 = new BulletConfig().setItem(EnumAmmo.B75)
.setCasing(casing75.clone().register("b75"));
.setCasing(casing75.clone().register("b75")).setOnImpact(LAMBDA_TINY_EXPLODE);
b75_inc = new BulletConfig().setItem(EnumAmmo.B75_INC).setDamage(0.8F).setArmorPiercing(0.1F)
.setCasing(casing75.clone().register("b75inc"));
.setCasing(casing75.clone().register("b75inc")).setOnImpact(LAMBDA_INC);
b75_exp = new BulletConfig().setItem(EnumAmmo.B75_EXP).setDamage(1.5F).setArmorPiercing(-0.25F)
.setCasing(casing75.clone().register("b75exp"));
.setCasing(casing75.clone().register("b75exp")).setOnImpact(LAMBDA_STANDARD_EXPLODE);
ModItems.gun_bolter = new ItemGunBaseNT(WeaponQuality.SPECIAL, new GunConfig()
.dura(3_000).draw(20).inspect(31).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)

View File

@ -43,7 +43,7 @@ public class XFactory762mm {
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_TINY_EXPLODE = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
Lego.tinyExplode(bullet, mop, 2F); bullet.setDead();
Lego.tinyExplode(bullet, mop, 1.5F); bullet.setDead();
};
public static void init() {

View File

@ -15,6 +15,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
import com.hbm.main.MainRegistry;
@ -25,7 +26,10 @@ import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.util.EntityDamageUtil;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class XFactory9mm {
@ -64,7 +68,7 @@ public class XFactory9mm {
.dmg(25F).delay(4).dry(10).spread(0.005F).reload(53).jam(44).sound("hbm:weapon.fire.pistol", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 17).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_LAG))
.setupStandardFire().fire(LAMBDA_FIRE_LAG).recoil(LAMBDA_RECOIL_LAG))
.setupStandardConfiguration()
.anim(LAMBDA_LAG_ANIMS).orchestra(Orchestras.ORCHESTRA_LAG)
).setUnlocalizedName("gun_lag");
@ -133,6 +137,27 @@ public class XFactory9mm {
GunStateDecider.deciderAutoRefire(stack, ctx, lastState, 0, index, () -> { return ItemGunBaseNT.getSecondary(stack, index) && ItemGunBaseNT.getMode(stack, ctx.configIndex) == 0; });
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_FIRE_LAG = (stack, ctx) -> {
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
EntityPlayer player = ctx.getPlayer();
if(player != null && type == AnimType.INSPECT && timer > 20 && timer < 60) {
int index = ctx.configIndex;
Receiver primary = ctx.config.getReceivers(stack)[0];
IMagazine mag = primary.getMagazine(stack);
BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory);
player.addStat(MainRegistry.statBullets, 1);
mag.useUpAmmo(stack, ctx.inventory, 1);
ItemGunBaseNT.setWear(stack, index, Math.min(ItemGunBaseNT.getWear(stack, index) + config.wear, ctx.config.getDurability(stack)));
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, primary.getFireSound(stack), primary.getFireVolume(stack), primary.getFirePitch(stack));
ItemGunBaseNT.setState(stack, index, GunState.COOLDOWN);
ItemGunBaseNT.setTimer(stack, index, primary.getDelayAfterFire(stack));
EntityDamageUtil.attackEntityFromNT(player, BulletConfig.getDamage(player, player, DamageClass.PHYSICAL), 1_000F, true, false, 1D, 5F, 0F);
} else {
Lego.doStandardFire(stack, ctx, AnimType.CYCLE, true);
}
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
Lego.handleStandardSmoke(ctx.entity, stack, 2000, 0.05D, 1.1D, ctx.configIndex);
};

View File

@ -132,9 +132,9 @@ public class XFactoryEnergy {
energy_las_ir = new BulletConfig().setItem(EnumAmmo.CAPACITOR_IR).setCasing(new ItemStack(ModItems.ingot_polymer, 2), 4).setupDamageClass(DamageClass.FIRE).setBeam().setSpread(0.0F).setLife(5).setRenderRotations(false).setOnBeamImpact(LAMBDA_IR_HIT);
ModItems.gun_tesla_cannon = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.CIRCLE)
.dura(2_000).draw(10).inspect(33).crosshair(Crosshair.CIRCLE)
.rec(new Receiver(0)
.dmg(35F).delay(20).reload(44).jam(19).sound("hbm:weapon.fire.tesla", 1.0F, 1.0F)
.dmg(35F).delay(20).spreadHipfire(1.5F).reload(44).jam(19).sound("hbm:weapon.fire.tesla", 1.0F, 1.0F)
.mag(new MagazineBelt().addConfigs(energy_tesla, energy_tesla_overcharge))
.offset(0.75, 0, -0.375).offsetScoped(0.75, 0, -0.25)
.setupStandardFire().recoil(LAMBDA_RECOIL_ENERGY))
@ -143,9 +143,9 @@ public class XFactoryEnergy {
).setUnlocalizedName("gun_tesla_cannon");
ModItems.gun_lasrifle = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(26).reloadSequential(true).crosshair(Crosshair.CIRCLE).scopeTexture(scope_luna)
.dura(2_000).draw(10).inspect(26).crosshair(Crosshair.CIRCLE).scopeTexture(scope_luna)
.rec(new Receiver(0)
.dmg(50F).delay(8).reload(44).jam(36).sound("hbm:weapon.fire.laser", 1.0F, 1.0F)
.dmg(50F).delay(8).spreadHipfire(1F).reload(44).jam(36).sound("hbm:weapon.fire.laser", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 24).addConfigs(energy_las, energy_las_overcharge, energy_las_ir))
.offset(0.75, -0.0625 * 1.5, -0.1875)
.setupStandardFire().recoil(LAMBDA_RECOIL_ENERGY))

View File

@ -10,4 +10,7 @@ public interface IWeaponMod {
/** The meat and bones of the upgrade eval. Requires the base value, the held gun, the value's
* identifier and the yet unmodified parent (i.e. if the value is part of the receiver, that receiver) */
public <T> T eval(T base, ItemStack gun, String key, Object parent);
public default void onInstall(ItemStack gun, ItemStack mod, int index) { }
public default void onUninstall(ItemStack gun, ItemStack mod, int index) { }
}

View File

@ -4,10 +4,13 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.items.weapon.sedna.mags.MagazineBelt;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
import com.hbm.items.weapon.sedna.mags.MagazineSingleTypeBase;
import net.minecraft.item.ItemStack;
@ -46,7 +49,6 @@ public class WeaponModCaliber extends WeaponModBase {
return (T) DUMMY_FULL;
}
if(base instanceof MagazineBelt) {
MagazineBelt original = (MagazineBelt) base;
DUMMY_BELT.acceptedBullets = cfg;
return (T) DUMMY_BELT;
}
@ -56,4 +58,17 @@ public class WeaponModCaliber extends WeaponModBase {
}
return base;
}
/* adding or removing a caliber mod annihilates the loaded rounds */
public void onInstall(ItemStack gun, ItemStack mod, int index) { clearMag(gun, index); }
public void onUninstall(ItemStack gun, ItemStack mod, int index) { clearMag(gun, index); }
public void clearMag(ItemStack stack, int index) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
IMagazine mag = gun.getConfig(stack, index).getReceivers(stack)[0].getMagazine(stack);
if(mag instanceof MagazineSingleTypeBase) {
MagazineSingleTypeBase mstb = (MagazineSingleTypeBase) mag;
mstb.setAmount(stack, 0);
}
}
}

View File

@ -58,13 +58,20 @@ public class WeaponModManager {
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.DAMAGE.ordinal())).addDefault(TEST_DAMAGE);
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.MULTI.ordinal())).addDefault(TEST_MULTI);
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_2_5.ordinal())).addDefault(new WeaponModOverride(3, 2.5F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_5.ordinal())).addDefault(new WeaponModOverride(4, 5F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_7_5.ordinal())).addDefault(new WeaponModOverride(5, 7.5F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_10.ordinal())).addDefault(new WeaponModOverride(6, 10F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_12_5.ordinal())).addDefault(new WeaponModOverride(7, 12_5F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_15.ordinal())).addDefault(new WeaponModOverride(8, 15F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_test, 1, EnumModTest.OVERRIDE_20.ordinal())).addDefault(new WeaponModOverride(9, 20F, "OVERRIDE"));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.IRON_DAMAGE.ordinal())).addMod(ModItems.gun_pepperbox, new WeaponModGenericDamage(100));
new WeaponModDefinition(new ItemStack(ModItems.weapon_mod_generic, 1, EnumModGeneric.IRON_DURA.ordinal())).addMod(ModItems.gun_pepperbox, new WeaponModGenericDurability(101));
Item[] steelGuns = new Item[] {
ModItems.gun_light_revolver, ModItems.gun_light_revolver_atlas,
ModItems.gun_henry,
ModItems.gun_henry_lincoln,
ModItems.gun_henry, ModItems.gun_henry_lincoln,
ModItems.gun_greasegun,
ModItems.gun_maresleg, ModItems.gun_maresleg_akimbo,
ModItems.gun_flaregun };
@ -127,13 +134,14 @@ public class WeaponModManager {
new WeaponModDefinition(EnumModSpecial.GREASEGUN).addMod(ModItems.gun_greasegun, new WeaponModGreasegun(ID_GREASEGUN_CLEAN));
new WeaponModDefinition(EnumModSpecial.SLOWDOWN).addMod(ModItems.gun_minigun, new WeaponModSlowdown(207));
new WeaponModDefinition(EnumModSpecial.SPEEDUP)
.addMod(ModItems.gun_minigun, new WeaponModMinigunSpeedup(208))
.addMod(ModItems.gun_minigun, new WeaponModMinigunSpeedup(ID_MINIGUN_SPEED))
.addMod(new Item[] {ModItems.gun_autoshotgun, ModItems.gun_autoshotgun_shredder}, new WeaponModShredderSpeedup(209));
new WeaponModDefinition(EnumModSpecial.CHOKE).addMod(new Item[] {ModItems.gun_pepperbox, ModItems.gun_maresleg, ModItems.gun_double_barrel, ModItems.gun_liberator, ModItems.gun_spas12}, new WeaponModChoke(210));
new WeaponModDefinition(EnumModSpecial.FURNITURE_GREEN).addMod(ModItems.gun_g3, new WeaponModPolymerFurniture(ID_FURNITURE_GREEN));
new WeaponModDefinition(EnumModSpecial.FURNITURE_BLACK).addMod(ModItems.gun_g3, new WeaponModPolymerFurniture(ID_FURNITURE_BLACK));
new WeaponModDefinition(EnumModSpecial.BAYONET).addMod(ModItems.gun_mas36, new WeaponModMASBayonet(ID_MAS_BAYONET));
new WeaponModDefinition(EnumModSpecial.STACK_MAG).addMod(new Item[] {ModItems.gun_greasegun, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_aberrator, ModItems.gun_aberrator_eott}, new WeaponModStackMag(214));
new WeaponModDefinition(EnumModSpecial.SKIN_SATURNITE).addMod(new Item[] {ModItems.gun_uzi, ModItems.gun_uzi_akimbo}, new WeaponModUziSaturnite(ID_UZI_SATURN));
BulletConfig[] p9 = new BulletConfig[] {XFactory9mm.p9_sp, XFactory9mm.p9_fmj, XFactory9mm.p9_jhp, XFactory9mm.p9_ap};
BulletConfig[] p45 = new BulletConfig[] {XFactory45.p45_sp, XFactory45.p45_fmj, XFactory45.p45_jhp, XFactory45.p45_ap, XFactory45.p45_du};
@ -150,7 +158,7 @@ public class WeaponModManager {
.addMod(ModItems.gun_greasegun, new WeaponModCaliber(311, 24, 3F, p45))
.addMod(ModItems.gun_uzi, new WeaponModCaliber(312, 24, 3F, p45))
.addMod(ModItems.gun_uzi_akimbo, new WeaponModCaliber(313, 24, 3F, p45))
.addMod(ModItems.gun_lag, new WeaponModCaliber(314, 24, 25F, p45));
.addMod(ModItems.gun_lag, new WeaponModCaliber(314, 15, 25F, p45));
new WeaponModDefinition(EnumModCaliber.P22)
.addMod(ModItems.gun_henry, new WeaponModCaliber(320, 28, 10F, p22))
.addMod(ModItems.gun_uzi, new WeaponModCaliber(321, 40, 3F, p22))
@ -178,9 +186,11 @@ public class WeaponModManager {
public static final int ID_NO_SHIELD = 204;
public static final int ID_NO_STOCK = 205;
public static final int ID_GREASEGUN_CLEAN = 206;
public static final int ID_MINIGUN_SPEED = 208;
public static final int ID_FURNITURE_GREEN = 211;
public static final int ID_FURNITURE_BLACK = 212;
public static final int ID_MAS_BAYONET = 213;
public static final int ID_UZI_SATURN = 215;
public static ItemStack[] getUpgradeItems(ItemStack stack, int cfg) {
if(!stack.hasTagCompound()) return new ItemStack[0];
@ -240,12 +250,29 @@ public class WeaponModManager {
}
}
public static boolean isApplicable(ItemStack gun, ItemStack mod, int cfg, boolean checkMutex) {
if(gun == null || mod == null) return false; //if either stacks are null
public static void onInstallStack(ItemStack gun, ItemStack mod, int cfg) {
IWeaponMod newMod = modFromStack(gun, mod, cfg);
if(newMod == null) return;
newMod.onInstall(gun, mod, cfg);
}
public static void onUninstallStack(ItemStack gun, ItemStack mod, int cfg) {
IWeaponMod newMod = modFromStack(gun, mod, cfg);
if(newMod == null) return;
newMod.onUninstall(gun, mod, cfg);
}
public static IWeaponMod modFromStack(ItemStack gun, ItemStack mod, int cfg) {
if(gun == null || mod == null) return null;
WeaponModDefinition def = stackToMod.get(new ComparableStack(mod));
if(def == null) return false; //if the mod stack doesn't have a mod definition
IWeaponMod newMod = def.modByGun.get(new ComparableStack(gun));
if(newMod == null) newMod = def.modByGun.get(null); //if there's no per-gun mod, default to null key
if(def == null) return null;
IWeaponMod newMod = def.modByGun.get(new ComparableStack(gun).makeSingular()); //shift clicking causes the gun to have stack size 0!
if(newMod == null) newMod = def.modByGun.get(null);
return newMod;
}
public static boolean isApplicable(ItemStack gun, ItemStack mod, int cfg, boolean checkMutex) {
IWeaponMod newMod = modFromStack(gun, mod, cfg);
if(newMod == null) return false; //if there's just no mod applicable
if(checkMutex) for(int i : gun.stackTagCompound.getIntArray(KEY_MOD_LIST + cfg)) {

View File

@ -0,0 +1,22 @@
package com.hbm.items.weapon.sedna.mods;
import com.hbm.items.weapon.sedna.Receiver;
import net.minecraft.item.ItemStack;
public class WeaponModOverride extends WeaponModBase {
protected final float baseDamage;
public WeaponModOverride(int id, float baseDamage, String... slots) {
super(id, slots);
this.baseDamage = baseDamage;
this.setPriority(PRIORITY_SET);
}
@Override
public <T> T eval(T base, ItemStack gun, String key, Object parent) {
if(key == Receiver.F_BASEDAMAGE) return cast(baseDamage, base);
return base;
}
}

View File

@ -0,0 +1,22 @@
package com.hbm.items.weapon.sedna.mods;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.Receiver;
import net.minecraft.item.ItemStack;
public class WeaponModUziSaturnite extends WeaponModBase {
public WeaponModUziSaturnite(int id) {
super(id, "FURNITURE");
this.setPriority(PRIORITY_ADDITIVE);
}
@Override
public <T> T eval(T base, ItemStack gun, String key, Object parent) {
if(key == GunConfig.F_DURABILITY) return cast((Float) base * 5F, base);
if(key == Receiver.F_BASEDAMAGE) return cast((Float) base + 3F, base);
return base;
}
}

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (5257)";
public static final String VERSION = "1.0.27 BETA (5279)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -6,7 +6,8 @@
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
import com.hbm.blocks.generic.BlockPedestal.TileEntityPedestal;
import com.hbm.blocks.generic.BlockPlushie.TileEntityPlushie;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.blocks.generic.BlockSkeletonHolder.TileEntitySkeletonHolder;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.blocks.machine.Floodlight.TileEntityFloodlight;
import com.hbm.blocks.machine.MachineFan.TileEntityFan;
import com.hbm.blocks.machine.PistonInserter.TileEntityPistonInserter;
@ -201,6 +202,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFloodlight.class, new RenderFloodlight());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLoot.class, new RenderLoot());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPedestal.class, new RenderPedestalTile());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkeletonHolder.class, new RenderSkeletonHolder());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBobble.class, new RenderBobble());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySnowglobe.class, new RenderSnowglobe());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPlushie.class, new RenderPlushie());
@ -740,10 +742,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityRADBeast.class, new RenderRADBeast());
RenderingRegistry.registerEntityRenderingHandler(EntityBlockSpider.class, new RenderBlockSpider());
RenderingRegistry.registerEntityRenderingHandler(EntityUFO.class, new RenderUFO());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeZombie.class, new RenderSiegeZombie());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeUFO.class, new RenderSiegeUFO());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeCraft.class, new RenderSiegeCraft());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeSkeleton.class, new RenderSiegeSkeleton());
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeTunneler.class, new RenderSiegeTunneler());
RenderingRegistry.registerEntityRenderingHandler(EntityGhost.class, new RenderGhost());
RenderingRegistry.registerEntityRenderingHandler(EntityGlyphid.class, new RenderGlyphid());
@ -759,6 +758,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityPlasticBag.class, new RenderPlasticBag());
RenderingRegistry.registerEntityRenderingHandler(EntityPigeon.class, new RenderPigeon(new ModelPigeon(), 0.3F));
RenderingRegistry.registerEntityRenderingHandler(EntityDummy.class, new RenderDummy());
RenderingRegistry.registerEntityRenderingHandler(EntityUndeadSoldier.class, new RenderUndeadSoldier());
//"particles"
RenderingRegistry.registerEntityRenderingHandler(EntityChlorineFX.class, new MultiCloudRenderer(new Item[] { ModItems.chlorine1, ModItems.chlorine2, ModItems.chlorine3, ModItems.chlorine4, ModItems.chlorine5, ModItems.chlorine6, ModItems.chlorine7, ModItems.chlorine8 }));
RenderingRegistry.registerEntityRenderingHandler(EntityPinkCloudFX.class, new MultiCloudRenderer(new Item[] { ModItems.pc1, ModItems.pc2, ModItems.pc3, ModItems.pc4, ModItems.pc5, ModItems.pc6, ModItems.pc7, ModItems.pc8 }));
@ -1760,7 +1760,7 @@ public class ClientProxy extends ServerProxy {
.addPos(90, 0, 1, 800)
.addPos(0, 0, 1, 50));
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, null);
}
/* crucible swing */
@ -1782,7 +1782,7 @@ public class ClientProxy extends ServerProxy {
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:weapon.cSwing"), 0.8F + player.getRNG().nextFloat() * 0.2F));
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, null);
}
}
@ -1806,7 +1806,7 @@ public class ClientProxy extends ServerProxy {
.addPos(0, 0, 0, retire));
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, null);
} else {
@ -1827,7 +1827,7 @@ public class ClientProxy extends ServerProxy {
.addPos(2, 0, 2, sideways)
.addPos(0, 0, 0, retire));
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation);
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, null);
}
}
@ -1839,7 +1839,7 @@ public class ClientProxy extends ServerProxy {
BusAnimation anim = item.getAnimation(data, stack);
if(anim != null) {
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), anim);
HbmAnimations.hotbar[player.inventory.currentItem][0] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), anim, null);
}
}
}

View File

@ -212,7 +212,7 @@ public class CraftingManager {
addShapelessAuto(new ItemStack(ModItems.cbt_device, 1), new Object[] { STEEL.bolt(), ModItems.wrench });
addShapelessAuto(new ItemStack(ModItems.toothpicks, 3), new Object[] { KEY_STICK, KEY_STICK, KEY_STICK });
addRecipeAuto(new ItemStack(ModItems.ducttape, 6), new Object[] { "FSF", "SPS", "FSF", 'F', Items.string, 'S', KEY_SLIME, 'P', Items.paper });
addRecipeAuto(new ItemStack(ModItems.ducttape, 4), new Object[] { "F", "P", "S", 'F', Items.string, 'S', KEY_SLIME, 'P', Items.paper });
addRecipeAuto(new ItemStack(ModBlocks.radio_torch_sender, 4), new Object[] { "G", "R", "I", 'G', "dustGlowstone", 'R', Blocks.redstone_torch, 'I', NETHERQUARTZ.gem() });
addRecipeAuto(new ItemStack(ModBlocks.radio_torch_receiver, 4), new Object[] { "G", "R", "I", 'G', "dustGlowstone", 'R', Blocks.redstone_torch, 'I', IRON.ingot() });
@ -351,14 +351,6 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.stamp_desh_flat, 1), new Object[] { "BDB", "DSD", "BDB", 'B', brick, 'D', DESH.ingot(), 'S', FERRO.ingot() });
}
addRecipeAuto(new ItemStack(ModItems.mechanism_revolver_1, 1), new Object[] { "ICI", "CAC", "ICI", 'I', IRON.plate(), 'C', CU.ingot(), 'A', AL.ingot() });
addRecipeAuto(new ItemStack(ModItems.mechanism_revolver_2, 1), new Object[] { "ATA", "TDT", "ATA", 'A', ALLOY.plate(), 'T', W.ingot(), 'D', DURA.ingot() });
addRecipeAuto(new ItemStack(ModItems.mechanism_rifle_1, 1), new Object[] { "ICI", "MAM", "ICI", 'I', IRON.plate(), 'C', CU.ingot(), 'A', AL.ingot(), 'M', ModItems.mechanism_revolver_1 });
addRecipeAuto(new ItemStack(ModItems.mechanism_rifle_2, 1), new Object[] { "ATA", "MDM", "ATA", 'A', ALLOY.plate(), 'T', W.ingot(), 'D', DURA.ingot(), 'M', ModItems.mechanism_revolver_2 });
addRecipeAuto(new ItemStack(ModItems.mechanism_launcher_1, 1), new Object[] { "TTT", "SSS", "BBI", 'T', TI.plate(), 'S', STEEL.ingot(), 'B', W.bolt(), 'I', MINGRADE.ingot() });
addRecipeAuto(new ItemStack(ModItems.mechanism_launcher_2, 1), new Object[] { "TTT", "SSS", "BBI", 'T', ALLOY.plate(), 'S', ANY_PLASTIC.ingot(), 'B', W.bolt(), 'I', DESH.ingot() });
addRecipeAuto(new ItemStack(ModItems.mechanism_special, 1), new Object[] { "PCI", "ISS", "PCI", 'P', ModItems.plate_desh, 'C', ModItems.coil_advanced_alloy, 'I', STAR.ingot(), 'S', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
addRecipeAuto(new ItemStack(ModBlocks.watz_pump, 1), new Object[] { "MPM", "PCP", "PSP", 'M', ModItems.motor_desh, 'P', ANY_RESISTANTALLOY.plateCast(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'S', ModItems.pipes_steel });
addRecipeAuto(new ItemStack(ModBlocks.reinforced_stone, 4), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.cobblestone, 'B', Blocks.stone });
@ -740,7 +732,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser });
addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.block_dineutronium, 'L', STEEL.shell() });
addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', ModItems.pipes_steel });
addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModItems.magnet_circular, 'L', ModItems.crystal_xen });
addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModBlocks.fusion_conductor, 'L', ModItems.crystal_xen });
addRecipeAuto(new ItemStack(ModBlocks.barrel_plastic, 1), new Object[] { "IPI", "I I", "IPI", 'I', ModItems.plate_polymer, 'P', AL.plate() });
addRecipeAuto(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { "IPI", "I I", "IPI", 'I', IRON.plate(), 'P', IRON.ingot() });
addShapelessAuto(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { ModBlocks.barrel_corroded, ANY_TAR.any() });

View File

@ -131,7 +131,7 @@ public class MainRegistry {
public static ToolMaterial enumToolMaterialBatNail = EnumHelper.addToolMaterial("BATNAIL", 0, 450, 1.0F, 4F, 25);
public static ToolMaterial enumToolMaterialGolfClub = EnumHelper.addToolMaterial("GOLFCLUB", 1, 1000, 2.0F, 5F, 25);
public static ToolMaterial enumToolMaterialPipeRusty = EnumHelper.addToolMaterial("PIPERUSTY", 1, 350, 1.5F, 4.5F, 25);
public static ToolMaterial enumToolMaterialPipeLead = EnumHelper.addToolMaterial("PIPELEAD", 1, 250, 1.5F, 5.5F, 25);
public static ToolMaterial enumToolMaterialPipeLead = EnumHelper.addToolMaterial("PIPELEAD", 1, 250, 1.5F, 3F, 25);
public static ToolMaterial enumToolMaterialBottleOpener = EnumHelper.addToolMaterial("OPENER", 1, 250, 1.5F, 0.5F, 200);
public static ToolMaterial enumToolMaterialSledge = EnumHelper.addToolMaterial("SHIMMERSLEDGE", 1, 0, 25.0F, 26F, 200);
@ -1665,6 +1665,14 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.bobmazon_weapons");
ignoreMappings.add("hbm:item.bobmazon_tools");
ignoreMappings.add("hbm:item.missile_carrier");
ignoreMappings.add("hbm:item.magnet_circular");
ignoreMappings.add("hbm:item.mechanism_revolver_1");
ignoreMappings.add("hbm:item.mechanism_revolver_2");
ignoreMappings.add("hbm:item.mechanism_rifle_1");
ignoreMappings.add("hbm:item.mechanism_rifle_2");
ignoreMappings.add("hbm:item.mechanism_launcher_1");
ignoreMappings.add("hbm:item.mechanism_launcher_2");
ignoreMappings.add("hbm:item.mechanism_special");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -370,12 +370,10 @@ public class ModEventHandler {
if(rand.nextInt(1024) == 0)
entity.setCurrentItemOrArmor(3, new ItemStack(ModItems.starmetal_plate, 1, world.rand.nextInt(ModItems.starmetal_plate.getMaxDamage())));
if(rand.nextInt(128) == 0)
if(rand.nextInt(64) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.pipe_lead, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.reer_graar, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.pipe_rusty, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)
entity.setCurrentItemOrArmor(0, new ItemStack(ModItems.crowbar, 1, world.rand.nextInt(100)));
if(rand.nextInt(128) == 0)

View File

@ -38,6 +38,8 @@ public class NEIRegistry {
handlers.add(new FusionRecipeHandler());
handlers.add(new SILEXRecipeHandler());
handlers.add(new FuelPoolHandler());
handlers.add(new RBMKRodDisassemblyHandler());
handlers.add(new RBMKWasteDecayHandler());
handlers.add(new CrucibleSmeltingHandler());
handlers.add(new CrucibleAlloyingHandler());
handlers.add(new CrucibleCastingHandler());

View File

@ -349,6 +349,9 @@ public class ResourceManager {
public static IModelCustomNamed silo_hatch_large = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/silo_hatch_large.obj")).asVBO();
//Skeleton
public static final IModelCustom skeleton_holder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/skeleton_holder.obj"),false).asVBO();
//Lights
public static final IModelCustom lantern = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/trinkets/lantern.obj"));
public static final IModelCustom cage_lamp = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/lights/cage_lamp.obj"));
@ -760,6 +763,9 @@ public class ResourceManager {
public static final ResourceLocation transition_seal_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/transition_seal.png");
public static final ResourceLocation fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/fire_door.png");
//Skeleton
public static final ResourceLocation skeleton_holder_tex = new ResourceLocation(RefStrings.MODID, "textures/particle/skeleton.png");
//Lantern
public static final ResourceLocation lantern_tex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/lantern.png");
public static final ResourceLocation lantern_rusty_tex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/lantern_rusty.png");
@ -897,6 +903,7 @@ public class ResourceManager {
public static final IModelCustom armor_tail = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/tail_peep.obj"));
public static final IModelCustom player_manly_af = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/armor/player_fem.obj"));
public static final IModelCustom armor_envsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/envsuit.obj"));
public static final IModelCustom armor_taurun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/taurun.obj"));
public static final IModelCustom armor_trenchmaster = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/trenchmaster.obj"));
////Texture Items
@ -958,6 +965,7 @@ public class ResourceManager {
public static final ResourceLocation flamethrower_daybreaker_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flamethrower_daybreaker.png");
public static final ResourceLocation mike_hawk_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lag.png");
public static final ResourceLocation uzi_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi.png");
public static final ResourceLocation uzi_saturnite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi_saturnite.png");
public static final ResourceLocation panzerschreck_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/panzerschreck.png");
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png");
public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");
@ -1047,6 +1055,10 @@ public class ResourceManager {
public static final ResourceLocation rpa_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_chest.png");
public static final ResourceLocation rpa_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_arm.png");
public static final ResourceLocation taurun_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_helmet.png");
public static final ResourceLocation taurun_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_leg.png");
public static final ResourceLocation taurun_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_chest.png");
public static final ResourceLocation taurun_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/taurun_arm.png");
public static final ResourceLocation trenchmaster_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/trenchmaster_helmet.png");
public static final ResourceLocation trenchmaster_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/trenchmaster_leg.png");
public static final ResourceLocation trenchmaster_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/trenchmaster_chest.png");

View File

@ -56,6 +56,9 @@ public class StructureManager {
public static final NBTStructure vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/vertibird.nbt"));
public static final NBTStructure crashed_vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed-vertibird.nbt"));
public static final NBTStructure aircraft_carrier = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/aircraft_carrier.nbt"));
public static final NBTStructure oil_rig = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/oil_rig.nbt"));
public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt"));
// public static final NBTStructure test_rot = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-rot.nbt"));
// public static final NBTStructure test_jigsaw = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-jigsaw.nbt"));

View File

@ -105,7 +105,7 @@ public class GunAnimationPacket implements IMessage {
if(animation != null) {
boolean isReloadAnimation = type == AnimType.RELOAD || type == AnimType.RELOAD_CYCLE || type == AnimType.RELOAD_EMPTY;
HbmAnimations.hotbar[slot][0] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, isReloadAnimation && base.mainConfig.reloadAnimationsSequential);
HbmAnimations.hotbar[slot][0] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, type, isReloadAnimation && base.mainConfig.reloadAnimationsSequential);
}
} catch(Exception x) { }
@ -143,7 +143,7 @@ public class GunAnimationPacket implements IMessage {
Minecraft.getMinecraft().entityRenderer.itemRenderer.resetEquippedProgress();
Minecraft.getMinecraft().entityRenderer.itemRenderer.itemToRender = stack;
boolean isReloadAnimation = type == AnimType.RELOAD || type == AnimType.RELOAD_CYCLE || type == AnimType.RELOAD_EMPTY;
HbmAnimations.hotbar[slot][gunIndex] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, isReloadAnimation && config.getReloadAnimSequential(stack));
HbmAnimations.hotbar[slot][gunIndex] = new Animation(stack.getItem().getUnlocalizedName(), System.currentTimeMillis(), animation, type, isReloadAnimation && config.getReloadAnimSequential(stack));
}
}
}

View File

@ -47,18 +47,22 @@ public class HbmAnimations {
public BusAnimation animation;
// If set, don't cancel this animation when the timer ends, instead wait for the next to start
public boolean holdLastFrame = false;
// so we know what type of animation we're playing, only used rarely
public AnimType type;
public Animation(String key, long startMillis, BusAnimation animation) {
public Animation(String key, long startMillis, BusAnimation animation, AnimType type) {
this.key = key;
this.startMillis = startMillis;
this.animation = animation;
this.type = type;
}
public Animation(String key, long startMillis, BusAnimation animation, boolean holdLastFrame) {
public Animation(String key, long startMillis, BusAnimation animation, AnimType type, boolean holdLastFrame) {
this.key = key;
this.startMillis = startMillis;
this.animation = animation;
this.holdLastFrame = holdLastFrame;
this.type = type;
}
}

View File

@ -4,8 +4,8 @@ import org.lwjgl.opengl.GL11;
import com.hbm.entity.mob.EntityGhost;
import com.hbm.lib.RefStrings;
import com.hbm.render.model.ModelSiegeZombie;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
@ -15,7 +15,7 @@ import net.minecraft.util.ResourceLocation;
public class RenderGhost extends RenderBiped {
public RenderGhost() {
super(new ModelSiegeZombie(0.0F), 0.5F, 1.0F);
super(new ModelBiped(0.0F), 0.5F, 1.0F);
}
@Override

View File

@ -1,40 +0,0 @@
package com.hbm.render.entity.mob;
import com.hbm.entity.mob.siege.EntitySiegeSkeleton;
import com.hbm.entity.mob.siege.SiegeTier;
import com.hbm.lib.RefStrings;
import net.minecraft.client.model.ModelSkeleton;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
public class RenderSiegeSkeleton extends RenderBiped {
public RenderSiegeSkeleton() {
super(new ModelSkeleton() {
@Override
public void setLivingAnimations(EntityLivingBase entity, float f0, float f1, float f2) {
this.aimedBow = true;
}
}, 0.5F);
}
@Override
protected ResourceLocation getEntityTexture(EntityLiving entity) {
return this.getEntityTexture((EntitySiegeSkeleton) entity);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return this.getEntityTexture((EntitySiegeSkeleton) entity);
}
protected ResourceLocation getEntityTexture(EntitySiegeSkeleton entity) {
SiegeTier tier = entity.getTier();
return new ResourceLocation(RefStrings.MODID + ":textures/entity/siege_" + tier.name + ".png");
}
}

View File

@ -1,55 +0,0 @@
package com.hbm.render.entity.mob;
import org.lwjgl.opengl.GL11;
import com.hbm.entity.mob.siege.EntitySiegeUFO;
import com.hbm.entity.mob.siege.SiegeTier;
import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderSiegeUFO extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
GL11.glPushMatrix();
GL11.glTranslated(x, y + 0.25, z);
EntitySiegeUFO ufo = (EntitySiegeUFO) entity;
this.bindTexture(getEntityTexture(entity));
double rot = (entity.ticksExisted + f1) * 5 % 360D;
GL11.glRotated(rot, 0, 1, 0);
if(!ufo.isEntityAlive()) {
float tilt = ufo.deathTime + f1;
GL11.glRotatef(tilt * 5, 1, 0, 1);
} else if(entity.hurtResistantTime > 0) {
GL11.glRotated(Math.sin(System.currentTimeMillis() * 0.01D) * (entity.hurtResistantTime - f1), 1, 0, 0);
}
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDisable(GL11.GL_CULL_FACE);
ResourceManager.mini_ufo.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return this.getEntityTexture((EntitySiegeUFO) entity);
}
protected ResourceLocation getEntityTexture(EntitySiegeUFO entity) {
SiegeTier tier = entity.getTier();
return new ResourceLocation(RefStrings.MODID + ":textures/entity/ufo_siege_" + tier.name + ".png");
}
}

View File

@ -1,39 +0,0 @@
package com.hbm.render.entity.mob;
import com.hbm.entity.mob.siege.EntitySiegeZombie;
import com.hbm.entity.mob.siege.SiegeTier;
import com.hbm.lib.RefStrings;
import com.hbm.render.model.ModelSiegeZombie;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
public class RenderSiegeZombie extends RenderBiped {
public RenderSiegeZombie() {
super(new ModelSiegeZombie(0.0F), 0.5F, 1.0F);
}
@Override
protected ResourceLocation getEntityTexture(EntityLiving entity) {
return this.getEntityTexture((EntitySiegeZombie) entity);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return this.getEntityTexture((EntitySiegeZombie) entity);
}
protected ResourceLocation getEntityTexture(EntitySiegeZombie entity) {
SiegeTier tier = entity.getTier();
return new ResourceLocation(RefStrings.MODID + ":textures/entity/siege_" + tier.name + ".png");
}
@Override
protected void func_82421_b() {
this.field_82423_g = new ModelSiegeZombie(1.0F); //armor slots 1, 2, 4
this.field_82425_h = new ModelSiegeZombie(0.5F); //armor slot 3
}
}

View File

@ -0,0 +1,39 @@
package com.hbm.render.entity.mob;
import com.hbm.entity.mob.EntityUndeadSoldier;
import com.hbm.render.model.ModelSkeletonNT;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
public class RenderUndeadSoldier extends RenderBiped {
public static ResourceLocation textureZombie = new ResourceLocation("textures/entity/zombie/zombie.png");
public static ResourceLocation textureSkeleton = new ResourceLocation("textures/entity/skeleton/skeleton.png");
public static ModelBiped modelZombie = new ModelZombie();
public static ModelBiped modelSkeleton = new ModelSkeletonNT();
public RenderUndeadSoldier() {
super(modelZombie, 0.5F);
}
@Override
protected void preRenderCallback(EntityLivingBase living, float interp) {
byte type = living.getDataWatcher().getWatchableObjectByte(EntityUndeadSoldier.DW_TYPE);
if(type == EntityUndeadSoldier.TYPE_ZOMBIE) this.mainModel = this.modelBipedMain = modelZombie;
if(type == EntityUndeadSoldier.TYPE_SKELETON) this.mainModel = this.modelBipedMain = modelSkeleton;
}
@Override
protected ResourceLocation getEntityTexture(EntityLiving living) {
byte type = living.getDataWatcher().getWatchableObjectByte(EntityUndeadSoldier.DW_TYPE);
if(type == EntityUndeadSoldier.TYPE_ZOMBIE) return textureZombie;
if(type == EntityUndeadSoldier.TYPE_SKELETON) return textureSkeleton;
return null;
}
}

View File

@ -187,7 +187,7 @@ public class ItemRenderMAS36 extends ItemRenderWeaponBase {
ResourceManager.mas36.renderPart("Stock");
ResourceManager.mas36.renderPart("Bolt");
if(isScoped(stack)) ResourceManager.mas36.renderPart("Scope");
GL11.glTranslated(0, -1, -6);
if(type != ItemRenderType.EQUIPPED) GL11.glTranslated(0, -1, -6);
if(hasBayonet(stack)) ResourceManager.mas36.renderPart("Bayonet");
GL11.glShadeModel(GL11.GL_FLAT);
}

View File

@ -35,7 +35,7 @@ public class ItemRenderUzi extends ItemRenderWeaponBase {
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
@ -143,7 +143,7 @@ public class ItemRenderUzi extends ItemRenderWeaponBase {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Gun");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -159,14 +159,14 @@ public class ItemRenderUzi extends ItemRenderWeaponBase {
boolean silenced = hasSilencer(stack, 0);
if(silenced) {
if(silenced && type == ItemRenderType.INVENTORY) {
double scale = 0.625D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -4);
}
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Gun");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -179,4 +179,8 @@ public class ItemRenderUzi extends ItemRenderWeaponBase {
public boolean hasSilencer(ItemStack stack, int cfg) {
return WeaponModManager.hasUpgrade(stack, cfg, WeaponModManager.ID_SILENCER);
}
public boolean isSaturnite(ItemStack stack) {
return WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_UZI_SATURN);
}
}

View File

@ -36,10 +36,10 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
float offset = 0.8F;
for(int i = -1; i <= 1; i += 2) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
int index = i == -1 ? 0 : 1;
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, index) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
GL11.glPushMatrix();
int index = i == -1 ? 0 : 1;
standardAimingTransform(stack, -2.25F * offset * i, -1.5F * offset, 2.5F * offset, 0, -4.375 / 8D, 1);
double scale = 0.25D;
@ -156,7 +156,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
public void renderEquipped(ItemStack stack) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, 1) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Gun");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -170,7 +170,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
public void renderEquippedAkimbo(ItemStack stack) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, 0) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("GunMirror");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -185,7 +185,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, index) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart(index == 0 ? "GunMirror" : "Gun");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -199,7 +199,6 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
boolean silencer0 = hasSilencer(stack, 1);
boolean silencer1 = hasSilencer(stack, 0);
@ -216,6 +215,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -4);
}
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, 1) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Gun");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -238,6 +238,7 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -4);
}
Minecraft.getMinecraft().renderEngine.bindTexture(isSaturnite(stack, 0) ? ResourceManager.uzi_saturnite_tex : ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("GunMirror");
ResourceManager.uzi.renderPart("StockBack");
ResourceManager.uzi.renderPart("StockFront");
@ -252,4 +253,8 @@ public class ItemRenderUziAkimbo extends ItemRenderWeaponBase {
public boolean hasSilencer(ItemStack stack, int cfg) {
return WeaponModManager.hasUpgrade(stack, cfg, WeaponModManager.ID_SILENCER);
}
public boolean isSaturnite(ItemStack stack, int cfg) {
return WeaponModManager.hasUpgrade(stack, cfg, WeaponModManager.ID_UZI_SATURN);
}
}

View File

@ -84,6 +84,16 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
GL11.glPushMatrix();
if(mc.gameSettings.thirdPersonView == 0 && !mc.renderViewEntity.isPlayerSleeping() && !mc.gameSettings.hideGUI && !mc.playerController.enableEverythingIsScrewedUpMode()) {
/*ItemRenderer ir = mc.entityRenderer.itemRenderer;
float equip = ir.prevEquippedProgress + (ir.equippedProgress- ir.prevEquippedProgress) * interp;
Animation current = HbmAnimations.getRelevantAnim();
// flicker prevention, if equip is in progress, only render if an animation is playing
if(!(equip < 0.25 && ir.prevEquippedProgress < ir.equippedProgress && (current == null || current.type != AnimType.EQUIP))) {
entityRenderer.enableLightmap(interp);
this.setupTransformsAndRender(stack);
entityRenderer.disableLightmap(interp);
}*/
entityRenderer.enableLightmap(interp);
this.setupTransformsAndRender(stack);
entityRenderer.disableLightmap(interp);

View File

@ -5,6 +5,7 @@ import com.hbm.render.loader.ModelRendererObj;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
@ -174,6 +175,13 @@ public class ModelArmorBase extends ModelBiped {
leftArm.copyRotationFrom(render.modelBipedMain.bipedLeftArm);
rightArm.copyRotationFrom(render.modelBipedMain.bipedRightArm);
}
} else {
Object o = RenderManager.instance.entityRenderMap.get(entity.getClass());
if(o instanceof RenderBiped) {
RenderBiped render = (RenderBiped) o;
leftArm.copyRotationFrom(render.modelBipedMain.bipedLeftArm);
rightArm.copyRotationFrom(render.modelBipedMain.bipedRightArm);
}
}
}

View File

@ -0,0 +1,60 @@
package com.hbm.render.model;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.render.loader.ModelRendererObj;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
public class ModelArmorTaurun extends ModelArmorBase {
public ModelArmorTaurun(int type) {
super(type);
head = new ModelRendererObj(ResourceManager.armor_taurun, "Helmet");
body = new ModelRendererObj(ResourceManager.armor_taurun, "Chest");
leftArm = new ModelRendererObj(ResourceManager.armor_taurun, "LeftArm").setRotationPoint(-5.0F, 2.0F, 0.0F);
rightArm = new ModelRendererObj(ResourceManager.armor_taurun, "RightArm").setRotationPoint(5.0F, 2.0F, 0.0F);
leftLeg = new ModelRendererObj(ResourceManager.armor_taurun, "LeftLeg").setRotationPoint(1.9F, 12.0F, 0.0F);
rightLeg = new ModelRendererObj(ResourceManager.armor_taurun, "RightLeg").setRotationPoint(-1.9F, 12.0F, 0.0F);
leftFoot = new ModelRendererObj(ResourceManager.armor_taurun, "LeftBoot").setRotationPoint(1.9F, 12.0F, 0.0F);
rightFoot = new ModelRendererObj(ResourceManager.armor_taurun, "RightBoot").setRotationPoint(-1.9F, 12.0F, 0.0F);
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
GL11.glPushMatrix();
if(type == 0) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.taurun_helmet);
head.render(par7);
}
if(type == 1) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.taurun_chest);
body.render(par7);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.taurun_arm);
leftArm.render(par7);
rightArm.render(par7);
}
if(type == 2) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.taurun_leg);
GL11.glTranslated(-0.01, 0, 0);
leftLeg.render(par7);
GL11.glTranslated(0.02, 0, 0);
rightLeg.render(par7);
}
if(type == 3) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.taurun_leg);
GL11.glTranslated(-0.01, 0, 0);
leftFoot.render(par7);
GL11.glTranslated(0.02, 0, 0);
rightFoot.render(par7);
}
GL11.glPopMatrix();
}
}

View File

@ -62,12 +62,16 @@ public class ModelArmorTrenchmaster extends ModelArmorBase {
}
if(type == 2) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.trenchmaster_leg);
GL11.glTranslated(-0.01, 0, 0);
leftLeg.render(par7);
GL11.glTranslated(0.02, 0, 0);
rightLeg.render(par7);
}
if(type == 3) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.trenchmaster_leg);
GL11.glTranslated(-0.01, 0, 0);
leftFoot.render(par7);
GL11.glTranslated(0.02, 0, 0);
rightFoot.render(par7);
}

View File

@ -1,35 +0,0 @@
package com.hbm.render.model;
import com.hbm.entity.mob.siege.EntitySiegeZombie;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class ModelSiegeZombie extends ModelBiped {
public ModelSiegeZombie(float p_i1168_1_) {
super(p_i1168_1_, 0.0F, 64, 32);
}
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) {
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
if(entity instanceof EntitySiegeZombie && ((EntitySiegeZombie)entity).getDataWatcher().getWatchableObjectByte(13) != 0) {
float f6 = MathHelper.sin(this.onGround * (float) Math.PI);
float f7 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI);
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F);
this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F;
this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F);
this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F);
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;
}
}
}

View File

@ -0,0 +1,29 @@
package com.hbm.render.model;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelZombie;
public class ModelSkeletonNT extends ModelZombie {
public ModelSkeletonNT() {
this(0.0F);
}
public ModelSkeletonNT(float scale) {
super(scale, 0.0F, 64, 32);
this.bipedRightArm = new ModelRenderer(this, 40, 16);
this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, scale);
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F);
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
this.bipedLeftArm.mirror = true;
this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, scale);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, scale);
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.mirror = true;
this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, scale);
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
}
}

View File

@ -38,10 +38,6 @@ public class RenderPedestalTile extends TileEntitySpecialRenderer {
GL11.glTranslated(0, 0.125, 0);
GL11.glRotatef(player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * interp + 180, 0.0F, -1.0F, 0.0F);
if(!RenderManager.instance.options.fancyGraphics) {
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
}
GL11.glTranslated(0, Math.sin((player.ticksExisted + interp) * 0.1) * 0.0625, 0);
} else {
GL11.glTranslated(0, Math.sin((player.ticksExisted + interp) * 0.1) * 0.0625 + 0.0625, 0);

View File

@ -0,0 +1,72 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.generic.BlockSkeletonHolder.TileEntitySkeletonHolder;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.main.ResourceManager;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class RenderSkeletonHolder extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);
switch(te.getBlockMetadata()) {
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
RenderHelper.enableStandardItemLighting();
bindTexture(ResourceManager.skeleton_holder_tex);
ResourceManager.skeleton_holder.renderPart("Holder1");
TileEntitySkeletonHolder pedestal = (TileEntitySkeletonHolder) te;
if(pedestal.item != null) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack stack = pedestal.item.copy();
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
if(stack.getItem() instanceof ItemGunBaseNT) {
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
}
if(!(stack.getItemSpriteNumber() == 0 && stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType()))) {
GL11.glScaled(1.5, 1.5, 1.5);
}
GL11.glTranslated(0, 0.125, 0);
EntityItem dummy = new EntityItem(te.getWorldObj(), 0, 0, 0, stack);
dummy.hoverStart = 0.0F;
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(dummy, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderItem.renderInFrame = false;
}
GL11.glPopMatrix();
}
}

View File

@ -14,6 +14,7 @@ import com.hbm.blocks.generic.BlockGlyphidSpawner.TileEntityGlpyhidSpawner;
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
import com.hbm.blocks.generic.BlockPedestal.TileEntityPedestal;
import com.hbm.blocks.generic.BlockPlushie.TileEntityPlushie;
import com.hbm.blocks.generic.BlockSkeletonHolder.TileEntitySkeletonHolder;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.blocks.generic.BlockSupplyCrate.TileEntitySupplyCrate;
import com.hbm.blocks.generic.BlockWandJigsaw.TileEntityWandJigsaw;
@ -212,6 +213,7 @@ public class TileMappings {
put(TileEntityLoot.class, "tileentity_ntm_loot");
put(TileEntityPedestal.class, "tileentity_ntm_pedestal");
put(TileEntitySkeletonHolder.class, "tileentity_ntm_skeleton");
put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
put(TileEntitySnowglobe.class, "tileentity_ntm_snowglobe");
put(TileEntityPlushie.class, "tileentity_ntm_plushie");

View File

@ -1,7 +1,11 @@
package com.hbm.tileentity.machine.storage;
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
import api.hbm.fluidmk2.FluidNode;
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
import java.util.HashSet;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.CompatHandler;
import com.hbm.inventory.FluidContainerRegistry;
@ -19,6 +23,8 @@ import com.hbm.tileentity.IFluidCopiable;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.IPersistentNBT;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.uninos.UniNodespace;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.util.fauxpointtwelve.DirPos;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
@ -36,10 +42,14 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
public class TileEntityBarrel extends TileEntityMachineBase implements SimpleComponent, IFluidStandardTransceiverMK2, IPersistentNBT, IGUIProvider, CompatHandler.OCComponent, IFluidCopiable {
protected FluidNode node;
protected FluidType lastType;
public FluidTank tank;
public short mode = 0;
public static final short modes = 4;
@ -90,9 +100,45 @@ public class TileEntityBarrel extends TileEntityMachineBase implements SimpleCom
tank.loadTank(2, 3, slots);
tank.unloadTank(4, 5, slots);
// In buffer mode, acts like a pipe block, providing fluid to its own node
// otherwise, it is a regular providing/receiving machine, blocking further propagation
if(mode == 1) {
if(this.node == null || this.node.expired || tank.getTankType() != lastType) {
this.node = (FluidNode) UniNodespace.getNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
if(this.node == null || this.node.expired || tank.getTankType() != lastType) {
this.node = this.createNode(tank.getTankType());
UniNodespace.createNode(worldObj, this.node);
lastType = tank.getTankType();
}
}
if(node != null && node.hasValidNet()) {
node.net.addProvider(this);
node.net.addReceiver(this);
}
} else {
if(this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
this.node = null;
}
for(DirPos pos : getConPos()) {
if(mode == 0 || mode == 2) this.trySubscribe(tank.getTankType(), worldObj, pos);
if(mode == 1 || mode == 2) this.tryProvide(tank, worldObj, pos);
FluidNode dirNode = (FluidNode) UniNodespace.getNode(worldObj, pos.getX(), pos.getY(), pos.getZ(), tank.getTankType().getNetworkProvider());
if(mode == 2) {
tryProvide(tank, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
} else {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.removeProvider(this);
}
if(mode == 0) {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.addReceiver(this);
} else {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.removeReceiver(this);
}
}
}
if(tank.getFill() > 0) {
@ -103,6 +149,30 @@ public class TileEntityBarrel extends TileEntityMachineBase implements SimpleCom
}
}
protected FluidNode createNode(FluidType type) {
DirPos[] conPos = getConPos();
HashSet<BlockPos> posSet = new HashSet<>();
posSet.add(new BlockPos(this));
for(DirPos pos : conPos) {
ForgeDirection dir = pos.getDir();
posSet.add(new BlockPos(pos.getX() - dir.offsetX, pos.getY() - dir.offsetY, pos.getZ() - dir.offsetZ));
}
return new FluidNode(type.getNetworkProvider(), posSet.toArray(new BlockPos[posSet.size()])).setConnections(conPos);
}
@Override
public void invalidate() {
super.invalidate();
if(!worldObj.isRemote) {
if(this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
}
}
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
@ -219,6 +289,8 @@ public class TileEntityBarrel extends TileEntityMachineBase implements SimpleCom
tank.writeToNBT(nbt, "tank");
}
@Override public boolean canConnect(FluidType fluid, ForgeDirection dir) { return true; }
@Override
public FluidTank[] getSendingTanks() {
return (mode == 1 || mode == 2) ? new FluidTank[] {tank} : new FluidTank[0];
@ -234,6 +306,11 @@ public class TileEntityBarrel extends TileEntityMachineBase implements SimpleCom
return new FluidTank[] { tank };
}
@Override
public ConnectionPriority getFluidPriority() {
return mode == 1 ? ConnectionPriority.LOW : ConnectionPriority.NORMAL;
}
@Override
public int[] getFluidIDToCopy() {
return new int[] {tank.getTankType().getID()};

View File

@ -191,7 +191,7 @@ public abstract class TileEntityCrateBase extends TileEntityLockableBase impleme
/// For when opening from a player's inventory.
public static void spawnSpiders(EntityPlayer player, World worldObj, ItemStack crate) {
if(crate.getTagCompound().getBoolean("spiders")) {
if(crate.hasTagCompound() && crate.getTagCompound().getBoolean("spiders")) {
Random random = new Random();
for (int i = 0; i < numSpiders; i++) {

View File

@ -16,6 +16,7 @@ import com.hbm.lib.Library;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.IPersistentNBT;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.uninos.UniNodespace;
import com.hbm.util.CompatEnergyControl;
import cpw.mods.fml.common.Optional;
@ -170,24 +171,46 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
int mode = this.getRelevantMode(false);
if(this.node == null || this.node.expired) {
this.node = Nodespace.getNode(worldObj, xCoord, yCoord, zCoord);
if(this.node == null || this.node.expired) {
this.node = this.createNode();
Nodespace.createNode(worldObj, this.node);
}
}
long prevPower = this.power;
power = Library.chargeItemsFromTE(slots, 1, power, getMaxPower());
if(mode == mode_output || mode == mode_buffer) {
// In buffer mode, becomes a cable block and provides power to itself
// otherwise, acts like a regular power providing/accepting machine
if(mode == mode_buffer) {
if(this.node == null || this.node.expired) {
this.node = (PowerNode) UniNodespace.getNode(worldObj, xCoord, yCoord, zCoord, Nodespace.THE_POWER_PROVIDER);
if(this.node == null || this.node.expired) {
this.node = this.createNode();
UniNodespace.createNode(worldObj, this.node);
}
}
this.tryProvide(worldObj, xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN);
if(node != null && node.hasValidNet()) node.net.addReceiver(this);
} else {
if(node != null && node.hasValidNet()) node.net.removeProvider(this);
if(this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, Nodespace.THE_POWER_PROVIDER);
this.node = null;
}
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
PowerNode dirNode = (PowerNode) UniNodespace.getNode(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, Nodespace.THE_POWER_PROVIDER);
if(mode == mode_output) {
tryProvide(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
} else {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.removeProvider(this);
}
if(mode == mode_input) {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.addReceiver(this);
} else {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.removeReceiver(this);
}
}
}
byte comp = this.getComparatorPower();
@ -195,12 +218,6 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
this.markDirty();
this.lastRedstone = comp;
if(mode == mode_input || mode == mode_buffer) {
if(node != null && node.hasValidNet()) node.net.addReceiver(this);
} else {
if(node != null && node.hasValidNet()) node.net.removeReceiver(this);
}
power = Library.chargeTEFromItems(slots, 0, power, getMaxPower());
long avg = (power + prevPower) / 2;
@ -228,7 +245,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
if(!worldObj.isRemote) {
if(this.node != null) {
Nodespace.destroyNode(worldObj, xCoord, yCoord, zCoord);
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, Nodespace.THE_POWER_PROVIDER);
}
}
}

View File

@ -1,6 +1,9 @@
package com.hbm.tileentity.machine.storage;
import api.hbm.fluid.IFluidStandardTransceiver;
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
import api.hbm.fluidmk2.FluidNode;
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.explosion.vanillant.ExplosionVNT;
@ -21,8 +24,10 @@ import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.lib.Library;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.*;
import com.hbm.uninos.UniNodespace;
import com.hbm.packet.toclient.AuxParticlePacketNT;
import com.hbm.util.ParticleUtil;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.util.fauxpointtwelve.DirPos;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
@ -44,17 +49,20 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
public class TileEntityMachineFluidTank extends TileEntityMachineBase implements SimpleComponent, OCComponent, IFluidStandardTransceiver, IPersistentNBT, IOverpressurable, IGUIProvider, IRepairable, IFluidCopiable{
public class TileEntityMachineFluidTank extends TileEntityMachineBase implements SimpleComponent, OCComponent, IFluidStandardTransceiverMK2, IPersistentNBT, IOverpressurable, IGUIProvider, IRepairable, IFluidCopiable {
protected FluidNode node;
protected FluidType lastType;
public FluidTank tank;
public short mode = 0;
public static final short modes = 4;
public boolean hasExploded = false;
protected boolean sendingBrake = false;
public boolean onFire = false;
public byte lastRedstone = 0;
public Explosion lastExplosion = null;
@ -106,15 +114,52 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
this.markChanged();
}
// In buffer mode, acts like a pipe block, providing fluid to its own node
// otherwise, it is a regular providing/receiving machine, blocking further propagation
if(mode == 1) {
if(this.node == null || this.node.expired || tank.getTankType() != lastType) {
this.node = (FluidNode) UniNodespace.getNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
if(this.node == null || this.node.expired || tank.getTankType() != lastType) {
this.node = this.createNode(tank.getTankType());
UniNodespace.createNode(worldObj, this.node);
lastType = tank.getTankType();
}
}
if(node != null && node.hasValidNet()) {
node.net.addProvider(this);
node.net.addReceiver(this);
}
} else {
if(this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
this.node = null;
}
for(DirPos pos : getConPos()) {
if(mode == 0 || mode == 2) this.trySubscribe(tank.getTankType(), worldObj, pos);
if(mode == 1 || mode == 2) this.tryProvide(tank, worldObj, pos);
FluidNode dirNode = (FluidNode) UniNodespace.getNode(worldObj, pos.getX(), pos.getY(), pos.getZ(), tank.getTankType().getNetworkProvider());
if(mode == 2) {
tryProvide(tank, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
} else {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.removeProvider(this);
}
if(mode == 0) {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.addReceiver(this);
} else {
if(dirNode != null && dirNode.hasValidNet()) dirNode.net.removeReceiver(this);
}
}
}
tank.loadTank(2, 3, slots);
tank.setType(0, 1, slots);
} else {
for(DirPos pos : getConPos()) this.tryUnsubscribe(tank.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ());
} else if(this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
this.node = null;
}
byte comp = this.getComparatorPower(); //comparator shit
@ -165,6 +210,30 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
}
}
protected FluidNode createNode(FluidType type) {
DirPos[] conPos = getConPos();
HashSet<BlockPos> posSet = new HashSet<>();
posSet.add(new BlockPos(this));
for(DirPos pos : conPos) {
ForgeDirection dir = pos.getDir();
posSet.add(new BlockPos(pos.getX() - dir.offsetX, pos.getY() - dir.offsetY, pos.getZ() - dir.offsetZ));
}
return new FluidNode(type.getNetworkProvider(), posSet.toArray(new BlockPos[posSet.size()])).setConnections(conPos);
}
@Override
public void invalidate() {
super.invalidate();
if(!worldObj.isRemote) {
if(this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, tank.getTankType().getNetworkProvider());
}
}
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
@ -331,12 +400,8 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
@Override
public long getDemand(FluidType type, int pressure) {
if(this.mode == 2 || this.mode == 3 || this.sendingBrake)
return 0;
if(this.mode == 2 || this.mode == 3) return 0;
if(tank.getPressure() != pressure) return 0;
return type == tank.getTankType() ? tank.getMaxFill() - tank.getFill() : 0;
}
@ -365,6 +430,8 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
this.onFire = data.getBoolean("onFire");
}
@Override public boolean canConnect(FluidType fluid, ForgeDirection dir) { return true; }
@Override
public FluidTank[] getSendingTanks() {
if(this.hasExploded) return new FluidTank[0];
@ -373,10 +440,15 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
@Override
public FluidTank[] getReceivingTanks() {
if(this.hasExploded || this.sendingBrake) return new FluidTank[0];
if(this.hasExploded) return new FluidTank[0];
return (mode == 0 || mode == 1) ? new FluidTank[] {tank} : new FluidTank[0];
}
@Override
public ConnectionPriority getFluidPriority() {
return mode == 1 ? ConnectionPriority.LOW : ConnectionPriority.NORMAL;
}
@Override
public int[] getFluidIDToCopy() {
return new int[] {tank.getTankType().getID()};

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.network;
import api.hbm.energymk2.Nodespace;
import com.hbm.uninos.UniNodespace;
import net.minecraft.block.Block;
import net.minecraft.world.World;
@ -16,7 +17,7 @@ public class TileEntityFluidValve extends TileEntityPipeBaseNT {
this.blockMetadata = -1; // delete cache
if(this.getBlockMetadata() == 0 && this.node != null) {
Nodespace.destroyNode(worldObj, xCoord, yCoord, zCoord);
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, this.getType().getNetworkProvider());
this.node = null;
}
}

View File

@ -26,6 +26,16 @@ public class BobMathUtil {
for(int num : nums) if(num > largest) largest = num;
return largest;
}
public static long min(long... nums) {
long smallest = Long.MAX_VALUE;
for(long num : nums) if(num < smallest) smallest = num;
return smallest;
}
public static long max(long... nums) {
long largest = Long.MIN_VALUE;
for(long num : nums) if(num > largest) largest = num;
return largest;
}
public static float min(float... nums) {
float smallest = Float.MAX_VALUE;
for(float num : nums) if(num < smallest) smallest = num;

View File

@ -111,12 +111,12 @@ public class DamageResistanceHandler {
.addExact(DamageSource.fall.damageType, 0F, 1F)
.setOther(0F, 0.15F));
registerSet(ModItems.rpa_helmet, ModItems.rpa_plate, ModItems.rpa_legs, ModItems.rpa_boots, new ResistanceStats()
.addCategory(CATEGORY_PROJECTILE, 20F, 0.65F)
.addCategory(CATEGORY_FIRE, 10F, 0.75F)
.addCategory(CATEGORY_PROJECTILE, 25F, 0.65F)
.addCategory(CATEGORY_FIRE, 10F, 0.9F)
.addCategory(CATEGORY_EXPLOSION, 15F, 0.25F)
.addExact(DamageClass.LASER.name(), 10F, 0.75F)
.addExact(DamageClass.LASER.name(), 25F, 0.75F)
.addExact(DamageSource.fall.damageType, 0F, 1F)
.setOther(10F, 0.15F));
.setOther(15F, 0.3F));
ResistanceStats bj = new ResistanceStats()
.addCategory(CATEGORY_PROJECTILE, 5F, 0.5F)
.addCategory(CATEGORY_FIRE, 2.5F, 0.5F)
@ -151,6 +151,12 @@ public class DamageResistanceHandler {
registerSet(ModItems.dns_helmet, ModItems.dns_plate, ModItems.dns_legs, ModItems.dns_boots, new ResistanceStats()
.addCategory(CATEGORY_EXPLOSION, 100F, 0.99F)
.setOther(100F, 1F));
registerSet(ModItems.taurun_helmet, ModItems.taurun_plate, ModItems.taurun_legs, ModItems.taurun_boots, new ResistanceStats()
.addCategory(CATEGORY_PROJECTILE, 2F, 0.15F)
.addCategory(CATEGORY_FIRE, 1F, 0.25F)
.addCategory(CATEGORY_EXPLOSION, 0F, 0.25F)
.addExact(DamageSource.fall.damageType, 4F, 0.5F)
.setOther(2F, 0.1F));
registerSet(ModItems.trenchmaster_helmet, ModItems.trenchmaster_plate, ModItems.trenchmaster_legs, ModItems.trenchmaster_boots, new ResistanceStats()
.addCategory(CATEGORY_PROJECTILE, 5F, 0.5F)
.addCategory(CATEGORY_FIRE, 5F, 0.5F)

View File

@ -14,19 +14,19 @@ public class DepthDeposit {
public static void generateConditionOverworld(World world, int x, int yMin, int yDev, int z, int size, double fill, Block block, Random rand, int chance) {
if(rand.nextInt(chance) == 0)
generate(world, x + rand.nextInt(16), yMin + rand.nextInt(yDev), z + rand.nextInt(16), size, fill, block, rand, Blocks.stone, ModBlocks.stone_depth);
generate(world, x + rand.nextInt(16) + 8, yMin + rand.nextInt(yDev), z + rand.nextInt(16) + 8, size, fill, block, rand, Blocks.stone, ModBlocks.stone_depth);
}
public static void generateConditionNether(World world, int x, int yMin, int yDev, int z, int size, double fill, Block block, Random rand, int chance) {
if(rand.nextInt(chance) == 0)
generate(world, x + rand.nextInt(16), yMin + rand.nextInt(yDev), z + rand.nextInt(16), size, fill, block, rand, Blocks.netherrack, ModBlocks.stone_depth_nether);
generate(world, x + rand.nextInt(16) + 8, yMin + rand.nextInt(yDev), z + rand.nextInt(16) + 8, size, fill, block, rand, Blocks.netherrack, ModBlocks.stone_depth_nether);
}
public static void generateCondition(World world, int x, int yMin, int yDev, int z, int size, double fill, Block block, Random rand, int chance, Block genTarget, Block filler) {
if(rand.nextInt(chance) == 0)
generate(world, x + rand.nextInt(16), yMin + rand.nextInt(yDev), z + rand.nextInt(16), size, fill, block, rand, genTarget, filler);
generate(world, x + rand.nextInt(16) + 8, yMin + rand.nextInt(yDev), z + rand.nextInt(16) + 8, size, fill, block, rand, genTarget, filler);
}
public static void generate(World world, int x, int y, int z, int size, double fill, Block block, Random rand, Block genTarget, Block filler) {

View File

@ -16,6 +16,7 @@ import com.hbm.handler.ThreeInts;
import com.hbm.main.MainRegistry;
import com.hbm.util.Tuple.Pair;
import com.hbm.util.Tuple.Quartet;
import com.hbm.util.fauxpointtwelve.BlockPos;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.*;
@ -94,7 +95,7 @@ public class NBTStructure {
}
}
public static void registerStructure(SpawnCondition spawn, int... dimensionIds) {
public static void registerStructure(SpawnCondition spawn, int[] dimensionIds) {
for(int dimensionId : dimensionIds) {
registerStructure(dimensionId, spawn);
}
@ -265,6 +266,10 @@ public class NBTStructure {
}
palette[i] = new BlockDefinition(blockName, meta);
if(StructureConfig.debugStructures && palette[i].block == Blocks.air) {
palette[i] = new BlockDefinition(ModBlocks.wand_air, meta);
}
}
@ -349,7 +354,7 @@ public class NBTStructure {
if(connections.size() > 0) {
fromConnections = new ArrayList<>();
connections.sort((a, b) -> a.selectionPriority - b.selectionPriority); // sort by descending priority, highest first
connections.sort((a, b) -> b.selectionPriority - a.selectionPriority); // sort by descending priority, highest first
// Sort out our from connections, splitting into individual lists for each priority level
List<JigsawConnection> innerList = null;
@ -439,7 +444,7 @@ public class NBTStructure {
int ry = by + y;
Block block = transformBlock(state.definition, null, world.rand);
int meta = coordBaseMode != 0 ? transformMeta(state.definition, coordBaseMode) : state.definition.meta;
int meta = transformMeta(state.definition, null, coordBaseMode);
world.setBlock(rx, ry, rz, block, meta, 2);
@ -496,7 +501,7 @@ public class NBTStructure {
int ry = by + oy;
Block block = transformBlock(state.definition, piece.blockTable, world.rand);
int meta = coordBaseMode != 0 ? transformMeta(state.definition, coordBaseMode) : state.definition.meta;
int meta = transformMeta(state.definition, piece.blockTable, coordBaseMode);
world.setBlock(rx, ry, rz, block, meta, 2);
@ -552,10 +557,16 @@ public class NBTStructure {
return definition.block;
}
private int transformMeta(BlockDefinition definition, int coordBaseMode) {
private int transformMeta(BlockDefinition definition, Map<Block, BlockSelector> blockTable, int coordBaseMode) {
if(blockTable != null && blockTable.containsKey(definition.block)) {
return blockTable.get(definition.block).getSelectedBlockMetaData();
}
// Our shit
if(definition.block instanceof INBTTransformable) return ((INBTTransformable) definition.block).transformMeta(definition.meta, coordBaseMode);
if(coordBaseMode == 0) return definition.meta;
// Vanilla shit
if(definition.block instanceof BlockStairs) return INBTTransformable.transformMetaStairs(definition.meta, coordBaseMode);
if(definition.block instanceof BlockRotatedPillar) return INBTTransformable.transformMetaPillar(definition.meta, coordBaseMode);
@ -566,6 +577,7 @@ public class NBTStructure {
if(definition.block instanceof BlockLever) return INBTTransformable.transformMetaLever(definition.meta, coordBaseMode);
if(definition.block instanceof BlockSign) return INBTTransformable.transformMetaDeco(definition.meta, coordBaseMode);
if(definition.block instanceof BlockLadder) return INBTTransformable.transformMetaDeco(definition.meta, coordBaseMode);
if(definition.block instanceof BlockTripWireHook) return INBTTransformable.transformMetaDirectional(definition.meta, coordBaseMode);
return definition.meta;
}
@ -630,6 +642,11 @@ public class NBTStructure {
this.meta = meta;
}
BlockDefinition(Block block, int meta) {
this.block = block;
this.meta = meta;
}
}
public static class SpawnCondition {
@ -670,6 +687,31 @@ public class NBTStructure {
return pools.get(name).clone();
}
// Builds all of the pools into neat rows and columns, for editing and debugging!
// Make sure structure debug is enabled, or it will no-op
// Do not use in generation
public void buildAll(World world, int x, int y, int z) {
if(!StructureConfig.debugStructures) return;
int padding = 5;
int oz = 0;
for(JigsawPool pool : pools.values()) {
int highestWidth = 0;
int ox = 0;
for(Pair<JigsawPiece, Integer> entry : pool.pieces) {
NBTStructure structure = entry.key.structure;
structure.build(world, x + ox + (structure.size.x / 2), y, z + oz + (structure.size.z / 2));
ox += structure.size.x + padding;
highestWidth = Math.max(highestWidth, structure.size.z);
}
oz += highestWidth + padding;
}
}
}
// A set of pieces with weights
@ -790,7 +832,7 @@ public class NBTStructure {
boolean heightUpdated = false;
int priority; // placement priority not yet implemented because selection priority is far more useful whatever
int priority;
// this is fucking hacky but we need a way to update ALL component bounds once a Y-level is determined
private Start parent;
@ -941,6 +983,17 @@ public class NBTStructure {
return false;
}
protected boolean isInsideIgnoringSelf(LinkedList<StructureComponent> components, int x, int y, int z) {
for(StructureComponent component : components) {
if(component == this) continue;
if(component.getBoundingBox() == null) continue;
if(component.getBoundingBox().isVecInside(x, y, z)) return true;
}
return false;
}
}
public static class Start extends StructureStart {
@ -966,7 +1019,15 @@ public class NBTStructure {
// Iterate through and build out all the components we intend to spawn
while(!queuedComponents.isEmpty()) {
final int i = rand.nextInt(queuedComponents.size());
queuedComponents.sort((a, b) -> b.priority - a.priority); // sort by placement priority descending
int matchPriority = queuedComponents.get(0).priority;
int max = 1;
while(max < queuedComponents.size()) {
if(queuedComponents.get(max).priority != matchPriority) break;
max++;
}
final int i = rand.nextInt(max);
Component fromComponent = queuedComponents.remove(i);
if(fromComponent.piece.structure.fromConnections == null) continue;
@ -1008,7 +1069,11 @@ public class NBTStructure {
queuedComponents.add(nextComponent);
} else {
// If we failed to fit anything in, grab something from the fallback pool, ignoring bounds check
// unless we are perfectly abutting another piece, so grid layouts can work!
if(nextPool.fallback != null) {
BlockPos checkPos = getConnectionTargetPosition(fromComponent, fromConnection);
if(!fromComponent.isInsideIgnoringSelf(components, checkPos.getX(), checkPos.getY(), checkPos.getZ())) {
nextComponent = buildNextComponent(rand, spawn, spawn.pools.get(nextPool.fallback), fromComponent, fromConnection);
addComponent(nextComponent, fromConnection.placementPriority); // don't add to queued list, we don't want to try continue from fallback
}
@ -1016,6 +1081,7 @@ public class NBTStructure {
}
}
}
}
if(GeneralConfig.enableDebugMode) {
MainRegistry.logger.info("[Debug] Spawning NBT structure with " + components.size() + " piece(s) at: " + chunkX * 16 + ", " + chunkZ * 16);
@ -1031,12 +1097,25 @@ public class NBTStructure {
@SuppressWarnings("unchecked")
private void addComponent(Component component, int placementPriority) {
if(component == null) return;
components.add(component);
component.parent = this;
component.priority = placementPriority;
}
private BlockPos getConnectionTargetPosition(Component component, JigsawConnection connection) {
// The direction this component is extending towards in ABSOLUTE direction
ForgeDirection extendDir = component.rotateDir(connection.dir);
// Set the starting point for the next structure to the location of the connector block
int x = component.getXWithOffset(connection.pos.x, connection.pos.z) + extendDir.offsetX;
int y = component.getYWithOffset(connection.pos.y) + extendDir.offsetY;
int z = component.getZWithOffset(connection.pos.x, connection.pos.z) + extendDir.offsetZ;
return new BlockPos(x, y, z);
}
private Component buildNextComponent(Random rand, SpawnCondition spawn, JigsawPool pool, Component fromComponent, JigsawConnection fromConnection) {
JigsawPiece nextPiece = pool.get(rand);
if(nextPiece == null) return null;
@ -1046,23 +1125,17 @@ public class NBTStructure {
JigsawConnection toConnection = connectionPool.get(rand.nextInt(connectionPool.size()));
// The direction this component is extending towards in ABSOLUTE direction
ForgeDirection extendDir = fromComponent.rotateDir(fromConnection.dir);
// Rotate our incoming piece to plug it in
int nextCoordBase = fromComponent.getNextCoordBase(fromConnection, toConnection, rand);
// Set the starting point for the next structure to the location of the connector block
int nextX = fromComponent.getXWithOffset(fromConnection.pos.x, fromConnection.pos.z) + extendDir.offsetX;
int nextY = fromComponent.getYWithOffset(fromConnection.pos.y) + extendDir.offsetY;
int nextZ = fromComponent.getZWithOffset(fromConnection.pos.x, fromConnection.pos.z) + extendDir.offsetZ;
BlockPos pos = getConnectionTargetPosition(fromComponent, fromConnection);
// offset the starting point to the connecting point
nextX -= nextPiece.structure.rotateX(toConnection.pos.x, toConnection.pos.z, nextCoordBase);
nextY -= toConnection.pos.y;
nextZ -= nextPiece.structure.rotateZ(toConnection.pos.x, toConnection.pos.z, nextCoordBase);
int ox = nextPiece.structure.rotateX(toConnection.pos.x, toConnection.pos.z, nextCoordBase);
int oy = toConnection.pos.y;
int oz = nextPiece.structure.rotateZ(toConnection.pos.x, toConnection.pos.z, nextCoordBase);
return new Component(spawn, nextPiece, rand, nextX, nextY, nextZ, nextCoordBase).connectedFrom(toConnection);
return new Component(spawn, nextPiece, rand, pos.getX() - ox, pos.getY() - oy, pos.getZ() - oz, nextCoordBase).connectedFrom(toConnection);
}
private List<JigsawConnection> getConnectionPool(JigsawPiece nextPiece, JigsawConnection fromConnection) {

View File

@ -36,6 +36,9 @@ public class NTMWorldGenerator implements IWorldGenerator {
public NTMWorldGenerator() {
final List<BiomeGenBase> invalidBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean});
final List<BiomeGenBase> oceanBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean });
final List<BiomeGenBase> beachBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
NBTStructure.registerStructure(0, new SpawnCondition() {{
canSpawn = biome -> !invalidBiomes.contains(biome);
@ -61,6 +64,31 @@ public class NTMWorldGenerator implements IWorldGenerator {
spawnWeight = 3 * 4;
}});
NBTStructure.registerStructure(0, new SpawnCondition() {{
canSpawn = oceanBiomes::contains;
structure = new JigsawPiece("aircraft_carrier", StructureManager.aircraft_carrier, -6);
maxHeight = 42;
spawnWeight = 1;
}});
NBTStructure.registerStructure(0, new SpawnCondition() {{
canSpawn = biome -> biome == BiomeGenBase.deepOcean;
structure = new JigsawPiece("oil_rig", StructureManager.oil_rig, -20);
maxHeight = 12;
minHeight = 11;
spawnWeight = 2;
}});
NBTStructure.registerStructure(0, new SpawnCondition() {{
canSpawn = beachBiomes::contains;
structure = new JigsawPiece("beached_patrol", StructureManager.beached_patrol, -5);
minHeight = 58;
maxHeight = 67;
spawnWeight = 8;
}});
NBTStructure.registerNullWeight(0, 2);
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
put(ModBlocks.meteor_brick, new MeteorBricks());
}};

View File

@ -40,6 +40,8 @@ public net.minecraft.nbt.NBTTagList * # Mo
# ItemRenderer
public net.minecraft.client.renderer.ItemRenderer field_78453_b # itemToRender
public net.minecraft.client.renderer.ItemRenderer field_78454_c # equippedProgress
public net.minecraft.client.renderer.ItemRenderer field_78451_d # prevEquippedProgress
# AbstractResourcePack
public net.minecraft.client.resources.AbstractResourcePack field_110597_b # resourcePackFile

View File

@ -2447,6 +2447,7 @@ item.insert_polonium.name=Poloniumeinlage
item.insert_steel.name=Schwere Stahleinlage
item.insert_xsapi.name=XSAPI-Einlage
item.insert_yharonite.name=Yharoniteinlage
item.item_secret.aberrator.name=Aberrator-Teil
item.item_secret.canister.name=Komposit SB-26
item.item_secret.controller.name=Proprietäre Steuereinheit
item.item_secret.selenium_steel.name=Selen-Stahl
@ -3697,6 +3698,14 @@ item.wd40.name=VT-40
item.weapon_bat.name=Richards Standard
item.weapon_bat_nail.name=Das Klischee
item.weapon_golf_club.name=Schläger des russischen Mafiosos
item.weapon_mod_caliber.bmg50.name=.50 BMG Konversionskit
item.weapon_mod_caliber.m357.name=.357 Magnum Konversionskit
item.weapon_mod_caliber.m44.name=.44 Magnum Konversionskit
item.weapon_mod_caliber.p22.name=.22 lfB Konversionskit
item.weapon_mod_caliber.p45.name=.45 Konversionskit
item.weapon_mod_caliber.p9.name=9mm Konversionskit
item.weapon_mod_caliber.r556.name=5.56mm Konversionskit
item.weapon_mod_caliber.r762.name=7.62mm Konversionskit
item.weapon_mod_generic.bigmt_damage.name=Optimierter Saturnit-Verschluss
item.weapon_mod_generic.bigmt_dura.name=Langlebige Saturnit-Teile
item.weapon_mod_generic.bronze_damage.name=Optimierter Bronzeverschluss
@ -3723,10 +3732,21 @@ item.weapon_mod_special.greasegun.name=Grease Gun Modernisierungskit
item.weapon_mod_special.saw.name=Bügelsäge
item.weapon_mod_special.scope.name=Ziehlvorrichtung
item.weapon_mod_special.silencer.name=Schalldämpfer
item.weapon_mod_special.skin_saturnite.name=Saturnit-Skin
item.weapon_mod_special.slowdown.name=Rädergetriebe
item.weapon_mod_special.speedloader.name=Schnelllader
item.weapon_mod_special.speedup.name=Elektrischer Servomotor
item.weapon_mod_special.stack_mag.name=Zweistapel-Magazin
item.weapon_mod_test.damage.name=DAMAGE UPGRADE
item.weapon_mod_test.firerate.name=FIRE RATE UPGRADE
item.weapon_mod_test.multi.name=MULTI SHOT UPGRADE
item.weapon_mod_test.override_2_5.name=DAMAGE OVERRIDE (2.5)
item.weapon_mod_test.override_5.name=DAMAGE OVERRIDE (5)
item.weapon_mod_test.override_7_5.name=DAMAGE OVERRIDE (7.5)
item.weapon_mod_test.override_10.name=DAMAGE OVERRIDE (10)
item.weapon_mod_test.override_12_5.name=DAMAGE OVERRIDE (12.5)
item.weapon_mod_test.override_15.name=DAMAGE OVERRIDE (15)
item.weapon_mod_test.override_20.name=DAMAGE OVERRIDE (20)
item.weapon_pipe_lead.name=Die Handüberbrückung
item.weapon_pipe_rusty.name=Der Einstellungskorrigierer
item.weapon_saw.name=Ärztlich autorisierter Mord
@ -4870,6 +4890,7 @@ tile.sellafield_slaked.name=Gelöschtes Sellafit
tile.semtex.name=Semtex
tile.silo_hatch.name=Siloluke
tile.silo_hatch_large.name=Große Siloluke
tile.skeleton_holder.name=Oh, ich glaub' der ist tot
tile.sliding_blast_door.name=Sprengtür
tile.solar_mirror.name=Heliostatspiegel
tile.soyuz_capsule.name=Landekapsel

View File

@ -3270,6 +3270,7 @@ item.insert_polonium.name=Polonium Insert
item.insert_steel.name=Heavy Steel Insert
item.insert_xsapi.name=XSAPI Insert
item.insert_yharonite.name=Yharonite Insert
item.item_secret.aberrator.name=Aberrator Part
item.item_secret.canister.name=Composition SB-26
item.item_secret.controller.name=Proprietary Control Unit
item.item_secret.selenium_steel.name=Selenium Steel
@ -4724,6 +4725,14 @@ item.wd40.name=VT-40
item.weapon_bat.name=Richard's Default
item.weapon_bat_nail.name=The Cliché
item.weapon_golf_club.name=Russian Mobster's Club
item.weapon_mod_caliber.bmg50.name=.50 BMG Conversion Kit
item.weapon_mod_caliber.m357.name=.357 Magnum Conversion Kit
item.weapon_mod_caliber.m44.name=.44 Magnum Conversion Kit
item.weapon_mod_caliber.p22.name=.22 LR Conversion Kit
item.weapon_mod_caliber.p45.name=.45 Conversion Kit
item.weapon_mod_caliber.p9.name=9mm Conversion Kit
item.weapon_mod_caliber.r556.name=5.56mm Conversion Kit
item.weapon_mod_caliber.r762.name=7.62mm Conversion Kit
item.weapon_mod_generic.bigmt_damage.name=Optimized Saturnite Receiver
item.weapon_mod_generic.bigmt_dura.name=High-Durability Saturnite Parts
item.weapon_mod_generic.bronze_damage.name=Optimized Bronze Receiver
@ -4750,10 +4759,21 @@ item.weapon_mod_special.greasegun.name=Grease Gun Modernization Kit
item.weapon_mod_special.saw.name=Hacksaw
item.weapon_mod_special.scope.name=Scope
item.weapon_mod_special.silencer.name=Silencer
item.weapon_mod_special.skin_saturnite.name=Saturnite Skin
item.weapon_mod_special.slowdown.name=Gear Train
item.weapon_mod_special.speedloader.name=Speedloader
item.weapon_mod_special.speedup.name=Auxiliary Electric Engine
item.weapon_mod_special.stack_mag.name=Double-Stacked Magazine
item.weapon_mod_test.damage.name=DAMAGE UPGRADE
item.weapon_mod_test.firerate.name=FIRE RATE UPGRADE
item.weapon_mod_test.multi.name=MULTI SHOT UPGRADE
item.weapon_mod_test.override_2_5.name=DAMAGE OVERRIDE (2.5)
item.weapon_mod_test.override_5.name=DAMAGE OVERRIDE (5)
item.weapon_mod_test.override_7_5.name=DAMAGE OVERRIDE (7.5)
item.weapon_mod_test.override_10.name=DAMAGE OVERRIDE (10)
item.weapon_mod_test.override_12_5.name=DAMAGE OVERRIDE (12.5)
item.weapon_mod_test.override_15.name=DAMAGE OVERRIDE (15)
item.weapon_mod_test.override_20.name=DAMAGE OVERRIDE (20)
item.weapon_pipe_lead.name=The Manual Override
item.weapon_pipe_rusty.name=The Attitude Adjuster
item.weapon_saw.name=Doctor Assisted Homicide
@ -6015,6 +6035,7 @@ tile.sellafield_slaked.name=Slaked Sellafite
tile.semtex.name=Semtex
tile.silo_hatch.name=Silo Hatch
tile.silo_hatch_large.name=Large Silo Hatch
tile.skeleton_holder.name=Oh, that's a dead guy
tile.sliding_blast_door.name=Sliding Blast Door
tile.solar_mirror.name=Heliostat Mirror
tile.soyuz_capsule.name=Cargo Landing Capsule

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,330 @@
# Blender v2.79 (sub 0) OBJ File: 'skeleton_holder.blend'
# www.blender.org
o Holder1
v -0.007506 0.185094 0.287769
v -0.369728 0.834613 0.384826
v -0.039858 0.185094 0.167028
v -0.402080 0.834613 0.264085
v 0.097059 0.247594 0.259751
v -0.265163 0.897113 0.356808
v 0.064706 0.247594 0.139010
v -0.297516 0.897113 0.236067
v 0.365620 0.000000 -0.258745
v -0.358824 0.000000 -0.064630
v 0.333268 0.000000 -0.379485
v -0.391176 0.000000 -0.185371
v 0.365620 0.125000 -0.258745
v -0.358824 0.125000 -0.064630
v 0.333268 0.125000 -0.379485
v -0.391176 0.125000 -0.185371
v -0.491581 1.016218 0.267475
v -0.205884 1.425794 0.242480
v -0.535159 1.016218 -0.230622
v -0.249462 1.425794 -0.255617
v -0.083563 0.729430 0.231779
v 0.202134 1.139006 0.206783
v -0.127141 0.729430 -0.266319
v 0.158556 1.139006 -0.291314
v -0.491581 1.016218 0.267475
v -0.205884 1.425794 0.242480
v -0.535159 1.016218 -0.230622
v -0.249462 1.425794 -0.255617
v -0.083563 0.729430 0.231779
v 0.202134 1.139006 0.206783
v -0.127141 0.729430 -0.266319
v 0.158556 1.139006 -0.291314
v -0.250476 0.114105 0.250000
v -0.185109 0.861251 0.250000
v -0.250476 0.114105 -0.250000
v -0.185109 0.861251 -0.250000
v -0.499524 0.135894 0.250000
v -0.434158 0.883040 0.250000
v -0.499524 0.135894 -0.250000
v -0.434158 0.883040 -0.250000
v -0.250476 0.114105 0.250000
v -0.185109 0.861251 0.250000
v -0.250476 0.114105 -0.250000
v -0.185109 0.861251 -0.250000
v -0.499524 0.135894 0.250000
v -0.434158 0.883040 0.250000
v -0.499524 0.135894 -0.250000
v -0.434158 0.883040 -0.250000
v 0.333268 -0.000000 0.379485
v -0.391176 0.000000 0.185371
v 0.365620 -0.000000 0.258745
v -0.358824 0.000000 0.064630
v 0.333268 0.125000 0.379485
v -0.391176 0.125000 0.185371
v 0.365620 0.125000 0.258745
v -0.358824 0.125000 0.064630
v -0.039858 0.185094 -0.167028
v -0.402080 0.834613 -0.264085
v -0.007506 0.185094 -0.287769
v -0.369728 0.834613 -0.384826
v 0.064706 0.247594 -0.139010
v -0.297516 0.897113 -0.236067
v 0.097059 0.247594 -0.259751
v -0.265163 0.897113 -0.356808
vt 0.125000 0.437500
vt 0.093750 0.062500
vt 0.125000 0.062500
vt 0.093750 0.437500
vt 0.062500 0.062500
vt 0.062500 0.437500
vt 0.031250 0.062500
vt -0.000000 0.437500
vt 0.000000 0.062500
vt 0.062500 0.500000
vt 0.093750 0.437500
vt 0.093750 0.500000
vt 0.062500 0.500000
vt 0.031250 0.437500
vt 0.125000 0.062500
vt 0.093750 0.437500
vt 0.093750 0.062500
vt 0.062500 0.062500
vt 0.062500 0.437500
vt 0.031250 0.062500
vt 0.031250 0.437500
vt 0.000000 0.062500
vt 0.062500 0.437500
vt 0.093750 0.500000
vt 0.062500 0.500000
vt 0.062500 0.500000
vt 0.500000 0.500000
vt 0.375000 0.750000
vt 0.375000 0.500000
vt 0.250000 0.500000
vt 0.250000 0.750000
vt 0.125000 0.500000
vt 0.125000 0.750000
vt -0.000000 0.500000
vt 0.250000 0.750000
vt 0.375000 1.000000
vt 0.250000 1.000000
vt 0.250000 1.000000
vt 0.500000 0.500000
vt 0.375000 0.750000
vt 0.500000 0.750000
vt 0.250000 0.500000
vt 0.375000 0.500000
vt 0.125000 0.500000
vt 0.250000 0.750000
vt -0.000000 0.500000
vt 0.125000 0.750000
vt 0.375000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.250000 1.000000
vt 0.312500 0.000000
vt 0.437500 0.375000
vt 0.437500 0.000000
vt 0.500000 0.000000
vt 0.437500 0.375000
vt 0.437500 0.000000
vt 0.625000 0.000000
vt 0.500000 0.375000
vt 0.312500 0.000000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.437500 0.500000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.500000
vt 0.312500 0.375000
vt 0.437500 0.375000
vt 0.312500 0.000000
vt 0.437500 0.000000
vt 0.437500 0.375000
vt 0.500000 0.000000
vt 0.437500 0.000000
vt 0.500000 0.375000
vt 0.625000 0.000000
vt 0.250000 0.375000
vt 0.312500 0.000000
vt 0.250000 0.000000
vt 0.562500 0.375000
vt 0.437500 0.500000
vt 0.562500 0.500000
vt 0.437500 0.500000
vt 0.312500 0.375000
vt 0.312500 0.500000
vt 0.125000 0.437500
vt 0.093750 0.062500
vt 0.125000 0.062500
vt 0.093750 0.437500
vt 0.062500 0.062500
vt 0.062500 0.437500
vt 0.031250 0.062500
vt -0.000000 0.437500
vt 0.000000 0.062500
vt 0.062500 0.500000
vt 0.093750 0.437500
vt 0.093750 0.500000
vt 0.062500 0.500000
vt 0.031250 0.437500
vt 0.125000 0.437500
vt 0.093750 0.062500
vt 0.125000 0.062500
vt 0.062500 0.437500
vt 0.062500 0.062500
vt 0.031250 0.062500
vt 0.031250 0.437500
vt 0.000000 0.062500
vt 0.062500 0.500000
vt 0.093750 0.437500
vt 0.093750 0.500000
vt 0.062500 0.500000
vt 0.062500 0.437500
vt 0.031250 0.500000
vt 0.125000 0.437500
vt -0.000000 0.437500
vt 0.093750 0.437500
vt 0.031250 0.500000
vt 0.500000 0.750000
vt -0.000000 0.750000
vt 0.375000 0.750000
vt 0.125000 1.000000
vt -0.000000 0.750000
vt 0.375000 0.750000
vt 0.125000 1.000000
vt 0.312500 0.375000
vt 0.625000 0.375000
vt 0.437500 0.375000
vt 0.312500 0.500000
vt 0.312500 0.375000
vt 0.625000 0.375000
vt 0.437500 0.375000
vt 0.062500 0.437500
vt 0.031250 0.500000
vt 0.093750 0.437500
vt -0.000000 0.437500
vt 0.062500 0.437500
vt 0.031250 0.500000
vn -0.8365 -0.5000 0.2241
vn -0.2588 -0.0000 -0.9659
vn 0.8365 0.5000 -0.2241
vn 0.2588 0.0000 0.9659
vn 0.4830 -0.8660 -0.1294
vn -0.4830 0.8660 0.1294
vn -0.0000 -1.0000 0.0000
vn 0.0000 1.0000 -0.0000
vn 0.9659 0.0000 -0.2588
vn -0.9659 0.0000 0.2588
vn -0.8160 0.5736 0.0714
vn -0.0872 -0.0000 -0.9962
vn 0.8160 -0.5736 -0.0714
vn 0.0872 0.0000 0.9962
vn -0.5714 -0.8192 0.0500
vn 0.5714 0.8192 -0.0500
vn 0.9962 -0.0872 0.0000
vn 0.0000 -0.0000 -1.0000
vn -0.9962 0.0872 0.0000
vn -0.0000 0.0000 1.0000
vn -0.0872 -0.9962 0.0000
vn 0.0872 0.9962 0.0000
vn 0.2588 0.0000 -0.9659
vn -0.2588 0.0000 0.9659
vn 0.9659 0.0000 0.2588
vn -0.9659 0.0000 -0.2588
vn -0.8365 -0.5000 -0.2241
vn 0.8365 0.5000 0.2241
vn 0.4830 -0.8660 0.1294
vn -0.4830 0.8660 -0.1294
s off
f 2/1/1 3/2/1 1/3/1
f 4/4/2 7/5/2 3/2/2
f 8/6/3 5/7/3 7/5/3
f 5/7/4 2/8/4 1/9/4
f 3/10/5 5/11/5 1/12/5
f 4/13/6 6/14/6 8/6/6
f 9/15/7 12/16/7 11/17/7
f 12/16/2 15/18/2 11/17/2
f 16/19/8 13/20/8 15/18/8
f 14/21/4 9/22/4 13/20/4
f 15/23/9 9/24/9 11/25/9
f 12/26/10 14/21/10 16/19/10
f 17/27/11 20/28/11 19/29/11
f 20/28/12 23/30/12 19/29/12
f 24/31/13 21/32/13 23/30/13
f 22/33/14 17/34/14 21/32/14
f 23/35/15 17/36/15 19/37/15
f 20/38/16 22/33/16 24/31/16
f 25/39/13 28/40/13 26/41/13
f 31/42/14 28/40/14 27/43/14
f 29/44/11 32/45/11 31/42/11
f 25/46/12 30/47/12 29/44/12
f 25/48/16 31/49/16 27/50/16
f 30/47/15 28/51/15 32/45/15
f 35/52/17 34/53/17 33/54/17
f 39/55/18 36/56/18 35/57/18
f 37/58/19 40/59/19 39/55/19
f 33/60/20 38/61/20 37/62/20
f 33/63/21 39/64/21 35/65/21
f 40/66/22 34/67/22 36/56/22
f 42/68/19 43/69/19 41/70/19
f 44/71/20 47/72/20 43/73/20
f 48/74/17 45/75/17 47/72/17
f 46/76/18 41/77/18 45/78/18
f 47/79/22 41/80/22 43/81/22
f 48/82/21 42/83/21 46/84/21
f 50/85/7 51/86/7 49/87/7
f 52/88/23 55/89/23 51/86/23
f 56/90/8 53/91/8 55/89/8
f 53/91/24 50/92/24 49/93/24
f 51/94/25 53/95/25 49/96/25
f 52/97/26 54/98/26 56/90/26
f 58/99/27 59/100/27 57/101/27
f 59/100/23 64/102/23 63/103/23
f 64/102/28 61/104/28 63/103/28
f 62/105/24 57/106/24 61/104/24
f 59/107/29 61/108/29 57/109/29
f 60/110/30 62/105/30 64/102/30
f 2/1/1 4/4/1 3/2/1
f 4/4/2 8/6/2 7/5/2
f 8/6/3 6/14/3 5/7/3
f 5/7/4 6/14/4 2/8/4
f 3/10/5 7/111/5 5/11/5
f 4/13/6 2/112/6 6/14/6
f 9/15/7 10/113/7 12/16/7
f 12/16/2 16/19/2 15/18/2
f 16/19/8 14/21/8 13/20/8
f 14/21/4 10/114/4 9/22/4
f 15/23/9 13/115/9 9/24/9
f 12/26/10 10/116/10 14/21/10
f 17/27/11 18/117/11 20/28/11
f 20/28/12 24/31/12 23/30/12
f 24/31/13 22/33/13 21/32/13
f 22/33/14 18/118/14 17/34/14
f 23/35/15 21/119/15 17/36/15
f 20/38/16 18/120/16 22/33/16
f 25/39/13 27/43/13 28/40/13
f 31/42/14 32/45/14 28/40/14
f 29/44/11 30/47/11 32/45/11
f 25/46/12 26/121/12 30/47/12
f 25/48/16 29/122/16 31/49/16
f 30/47/15 26/123/15 28/51/15
f 35/52/17 36/124/17 34/53/17
f 39/55/18 40/59/18 36/56/18
f 37/58/19 38/125/19 40/59/19
f 33/60/20 34/67/20 38/61/20
f 33/63/21 37/126/21 39/64/21
f 40/66/22 38/127/22 34/67/22
f 42/68/19 44/128/19 43/69/19
f 44/71/20 48/74/20 47/72/20
f 48/74/17 46/129/17 45/75/17
f 46/76/18 42/83/18 41/77/18
f 47/79/22 45/130/22 41/80/22
f 48/82/21 44/71/21 42/83/21
f 50/85/7 52/88/7 51/86/7
f 52/88/23 56/90/23 55/89/23
f 56/90/8 54/98/8 53/91/8
f 53/91/24 54/98/24 50/92/24
f 51/94/25 55/131/25 53/95/25
f 52/97/26 50/132/26 54/98/26
f 58/99/27 60/133/27 59/100/27
f 59/100/23 60/133/23 64/102/23
f 64/102/28 62/105/28 61/104/28
f 62/105/24 58/134/24 57/106/24
f 59/107/29 63/135/29 61/108/29
f 60/110/30 58/136/30 62/105/30

Some files were not shown because too many files have changed in this diff Show More