mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'master' into zh_CN.lang
This commit is contained in:
commit
ff1c40fda1
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=4578
|
||||
mod_build_number=4592
|
||||
|
||||
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models, porting),\
|
||||
@ -11,4 +11,4 @@ credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion al
|
||||
\ Sten89 (models), Pixelguru26 (textures), TheBlueHat (textures), Alcater (GUI textures, porting), impbk2002 (project settings),\
|
||||
\ OvermindDL1 (project settings), TehTemmie (reacher radiation function), Toshayo (satellite loot system, project settings), Silly541 (config for safe ME drives),\
|
||||
\ Voxelstice (OpenComputers integration, turbine spinup), BallOfEnergy1 (OpenComputers integration), martemen (project settings),\
|
||||
\ Pvndols (thorium fuel recipe, gas turbine), JamesH2 (blood mechanics, nitric acid), sdddddf80 (recipe configs), SuperCraftAlex (tooltips)
|
||||
\ Pvndols (thorium fuel recipe, gas turbine), JamesH2 (blood mechanics, nitric acid), sdddddf80 (recipe configs), SuperCraftAlex (tooltips)
|
||||
|
||||
@ -10,4 +10,10 @@ public interface IEnergyGenerator extends IEnergyUser {
|
||||
public default long transferPower(long power) {
|
||||
return power;
|
||||
}
|
||||
|
||||
/* should stop making non-receivers from interfering by applying their weight which doesn't even matter */
|
||||
@Override
|
||||
public default long getTransferWeight() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,11 @@ public class BlockEnums {
|
||||
LIMESTONE
|
||||
}
|
||||
|
||||
public static enum EnumBiomeType {
|
||||
DESERT,
|
||||
WOODLAND
|
||||
}
|
||||
|
||||
public static enum EnumStalagmiteType {
|
||||
SULFUR,
|
||||
ASBESTOS
|
||||
|
||||
@ -11,6 +11,8 @@ import com.hbm.blocks.machine.*;
|
||||
import com.hbm.blocks.machine.pile.*;
|
||||
import com.hbm.blocks.machine.rbmk.*;
|
||||
import com.hbm.blocks.network.*;
|
||||
import com.hbm.blocks.rail.RailStandardCurve;
|
||||
import com.hbm.blocks.rail.RailStandardStraight;
|
||||
import com.hbm.blocks.siege.*;
|
||||
import com.hbm.blocks.test.*;
|
||||
import com.hbm.blocks.turret.*;
|
||||
@ -136,6 +138,7 @@ public class ModBlocks {
|
||||
public static Block stone_resource;
|
||||
public static Block stalagmite;
|
||||
public static Block stalactite;
|
||||
public static Block stone_biome;
|
||||
public static Block stone_deep_cobble;
|
||||
|
||||
public static Block depth_brick;
|
||||
@ -928,6 +931,7 @@ public class ModBlocks {
|
||||
public static Block fraction_spacer;
|
||||
public static Block machine_catalytic_cracker;
|
||||
public static Block machine_catalytic_reformer;
|
||||
public static Block machine_coker;
|
||||
|
||||
public static Block machine_boiler_off;
|
||||
public static Block machine_boiler_on;
|
||||
@ -1083,6 +1087,9 @@ public class ModBlocks {
|
||||
public static Block rail_narrow;
|
||||
public static Block rail_highspeed;
|
||||
public static Block rail_booster;
|
||||
|
||||
public static Block rail_large_straight;
|
||||
public static Block rail_large_curve;
|
||||
|
||||
public static Block statue_elb;
|
||||
public static Block statue_elb_g;
|
||||
@ -1312,6 +1319,7 @@ public class ModBlocks {
|
||||
stone_resource = new BlockResourceStone().setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stalagmite = new BlockStalagmite().setBlockName("stalagmite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stone_biome = new BlockBiomeStone().setBlockName("stone_biome").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stone_deep_cobble = new BlockDeepCobble().setBlockName("stone_deep_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(30.0F);
|
||||
|
||||
basalt = new BlockGeneric(Material.rock).setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt");
|
||||
@ -1437,7 +1445,7 @@ public class ModBlocks {
|
||||
block_semtex = new BlockPlasticExplosive(Material.tnt).setBlockName("block_semtex").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_semtex");
|
||||
block_c4 = new BlockPlasticExplosive(Material.tnt).setBlockName("block_c4").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_c4");
|
||||
block_smore = new BlockPillar(Material.rock, RefStrings.MODID + ":block_smore_top").setBlockName("block_smore").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_smore_side");
|
||||
block_slag = new BlockBeaconable(Material.iron).setBlockName("block_slag").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_slag");
|
||||
block_slag = new BlockSlag(Material.rock).setBlockName("block_slag").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeStone).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_slag");
|
||||
|
||||
block_australium = new BlockBeaconable(Material.iron).setBlockName("block_australium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_australium");
|
||||
block_weidanium = new BlockBeaconable(Material.iron).setBlockName("block_weidanium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_weidanium");
|
||||
@ -2108,6 +2116,8 @@ public class ModBlocks {
|
||||
rail_narrow = new RailGeneric().setBlockName("rail_narrow").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_narrow");
|
||||
rail_highspeed = new RailGeneric().setMaxSpeed(1F).setFlexible(false).setBlockName("rail_highspeed").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_highspeed");
|
||||
rail_booster = new RailBooster().setBlockName("rail_booster").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_booster");
|
||||
rail_large_straight = new RailStandardStraight().setBlockName("rail_large_straight").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
rail_large_curve = new RailStandardCurve().setBlockName("rail_large_curve").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
crate = new BlockCrate(Material.wood).setBlockName("crate").setStepSound(Block.soundTypeWood).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate");
|
||||
crate_weapon = new BlockCrate(Material.wood).setBlockName("crate_weapon").setStepSound(Block.soundTypeWood).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_weapon");
|
||||
@ -2139,6 +2149,7 @@ public class ModBlocks {
|
||||
fraction_spacer = new FractionSpacer(Material.iron).setBlockName("fraction_spacer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_catalytic_cracker = new MachineCatalyticCracker(Material.iron).setBlockName("machine_catalytic_cracker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_catalytic_reformer = new MachineCatalyticReformer(Material.iron).setBlockName("machine_catalytic_reformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_coker = new MachineCoker(Material.iron).setBlockName("machine_coker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_autosaw = new MachineAutosaw().setBlockName("machine_autosaw").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_drill");
|
||||
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2452,9 +2463,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(crystal_trixite, crystal_trixite.getUnlocalizedName());
|
||||
|
||||
//Resource-bearing Stones
|
||||
GameRegistry.registerBlock(stone_resource, ItemBlockBase.class, stone_resource.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stalagmite, ItemBlockBase.class, stalagmite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stalactite, ItemBlockBase.class, stalactite.getUnlocalizedName());
|
||||
register(stone_resource);
|
||||
register(stalagmite);
|
||||
register(stalactite);
|
||||
register(stone_biome);
|
||||
|
||||
//Stone Variants
|
||||
GameRegistry.registerBlock(stone_porous, stone_porous.getUnlocalizedName());
|
||||
@ -3186,12 +3198,13 @@ public class ModBlocks {
|
||||
register(machine_flare);
|
||||
register(machine_refinery);
|
||||
register(machine_vacuum_distill);
|
||||
GameRegistry.registerBlock(machine_fraction_tower, machine_fraction_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fraction_spacer, fraction_spacer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_catalytic_cracker, machine_catalytic_cracker.getUnlocalizedName());
|
||||
register(machine_fraction_tower);
|
||||
register(fraction_spacer);
|
||||
register(machine_catalytic_cracker);
|
||||
register(machine_catalytic_reformer);
|
||||
GameRegistry.registerBlock(machine_drill, machine_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_autosaw, machine_autosaw.getUnlocalizedName());
|
||||
register(machine_coker);
|
||||
register(machine_drill);
|
||||
register(machine_autosaw);
|
||||
register(machine_excavator);
|
||||
register(machine_mining_laser);
|
||||
register(barricade);
|
||||
@ -3323,6 +3336,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(rail_narrow, ItemBlockBase.class, rail_narrow.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rail_highspeed, ItemBlockBase.class, rail_highspeed.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rail_booster, ItemBlockBase.class, rail_booster.getUnlocalizedName());
|
||||
register(rail_large_straight);
|
||||
register(rail_large_curve);
|
||||
|
||||
//Crate
|
||||
GameRegistry.registerBlock(crate, crate.getUnlocalizedName());
|
||||
|
||||
@ -185,7 +185,7 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
}
|
||||
}
|
||||
|
||||
if(entity instanceof EntityCreeper) {
|
||||
if(entity != null && entity.getClass().equals(EntityCreeper.class)) {
|
||||
EntityCreeperTainted creep = new EntityCreeperTainted(world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
|
||||
53
src/main/java/com/hbm/blocks/generic/BlockBiomeStone.java
Normal file
53
src/main/java/com/hbm/blocks/generic/BlockBiomeStone.java
Normal file
@ -0,0 +1,53 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums.EnumBiomeType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockBiomeStone extends BlockEnumMulti {
|
||||
|
||||
public BlockBiomeStone() {
|
||||
super(Material.rock, EnumBiomeType.class, true, true);
|
||||
}
|
||||
|
||||
protected IIcon[] iconsTop;
|
||||
protected IIcon[] iconsLayer;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
this.icons = new IIcon[enums.length];
|
||||
this.iconsTop = new IIcon[enums.length];
|
||||
this.iconsLayer = new IIcon[enums.length];
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase());
|
||||
this.iconsTop[i] = reg.registerIcon(this.getTextureName() + "_top." + num.name().toLowerCase());
|
||||
this.iconsLayer[i] = reg.registerIcon(this.getTextureName() + "_layer." + num.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(side == 0) return this.iconsTop[meta % this.icons.length];
|
||||
if(side == 1) return this.iconsTop[meta % this.icons.length];
|
||||
|
||||
if(world.getBlock(x, y + 1, z) == this && world.getBlockMetadata(x, y + 1, z) == meta) {
|
||||
return this.getIcon(side, meta);
|
||||
} else {
|
||||
return this.iconsLayer[meta % this.icons.length];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,9 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.inventory.gui.GUIScreenBobble;
|
||||
import com.hbm.items.special.ItemPlasticScrap.ScrapType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -33,6 +29,9 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
|
||||
public BlockBobble() {
|
||||
@ -191,7 +190,8 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
VAER( "vaer", "vaer", "ZIRNOX", "taken de family out to the weekend cigarette festival", true, ScrapType.MEM_16K_D),
|
||||
NOS( "Dr Nostalgia", "Dr Nostalgia", "SSG and Vortex models", "Take a picture, I'ma pose, paparazzi$I've been drinking, moving like a zombie", true, ScrapType.BOARD_TRANSISTOR),
|
||||
DRILLGON( "Drillgon200", "Drillgon200", "1.12 Port", null, false, ScrapType.CPU_LOGIC),
|
||||
CIRNO( "Cirno", "Cirno", "the only multi layered skin i had", "No brain. Head empty.", true, ScrapType.BOARD_BLANK);
|
||||
CIRNO( "Cirno", "Cirno", "the only multi layered skin i had", "No brain. Head empty.", true, ScrapType.BOARD_BLANK),
|
||||
MICROWAVE( "Microwave", "Microwave", "adding OC compat", "they call me the food heater", true, ScrapType.BRIDGE_BIOS);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
public String label; //the name engraved in the socket
|
||||
|
||||
32
src/main/java/com/hbm/blocks/generic/BlockSlag.java
Normal file
32
src/main/java/com/hbm/blocks/generic/BlockSlag.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockSlag extends BlockBeaconable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconAlt;
|
||||
|
||||
public BlockSlag(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconAlt = iconRegister.registerIcon(this.getTextureName() + "_broken");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if(metadata == 1) return this.iconAlt;
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
}
|
||||
87
src/main/java/com/hbm/blocks/machine/MachineCoker.java
Normal file
87
src/main/java/com/hbm/blocks/machine/MachineCoker.java
Normal file
@ -0,0 +1,87 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCoker;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCoker extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineCoker(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityMachineCoker();
|
||||
if(meta >= extra) return new TileEntityProxyCombo().inventory().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {22, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
if(super.checkRequirement(world, x, y, z, dir, o)) {
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y + 1, z, new int[] {5, 0, 2, 2, 2, 2}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 1, z, new int[] {5, 0, 2, 2, 2, 2}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
|
||||
this.makeExtra(world, x + 1, y, z + 1);
|
||||
this.makeExtra(world, x + 1, y, z - 1);
|
||||
this.makeExtra(world, x - 1, y, z + 1);
|
||||
this.makeExtra(world, x - 1, y, z - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
@ -11,6 +13,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@ -29,6 +32,11 @@ public class Watz extends BlockDummyable {
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
43
src/main/java/com/hbm/blocks/rail/IRailNTM.java
Normal file
43
src/main/java/com/hbm/blocks/rail/IRailNTM.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.hbm.blocks.rail;
|
||||
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/** in retrospect, not the best name i could have chosen */
|
||||
public interface IRailNTM {
|
||||
|
||||
/** Returns a vector pointing to the closest snapping position given the starting position */
|
||||
public Vec3 getSnappingPos(World world, int x, int y, int z, double trainX, double trainY, double trainZ);
|
||||
|
||||
/**
|
||||
* Returns a location on the rail based on the train's current X/Y/Z momentum as well as the intended speed along the rail.
|
||||
* If the train would leave the rail within that tick, the position is the last valid position on that rail.
|
||||
* Inherently safer than simply adding the motion to the position and then snapping, since that may lead to derailing.
|
||||
* The motion has to be calculated from the train's rotation (rotated 180° when going backwards), the scalar doesn't matter since it's only used for determining orientation in a clear way.
|
||||
* Motion ends up being *-1 if the train is going in reverse, still pointing forwards despite the speed being negative.
|
||||
* Also features a double[] wrapper with size 1 which holds the speed value that overshoots the rail.
|
||||
* */
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, double trainX, double trainY, double trainZ, double motionX, double motionY, double motionZ, double speed, RailContext info);
|
||||
|
||||
/** Returns that rail's gauge. Trains will derail if the gauge does not match. */
|
||||
public TrackGauge getGauge(World world, int x, int y, int z);
|
||||
|
||||
public static enum TrackGauge {
|
||||
STANDARD //roughly 1.5m
|
||||
}
|
||||
|
||||
/** A wrapper for all relevant info required when leaving a rail */
|
||||
public static class RailContext {
|
||||
/** The angle at which the train ends up being on this rail */
|
||||
public float yaw;
|
||||
/** The amount of blocks still left to travel after completing the rail */
|
||||
public double overshoot;
|
||||
/** The exit position of that rail */
|
||||
public BlockPos pos;
|
||||
public RailContext yaw(float y) { this.yaw = y; return this; }
|
||||
public RailContext dist(double d) { this.overshoot = d; return this; }
|
||||
public RailContext pos(BlockPos d) { this.pos = d; return this; }
|
||||
}
|
||||
}
|
||||
141
src/main/java/com/hbm/blocks/rail/RailStandardCurve.java
Normal file
141
src/main/java/com/hbm/blocks/rail/RailStandardCurve.java
Normal file
@ -0,0 +1,141 @@
|
||||
package com.hbm.blocks.rail;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class RailStandardCurve extends BlockDummyable implements IRailNTM {
|
||||
|
||||
public RailStandardCurve() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getSnappingPos(World world, int x, int y, int z, double trainX, double trainY, double trainZ) {
|
||||
return snapAndMove(world, x, y, z, trainX, trainY, trainZ, 0, 0, 0, 0, new RailContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, double trainX, double trainY, double trainZ, double motionX, double motionY, double motionZ, double speed, RailContext info) {
|
||||
return snapAndMove(world, x, y, z, trainX, trainY, trainZ, motionX, motionY, motionZ, speed, info);
|
||||
}
|
||||
|
||||
/* Very simple function determining the snapping position and adding the motion value to it, if desired. */
|
||||
public Vec3 snapAndMove(World world, int x, int y, int z, double trainX, double trainY, double trainZ, double motionX, double motionY, double motionZ, double speed, RailContext info) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return Vec3.createVectorHelper(trainX, trainY, trainZ);
|
||||
int cX = pos[0];
|
||||
int cY = pos[1];
|
||||
int cZ = pos[2];
|
||||
int meta = world.getBlockMetadata(cX, cY, cZ) - this.offset;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
double turnRadius = 4.5D;
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(trainX, trainY, trainZ);
|
||||
double axisX = cX + 0.5 + dir.offsetX * 0.5 + rot.offsetX * turnRadius;
|
||||
double axisZ = cZ + 0.5 + dir.offsetZ * 0.5 + rot.offsetZ * turnRadius;
|
||||
|
||||
Vec3 dist = Vec3.createVectorHelper(vec.xCoord - axisX, 0, vec.zCoord - axisZ);
|
||||
dist = dist.normalize();
|
||||
dist.xCoord *= turnRadius;
|
||||
dist.zCoord *= turnRadius;
|
||||
|
||||
double moveAngle = Math.atan2(motionX, motionZ) * 180D / Math.PI + 90;
|
||||
|
||||
if(speed == 0) {
|
||||
info.dist(0).pos(new BlockPos(x, y, z)).yaw((float) moveAngle);
|
||||
return Vec3.createVectorHelper(axisX + dist.xCoord, y, axisZ + dist.zCoord);
|
||||
}
|
||||
|
||||
double angleDeg = Math.atan2(dist.xCoord, dist.zCoord) * 180D / Math.PI + 90;
|
||||
if(dir == Library.NEG_X) angleDeg -= 90;
|
||||
if(dir == Library.POS_X) angleDeg += 90;
|
||||
if(dir == Library.POS_Z) angleDeg += 180;
|
||||
angleDeg = MathHelper.wrapAngleTo180_double(angleDeg);
|
||||
double length90Deg = turnRadius * Math.PI / 2D;
|
||||
double angularChange = speed / length90Deg * 90D;
|
||||
|
||||
ForgeDirection moveDir = ForgeDirection.UNKNOWN;
|
||||
|
||||
if(Math.abs(motionX) > Math.abs(motionZ)) {
|
||||
moveDir = motionX > 0 ? Library.POS_X : Library.NEG_X;
|
||||
} else {
|
||||
moveDir = motionZ > 0 ? Library.POS_Z : Library.NEG_Z;
|
||||
}
|
||||
|
||||
if(moveDir == dir || moveDir == rot.getOpposite()) {
|
||||
angularChange *= -1;
|
||||
}
|
||||
|
||||
double effAngle = angleDeg + angularChange;
|
||||
moveAngle += angularChange;
|
||||
|
||||
if(effAngle > 90) {
|
||||
double angleOvershoot = effAngle - 90D;
|
||||
moveAngle -= angleOvershoot;
|
||||
double lengthOvershoot = angleOvershoot * length90Deg / 90D;
|
||||
info.dist(lengthOvershoot * Math.signum(speed * angularChange)).pos(new BlockPos(cX - dir.offsetX * 4 + rot.offsetX * 5, y, cZ - dir.offsetZ * 4 + rot.offsetZ * 5)).yaw((float) moveAngle);
|
||||
return Vec3.createVectorHelper(axisX - dir.offsetX * turnRadius, y, axisZ - dir.offsetZ * turnRadius);
|
||||
}
|
||||
|
||||
if(effAngle < 0) {
|
||||
double angleOvershoot = -effAngle;
|
||||
moveAngle -= angleOvershoot;
|
||||
double lengthOvershoot = angleOvershoot * length90Deg / 90D;
|
||||
info.dist(-lengthOvershoot * Math.signum(speed * angularChange)).pos(new BlockPos(cX + dir.offsetX , y, cZ + dir.offsetZ)).yaw((float) moveAngle);
|
||||
return Vec3.createVectorHelper(axisX - rot.offsetX * turnRadius, y, axisZ -rot.offsetZ * turnRadius);
|
||||
}
|
||||
|
||||
double radianChange = angularChange * Math.PI / 180D;
|
||||
dist.rotateAroundY((float) radianChange);
|
||||
|
||||
return Vec3.createVectorHelper(axisX + dist.xCoord, y, axisZ + dist.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrackGauge getGauge(World world, int x, int y, int z) {
|
||||
return TrackGauge.STANDARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {0, 0, 4, 0, 4, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 0.125F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 0.125F, 1F);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
}
|
||||
116
src/main/java/com/hbm/blocks/rail/RailStandardStraight.java
Normal file
116
src/main/java/com/hbm/blocks/rail/RailStandardStraight.java
Normal file
@ -0,0 +1,116 @@
|
||||
package com.hbm.blocks.rail;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class RailStandardStraight extends BlockDummyable implements IRailNTM {
|
||||
|
||||
public RailStandardStraight() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {0, 0, 2, 2, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 0.125F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, 0.125F, 1F);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getSnappingPos(World world, int x, int y, int z, double trainX, double trainY, double trainZ) {
|
||||
return snapAndMove(world, x, y, z, trainX, trainY, trainZ, 0, 0, 0, 0, new RailContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, double trainX, double trainY, double trainZ, double motionX, double motionY, double motionZ, double speed, RailContext info) {
|
||||
return snapAndMove(world, x, y, z, trainX, trainY, trainZ, motionX, motionY, motionZ, speed, info);
|
||||
}
|
||||
|
||||
/* Very simple function determining the snapping position and adding the motion value to it, if desired. */
|
||||
public Vec3 snapAndMove(World world, int x, int y, int z, double trainX, double trainY, double trainZ, double motionX, double motionY, double motionZ, double speed, RailContext info) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return Vec3.createVectorHelper(trainX, trainY, trainZ);
|
||||
int cX = pos[0];
|
||||
int cY = pos[1];
|
||||
int cZ = pos[2];
|
||||
int meta = world.getBlockMetadata(cX, cY, cZ) - this.offset;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(trainX, trainY, trainZ);
|
||||
|
||||
if(speed == 0) {
|
||||
//return vec;
|
||||
}
|
||||
|
||||
if(dir == Library.POS_X || dir == Library.NEG_X) {
|
||||
double targetX = trainX;
|
||||
if(motionX > 0) {
|
||||
targetX += speed;
|
||||
info.yaw(-90F);
|
||||
} else {
|
||||
targetX -= speed;
|
||||
info.yaw(90F);
|
||||
}
|
||||
vec.xCoord = MathHelper.clamp_double(targetX, cX - 2, cX + 3);
|
||||
vec.yCoord = y;
|
||||
vec.zCoord = cZ + 0.5;
|
||||
info.dist(Math.abs(targetX - vec.xCoord) * Math.signum(speed));
|
||||
info.pos(new BlockPos(cX + (motionX * speed > 0 ? 3 : -3), y, cZ));
|
||||
} else {
|
||||
double targetZ = trainZ;
|
||||
if(motionZ > 0) {
|
||||
targetZ += speed;
|
||||
info.yaw(0F);
|
||||
} else {
|
||||
targetZ -= speed;
|
||||
info.yaw(180F);
|
||||
}
|
||||
vec.xCoord = cX + 0.5;
|
||||
vec.yCoord = y;
|
||||
vec.zCoord = MathHelper.clamp_double(targetZ, cZ - 2,cZ + 3);
|
||||
info.dist(Math.abs(targetZ - vec.zCoord) * Math.signum(speed));
|
||||
info.pos(new BlockPos(cX, y, cZ + (motionZ * speed > 0 ? 3 : -3)));
|
||||
}
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrackGauge getGauge(World world, int x, int y, int z) {
|
||||
return TrackGauge.STANDARD;
|
||||
}
|
||||
}
|
||||
@ -136,6 +136,9 @@ public class RodRecipes {
|
||||
addPellet(PB, EnumWatzType.LEAD);
|
||||
addPellet(B, EnumWatzType.BORON);
|
||||
addPellet(U238, EnumWatzType.DU);
|
||||
}
|
||||
|
||||
public static void registerInit() {
|
||||
/* GT6 */
|
||||
if(OreDictionary.doesOreNameExist("ingotNaquadah-Enriched")) addPellet(new DictFrame("Naquadah-Enriched"), EnumWatzType.NQD);
|
||||
if(OreDictionary.doesOreNameExist("ingotNaquadria")) addPellet(new DictFrame("Naquadria"), EnumWatzType.NQR);
|
||||
|
||||
@ -156,6 +156,7 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fireext, 1), new Object[] { "HB", " T", 'H', ModItems.hull_small_steel, 'B', ModItems.bolt_tungsten, 'T', ModItems.tank_steel });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "TPS", "HHR", " L", 'T', ModItems.bolt_tungsten, 'P', STEEL.plate(), 'S', STEEL.ingot(), 'H', ModItems.hull_small_steel, 'R', ModItems.mechanism_rifle_1, 'L', ANY_PLASTIC.ingot()});
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_glass_cannon, 1), new Object[] { "GGC", "GTM", 'G', Item.getItemFromBlock(ModBlocks.glass_quartz), 'C', ModItems.battery_lithium_cell, 'T', ModItems.crt_display, 'M', ModItems.mechanism_special });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_remington, 1), new Object[] { "PPM", "S L", 'P', STEEL.plate(), 'M', ModItems.mechanism_rifle_1, 'S', KEY_SLAB, 'L', KEY_LOG });
|
||||
|
||||
//Ammo assemblies
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pellet_flechette, 1), new Object[] { " L ", " L ", "LLL", 'L', PB.nugget() });
|
||||
@ -187,7 +188,6 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_12gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.PERCUSSION), new Object[] { "G", "C", "P", 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.SLUG), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.FLECHETTE), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.tnt, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||
|
||||
@ -14,11 +14,17 @@ import com.hbm.entity.mob.botprime.*;
|
||||
import com.hbm.entity.mob.siege.*;
|
||||
import com.hbm.entity.particle.*;
|
||||
import com.hbm.entity.projectile.*;
|
||||
import com.hbm.entity.train.EntityRailCarRidable.SeatDummyEntity;
|
||||
import com.hbm.entity.train.TrainCargoTram;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.Tuple.Quartet;
|
||||
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
|
||||
|
||||
public class EntityMappings {
|
||||
|
||||
@ -204,10 +210,15 @@ public class EntityMappings {
|
||||
addEntity(EntitySawblade.class, "entity_stray_saw", 1000);
|
||||
addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000);
|
||||
addEntity(EntityMist.class, "entity_mist", 1000);
|
||||
|
||||
addEntity(SeatDummyEntity.class, "entity_ntm_seat_dummy", 250, false);
|
||||
addEntity(TrainCargoTram.class, "entity_ntm_cargo_tram", 250, false);
|
||||
|
||||
addMob(EntityCreeperNuclear.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);
|
||||
addMob(EntityCreeperTainted.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd);
|
||||
addMob(EntityCreeperPhosgene.class, "entity_mob_phosgene_creeper", 0xE3D398, 0xB8A06B);
|
||||
addMob(EntityCreeperVolatile.class, "entity_mob_volatile_creeper", 0xC28153, 0x4D382C);
|
||||
addMob(EntityCreeperGold.class, "entity_mob_gold_creeper", 0xECC136, 0x9E8B3E);
|
||||
addMob(EntityHunterChopper.class, "entity_mob_hunter_chopper", 0x000020, 0x2D2D72);
|
||||
addMob(EntityCyberCrab.class, "entity_cyber_crab", 0xAAAAAA, 0x444444);
|
||||
addMob(EntityTeslaCrab.class, "entity_tesla_crab", 0xAAAAAA, 0x440000);
|
||||
@ -221,6 +232,10 @@ public class EntityMappings {
|
||||
addMob(EntitySiegeSkeleton.class, "entity_meme_skeleton", 0x303030, 0x000080);
|
||||
addMob(EntitySiegeUFO.class, "entity_meme_ufo", 0x303030, 0x800000);
|
||||
addMob(EntitySiegeCraft.class, "entity_meme_craft", 0x303030, 0x808000);
|
||||
|
||||
addSpawn(EntityCreeperPhosgene.class, 5, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());
|
||||
addSpawn(EntityCreeperVolatile.class, 10, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());
|
||||
addSpawn(EntityCreeperGold.class, 1, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());
|
||||
|
||||
int id = 0;
|
||||
for(Quartet<Class<? extends Entity>, String, Integer, Boolean> entry : entityMappings) {
|
||||
@ -243,4 +258,26 @@ public class EntityMappings {
|
||||
private static void addMob(Class<? extends Entity> clazz, String name, int color1, int color2) {
|
||||
mobMappings.add(new Quartet(clazz, name, color1, color2));
|
||||
}
|
||||
|
||||
public static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes) {
|
||||
|
||||
for(BiomeGenBase biome : biomes) {
|
||||
|
||||
if(biome == null) continue;
|
||||
|
||||
List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature);
|
||||
|
||||
for(SpawnListEntry entry : spawns) {
|
||||
// Adjusting an existing spawn entry
|
||||
if(entry.entityClass == entityClass) {
|
||||
entry.itemWeight = weightedProb;
|
||||
entry.minGroupCount = min;
|
||||
entry.maxGroupCount = max;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
47
src/main/java/com/hbm/entity/mob/EntityCreeperGold.java
Normal file
47
src/main/java/com/hbm/entity/mob/EntityCreeperGold.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.*;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperGold extends EntityCreeper {
|
||||
|
||||
public EntityCreeperGold(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(worldObj, posX, posY, posZ, this.getPowered() ? 14 : 7, this);
|
||||
vnt.setBlockAllocator(new BlockAllocatorBulkie(60, this.getPowered() ? 32 : 16));
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorBulkie(Blocks.gold_ore)));
|
||||
vnt.setEntityProcessor(new EntityProcessorStandard().withRangeMod(0.5F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectStandard());
|
||||
vnt.explode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere() {
|
||||
return super.getCanSpawnHere() && this.posY <= 40;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean byPlayer, int looting) {
|
||||
|
||||
int amount = byPlayer ? 5 + rand.nextInt(6 + looting * 2) : 3;
|
||||
for(int i = 0; i < amount; ++i) {
|
||||
this.entityDropItem(new ItemStack(ModItems.crystal_gold), 0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/main/java/com/hbm/entity/mob/EntityCreeperVolatile.java
Normal file
44
src/main/java/com/hbm/entity/mob/EntityCreeperVolatile.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.*;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityCreeperVolatile extends EntityCreeper {
|
||||
|
||||
public EntityCreeperVolatile(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(worldObj, posX, posY, posZ, this.getPowered() ? 14 : 7, this);
|
||||
vnt.setBlockAllocator(new BlockAllocatorBulkie(60, this.getPowered() ? 32 : 16));
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorBulkie(ModBlocks.block_slag, 1)));
|
||||
vnt.setEntityProcessor(new EntityProcessorStandard().withRangeMod(0.5F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectStandard());
|
||||
vnt.explode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere() {
|
||||
return super.getCanSpawnHere() && this.posY <= 40;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean byPlayer, int looting) {
|
||||
this.entityDropItem(new ItemStack(ModItems.sulfur, 2 + rand.nextInt(3)), 0F);
|
||||
this.entityDropItem(new ItemStack(ModItems.stick_tnt, 1 + rand.nextInt(2)), 0F);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
@ -22,6 +23,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
@ -50,6 +52,11 @@ public class EntityBulletBase extends Entity implements IProjectile {
|
||||
private BulletConfiguration config;
|
||||
public EntityLivingBase shooter;
|
||||
public float overrideDamage;
|
||||
|
||||
public double prevRenderX;
|
||||
public double prevRenderY;
|
||||
public double prevRenderZ;
|
||||
public final List<Pair<Vec3, Double>> trailNodes = new ArrayList();
|
||||
|
||||
public BulletConfiguration getConfig() {
|
||||
return config;
|
||||
@ -236,6 +243,15 @@ public class EntityBulletBase extends Entity implements IProjectile {
|
||||
return;
|
||||
}
|
||||
|
||||
if(worldObj.isRemote && config.style == config.STYLE_TAU) {
|
||||
if(trailNodes.isEmpty()) {
|
||||
this.ignoreFrustumCheck = true;
|
||||
trailNodes.add(new Pair<Vec3, Double>(Vec3.createVectorHelper(-motionX * 2, -motionY * 2, -motionZ * 2), 0D));
|
||||
} else {
|
||||
trailNodes.add(new Pair<Vec3, Double>(Vec3.createVectorHelper(0, 0, 0), 1D));
|
||||
}
|
||||
}
|
||||
|
||||
if(this.config.blackPowder && this.ticksExisted == 1) {
|
||||
|
||||
for(int i = 0; i < 15; i++) {
|
||||
|
||||
199
src/main/java/com/hbm/entity/train/EntityRailCarBase.java
Normal file
199
src/main/java/com/hbm/entity/train/EntityRailCarBase.java
Normal file
@ -0,0 +1,199 @@
|
||||
package com.hbm.entity.train;
|
||||
|
||||
import com.hbm.blocks.rail.IRailNTM;
|
||||
import com.hbm.blocks.rail.IRailNTM.RailContext;
|
||||
import com.hbm.blocks.rail.IRailNTM.TrackGauge;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class EntityRailCarBase extends Entity {
|
||||
|
||||
public boolean isOnRail = true;
|
||||
private int turnProgress;
|
||||
private double trainX;
|
||||
private double trainY;
|
||||
private double trainZ;
|
||||
private double trainYaw;
|
||||
private double trainPitch;
|
||||
private float movementYaw;
|
||||
@SideOnly(Side.CLIENT) private double velocityX;
|
||||
@SideOnly(Side.CLIENT) private double velocityY;
|
||||
@SideOnly(Side.CLIENT) private double velocityZ;
|
||||
|
||||
public EntityRailCarBase(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override protected void entityInit() { }
|
||||
@Override protected void readEntityFromNBT(NBTTagCompound nbt) { }
|
||||
@Override protected void writeEntityToNBT(NBTTagCompound nbt) { }
|
||||
|
||||
@Override
|
||||
public boolean canBePushed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
return !this.isDead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
if(this.worldObj.isRemote) {
|
||||
|
||||
if(this.turnProgress > 0) {
|
||||
this.prevRotationYaw = this.rotationYaw;
|
||||
double x = this.posX + (this.trainX - this.posX) / (double) this.turnProgress;
|
||||
double y = this.posY + (this.trainY - this.posY) / (double) this.turnProgress;
|
||||
double z = this.posZ + (this.trainZ - this.posZ) / (double) this.turnProgress;
|
||||
double yaw = MathHelper.wrapAngleTo180_double(this.trainYaw - (double) this.rotationYaw);
|
||||
this.rotationYaw = (float) ((double) this.rotationYaw + yaw / (double) this.turnProgress);
|
||||
this.rotationPitch = (float) ((double) this.rotationPitch + (this.trainPitch - (double) this.rotationPitch) / (double) this.turnProgress);
|
||||
--this.turnProgress;
|
||||
this.setPosition(x, y, z);
|
||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||
} else {
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||
}
|
||||
} else {
|
||||
|
||||
BlockPos anchor = this.getCurentAnchorPos();
|
||||
Vec3 corePos = getRelPosAlongRail(anchor, this.getCurrentSpeed());
|
||||
|
||||
if(corePos == null) {
|
||||
this.derail();
|
||||
} else {
|
||||
this.setPosition(corePos.xCoord, corePos.yCoord, corePos.zCoord);
|
||||
anchor = this.getCurentAnchorPos(); //reset origin to new position
|
||||
Vec3 frontPos = getRelPosAlongRail(anchor, this.getLengthSpan());
|
||||
Vec3 backPos = getRelPosAlongRail(anchor, -this.getLengthSpan());
|
||||
|
||||
if(frontPos == null || backPos == null) {
|
||||
this.derail();
|
||||
} else {
|
||||
this.prevRotationYaw = this.rotationYaw;
|
||||
this.rotationYaw = this.movementYaw = generateYaw(frontPos, backPos);
|
||||
this.motionX = this.rotationYaw / 360D; // hijacking this crap for easy syncing
|
||||
this.velocityChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vec3 getRelPosAlongRail(BlockPos anchor, double distanceToCover) {
|
||||
|
||||
float yaw = this.rotationYaw;
|
||||
|
||||
if(distanceToCover < 0) {
|
||||
distanceToCover *= -1;
|
||||
yaw += 180;
|
||||
}
|
||||
|
||||
Vec3 next = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
int it = 0;
|
||||
|
||||
do {
|
||||
|
||||
it++;
|
||||
|
||||
if(it > 30) {
|
||||
worldObj.createExplosion(this, posX, posY, posZ, 5F, false);
|
||||
this.derail();
|
||||
return null;
|
||||
}
|
||||
|
||||
int x = anchor.getX();
|
||||
int y = anchor.getY();
|
||||
int z = anchor.getZ();
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
|
||||
Vec3 rot = Vec3.createVectorHelper(0, 0, 1);
|
||||
rot.rotateAroundY((float) (-yaw * Math.PI / 180D));
|
||||
|
||||
if(block instanceof IRailNTM) {
|
||||
IRailNTM rail = (IRailNTM) block;
|
||||
|
||||
if(it == 1) {
|
||||
next = rail.getTravelLocation(worldObj, x, y, z, next.xCoord, next.yCoord, next.zCoord, rot.xCoord, rot.yCoord, rot.zCoord, 0, new RailContext());
|
||||
}
|
||||
|
||||
boolean flip = distanceToCover < 0;
|
||||
|
||||
if(rail.getGauge(worldObj, x, y, z) == this.getGauge()) {
|
||||
RailContext info = new RailContext();
|
||||
Vec3 prev = next;
|
||||
next = rail.getTravelLocation(worldObj, x, y, z, prev.xCoord, prev.yCoord, prev.zCoord, rot.xCoord, rot.yCoord, rot.zCoord, distanceToCover, info);
|
||||
distanceToCover = info.overshoot;
|
||||
anchor = info.pos;
|
||||
|
||||
yaw = generateYaw(next, prev) * (flip ? -1 : 1);
|
||||
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
} while(distanceToCover != 0); //if there's still length to cover, keep going
|
||||
|
||||
return next;
|
||||
}
|
||||
|
||||
public float generateYaw(Vec3 front, Vec3 back) {
|
||||
double deltaX = front.xCoord - back.xCoord;
|
||||
double deltaZ = front.zCoord - back.zCoord;
|
||||
double radians = -Math.atan2(deltaX, deltaZ);
|
||||
return (float) MathHelper.wrapAngleTo180_double(radians * 180D / Math.PI);
|
||||
}
|
||||
|
||||
/** Returns the amount of blocks that the train should move per tick */
|
||||
public abstract double getCurrentSpeed();
|
||||
/** Returns the gauge of this train */
|
||||
public abstract TrackGauge getGauge();
|
||||
/** Returns the length between the core and one of the bogies */
|
||||
public abstract double getLengthSpan();
|
||||
|
||||
/** Returns the "true" position of the train, i.e. the block it wants to snap to */
|
||||
public BlockPos getCurentAnchorPos() {
|
||||
return new BlockPos(posX, posY, posZ);
|
||||
}
|
||||
|
||||
public void derail() {
|
||||
isOnRail = false;
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double posX, double posY, double posZ, float yaw, float pitch, int turnProg) {
|
||||
this.trainX = posX;
|
||||
this.trainY = posY;
|
||||
this.trainZ = posZ;
|
||||
//this.trainYaw = (double) yaw;
|
||||
this.trainPitch = (double) pitch;
|
||||
this.turnProgress = turnProg + 2;
|
||||
this.motionX = this.velocityX;
|
||||
this.motionY = this.velocityY;
|
||||
this.motionZ = this.velocityZ;
|
||||
this.trainYaw = this.movementYaw;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double mX, double mY, double mZ) {
|
||||
this.movementYaw = (float) this.motionX * 360F;
|
||||
this.velocityX = this.motionX = mX;
|
||||
this.velocityY = this.motionY = mY;
|
||||
this.velocityZ = this.motionZ = mZ;
|
||||
}
|
||||
}
|
||||
141
src/main/java/com/hbm/entity/train/EntityRailCarCargo.java
Normal file
141
src/main/java/com/hbm/entity/train/EntityRailCarCargo.java
Normal file
@ -0,0 +1,141 @@
|
||||
package com.hbm.entity.train;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class EntityRailCarCargo extends EntityRailCarBase implements IInventory {
|
||||
|
||||
protected String entityName;
|
||||
protected ItemStack[] slots = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
public EntityRailCarCargo(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
return slots[slot];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
if(this.slots[slot] != null) {
|
||||
ItemStack itemstack;
|
||||
|
||||
if(this.slots[slot].stackSize <= amount) {
|
||||
itemstack = this.slots[slot];
|
||||
this.slots[slot] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack = this.slots[slot].splitStack(amount);
|
||||
|
||||
if(this.slots[slot].stackSize == 0) {
|
||||
this.slots[slot] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
if(this.slots[slot] != null) {
|
||||
ItemStack itemstack = this.slots[slot];
|
||||
this.slots[slot] = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
this.slots[slot] = stack;
|
||||
|
||||
if(stack != null && stack.stackSize > this.getInventoryStackLimit()) {
|
||||
stack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() { }
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
return this.isDead ? false : player.getDistanceSqToEntity(this) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() { }
|
||||
|
||||
@Override
|
||||
public void closeInventory() { }
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
super.writeEntityToNBT(nbt);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < this.slots.length; ++i) {
|
||||
if(this.slots[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
this.slots[i].writeToNBT(nbttagcompound1);
|
||||
nbttaglist.appendTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
|
||||
nbt.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
NBTTagList nbttaglist = nbt.getTagList("Items", 10);
|
||||
this.slots = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
int j = nbttagcompound1.getByte("Slot") & 255;
|
||||
|
||||
if(j >= 0 && j < this.slots.length) {
|
||||
this.slots[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.entityName != null;
|
||||
}
|
||||
|
||||
public String getEntityName() {
|
||||
return this.entityName;
|
||||
}
|
||||
|
||||
public void setEntityName(String name) {
|
||||
this.entityName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandSenderName() {
|
||||
return this.entityName != null ? this.entityName : super.getCommandSenderName();
|
||||
}
|
||||
}
|
||||
137
src/main/java/com/hbm/entity/train/EntityRailCarRidable.java
Normal file
137
src/main/java/com/hbm/entity/train/EntityRailCarRidable.java
Normal file
@ -0,0 +1,137 @@
|
||||
package com.hbm.entity.train;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class EntityRailCarRidable extends EntityRailCarCargo {
|
||||
|
||||
public SeatDummyEntity[] passengerSeats;
|
||||
|
||||
public EntityRailCarRidable(World world) {
|
||||
super(world);
|
||||
this.passengerSeats = new SeatDummyEntity[this.getPassengerSeats().length];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interactFirst(EntityPlayer player) {
|
||||
|
||||
if(worldObj.isRemote) return true;
|
||||
|
||||
double nearestDist = Double.POSITIVE_INFINITY;
|
||||
int nearestSeat = -1;
|
||||
|
||||
Vec3[] seats = getPassengerSeats();
|
||||
for(int i = 0; i < seats.length; i++) {
|
||||
|
||||
Vec3 seat = seats[i];
|
||||
if(seat == null) continue;
|
||||
if(passengerSeats[i] != null) continue;
|
||||
|
||||
seat.rotateAroundY((float) (-this.rotationYaw * Math.PI / 180));
|
||||
double x = posX + seat.xCoord;
|
||||
double y = posY + seat.yCoord;
|
||||
double z = posZ + seat.zCoord;
|
||||
double dist = Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z).lengthVector();
|
||||
|
||||
if(dist < nearestDist) {
|
||||
nearestDist = dist;
|
||||
nearestSeat = i;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.riddenByEntity == null) {
|
||||
Vec3 seat = getRiderSeatPosition();
|
||||
seat.rotateAroundY((float) (-this.rotationYaw * Math.PI / 180));
|
||||
double x = posX + seat.xCoord;
|
||||
double y = posY + seat.yCoord;
|
||||
double z = posZ + seat.zCoord;
|
||||
double dist = Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z).lengthVector();
|
||||
|
||||
if(dist < nearestDist) {
|
||||
nearestDist = dist;
|
||||
nearestSeat = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(nearestDist > 20) return true;
|
||||
|
||||
if(nearestSeat == -1) {
|
||||
player.mountEntity(this);
|
||||
} else {
|
||||
SeatDummyEntity dummySeat = new SeatDummyEntity(worldObj);
|
||||
Vec3 passengerSeat = this.getPassengerSeats()[nearestSeat];
|
||||
passengerSeat.rotateAroundY((float) (-this.rotationYaw * Math.PI / 180));
|
||||
double x = posX + passengerSeat.xCoord;
|
||||
double y = posY + passengerSeat.yCoord;
|
||||
double z = posZ + passengerSeat.zCoord;
|
||||
dummySeat.setPosition(x, y - 1, z);
|
||||
passengerSeats[nearestSeat] = dummySeat;
|
||||
worldObj.spawnEntityInWorld(dummySeat);
|
||||
player.mountEntity(dummySeat);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
Vec3[] seats = this.getPassengerSeats();
|
||||
for(int i = 0; i < passengerSeats.length; i++) {
|
||||
SeatDummyEntity seat = passengerSeats[i];
|
||||
|
||||
if(seat != null) {
|
||||
if(seat.riddenByEntity == null) {
|
||||
passengerSeats[i] = null;
|
||||
seat.setDead();
|
||||
} else {
|
||||
Vec3 rot = seats[i];
|
||||
rot.rotateAroundY((float) (-this.rotationYaw * Math.PI / 180));
|
||||
double x = posX + rot.xCoord;
|
||||
double y = posY + rot.yCoord;
|
||||
double z = posZ + rot.zCoord;
|
||||
seat.setPosition(x, y - 1, z);
|
||||
seat.updateRiderPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRiderPosition() {
|
||||
|
||||
Vec3 offset = getRiderSeatPosition();
|
||||
offset.rotateAroundY((float) (-this.rotationYaw * Math.PI / 180));
|
||||
|
||||
if(this.riddenByEntity != null) {
|
||||
this.riddenByEntity.setPosition(this.posX + offset.xCoord, this.posY + offset.yCoord, this.posZ + offset.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns a Vec3 showing the relative position from the driver to the core */
|
||||
public abstract Vec3 getRiderSeatPosition();
|
||||
|
||||
public abstract Vec3[] getPassengerSeats();
|
||||
|
||||
public static class SeatDummyEntity extends Entity {
|
||||
public SeatDummyEntity(World world) { super(world); this.setSize(0.5F, 0.1F);}
|
||||
@Override protected void entityInit() { }
|
||||
@Override protected void writeEntityToNBT(NBTTagCompound nbt) { }
|
||||
@Override public boolean writeToNBTOptional(NBTTagCompound nbt) { return false; }
|
||||
@Override public void readEntityFromNBT(NBTTagCompound nbt) { this.setDead(); }
|
||||
|
||||
@Override
|
||||
public void updateRiderPosition() {
|
||||
if(this.riddenByEntity != null) {
|
||||
this.riddenByEntity.setPosition(this.posX, this.posY + 1, this.posZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
124
src/main/java/com/hbm/entity/train/TrainCargoTram.java
Normal file
124
src/main/java/com/hbm/entity/train/TrainCargoTram.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.hbm.entity.train;
|
||||
|
||||
import com.hbm.blocks.rail.IRailNTM.TrackGauge;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TrainCargoTram extends EntityRailCarRidable implements IGUIProvider {
|
||||
|
||||
/*
|
||||
*
|
||||
* _________
|
||||
* | | \ <--
|
||||
* | | |___
|
||||
* | | | | |
|
||||
* _O\|_|_______|__|_____________________________|/O_
|
||||
* |____| |____|
|
||||
* \__________________________________________/
|
||||
* '( + )' '( + )'
|
||||
*
|
||||
*/
|
||||
|
||||
public TrainCargoTram(World world) {
|
||||
super(world);
|
||||
this.setSize(2F, 1F);
|
||||
}
|
||||
|
||||
public double speed = 0;
|
||||
public static final double maxSpeed = 0.5;
|
||||
public static final double acceleration = 0.01;
|
||||
public static final double deceleration = 0.95;
|
||||
|
||||
@Override
|
||||
public double getCurrentSpeed() { // in its current form, only call once per tick
|
||||
|
||||
if(this.riddenByEntity instanceof EntityPlayer) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) this.riddenByEntity;
|
||||
|
||||
if(player.moveForward > 0) {
|
||||
speed += acceleration;
|
||||
} else if(player.moveForward < 0) {
|
||||
speed -= acceleration;
|
||||
} else {
|
||||
speed *= deceleration;
|
||||
}
|
||||
|
||||
} else {
|
||||
speed *= deceleration;
|
||||
}
|
||||
|
||||
speed = MathHelper.clamp_double(speed, -maxSpeed, maxSpeed);
|
||||
|
||||
return speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrackGauge getGauge() {
|
||||
return TrackGauge.STANDARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLengthSpan() {
|
||||
return 1.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getRiderSeatPosition() {
|
||||
return Vec3.createVectorHelper(0.375, 2.25, 0.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
|
||||
if(!this.worldObj.isRemote && !this.isDead) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRiderSit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3[] getPassengerSeats() {
|
||||
return new Vec3[] {
|
||||
Vec3.createVectorHelper(0.5, 1.75, -1.5),
|
||||
Vec3.createVectorHelper(-0.5, 1.75, -1.5)
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 27;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.getEntityName() : "container.trainTram";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
//return new ContainerTrainCargoTram(player.inventory, (TrainCargoTram)player.worldObj.getEntityByID(x));
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
//return new GUITrainCargoTram(player.inventory, (TrainCargoTram) player.worldObj.getEntityByID(x));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -39,10 +39,10 @@ public class ExplosionVNT {
|
||||
//since we want to reduce each effect to the bare minimum (sound, particles, etc. being separate) we definitely need multiple most of the time
|
||||
private IExplosionSFX[] sfx;
|
||||
|
||||
protected World world;
|
||||
protected double posX;
|
||||
protected double posY;
|
||||
protected double posZ;
|
||||
public World world;
|
||||
public double posX;
|
||||
public double posY;
|
||||
public double posZ;
|
||||
public float size;
|
||||
public Entity exploder;
|
||||
|
||||
|
||||
@ -2,7 +2,10 @@ package com.hbm.explosion.vanillant.interfaces;
|
||||
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public interface IBlockMutator {
|
||||
|
||||
public int mutateAtPosition(ExplosionVNT explosion, int x, int y, int z);
|
||||
public void mutatePre(ExplosionVNT explosion, Block block, int meta, int x, int y, int z);
|
||||
public void mutatePost(ExplosionVNT explosion, int x, int y, int z);
|
||||
}
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
package com.hbm.explosion.vanillant.standard;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.interfaces.IBlockAllocator;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAllocatorBulkie implements IBlockAllocator {
|
||||
|
||||
protected double maximum;
|
||||
protected int resolution;
|
||||
|
||||
public BlockAllocatorBulkie(double maximum) {
|
||||
this(maximum, 16);
|
||||
}
|
||||
|
||||
public BlockAllocatorBulkie(double maximum, int resolution) {
|
||||
this.resolution = resolution;
|
||||
this.maximum = maximum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<ChunkPosition> allocate(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
|
||||
|
||||
HashSet<ChunkPosition> affectedBlocks = new HashSet();
|
||||
|
||||
for(int i = 0; i < this.resolution; ++i) {
|
||||
for(int j = 0; j < this.resolution; ++j) {
|
||||
for(int k = 0; k < this.resolution; ++k) {
|
||||
|
||||
if(i == 0 || i == this.resolution - 1 || j == 0 || j == this.resolution - 1 || k == 0 || k == this.resolution - 1) {
|
||||
|
||||
double d0 = (double) ((float) i / ((float) this.resolution - 1.0F) * 2.0F - 1.0F);
|
||||
double d1 = (double) ((float) j / ((float) this.resolution - 1.0F) * 2.0F - 1.0F);
|
||||
double d2 = (double) ((float) k / ((float) this.resolution - 1.0F) * 2.0F - 1.0F);
|
||||
double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
|
||||
|
||||
d0 /= d3;
|
||||
d1 /= d3;
|
||||
d2 /= d3;
|
||||
|
||||
double currentX = x;
|
||||
double currentY = y;
|
||||
double currentZ = z;
|
||||
|
||||
double dist = 0;
|
||||
|
||||
for(float stepSize = 0.3F; dist <= explosion.size;) {
|
||||
|
||||
double deltaX = currentX - x;
|
||||
double deltaY = currentY - y;
|
||||
double deltaZ = currentZ - z;
|
||||
dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
|
||||
|
||||
int blockX = MathHelper.floor_double(currentX);
|
||||
int blockY = MathHelper.floor_double(currentY);
|
||||
int blockZ = MathHelper.floor_double(currentZ);
|
||||
|
||||
Block block = world.getBlock(blockX, blockY, blockZ);
|
||||
|
||||
if(block.getMaterial() != Material.air) {
|
||||
float blockResistance = explosion.exploder != null ? explosion.exploder.func_145772_a(explosion.compat, world, blockX, blockY, blockZ, block) : block.getExplosionResistance(explosion.exploder, world, blockX, blockY, blockZ, x, y, z);
|
||||
if(this.maximum < blockResistance) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(explosion.exploder == null || explosion.exploder.func_145774_a(explosion.compat, world, blockX, blockY, blockZ, block, explosion.size)) {
|
||||
affectedBlocks.add(new ChunkPosition(blockX, blockY, blockZ));
|
||||
}
|
||||
|
||||
currentX += d0 * (double) stepSize;
|
||||
currentY += d1 * (double) stepSize;
|
||||
currentZ += d2 * (double) stepSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return affectedBlocks;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.hbm.explosion.vanillant.standard;
|
||||
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.interfaces.IBlockMutator;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class BlockMutatorBulkie implements IBlockMutator {
|
||||
|
||||
protected MetaBlock metaBlock;
|
||||
|
||||
public BlockMutatorBulkie(Block block) {
|
||||
this(block, 0);
|
||||
}
|
||||
|
||||
public BlockMutatorBulkie(Block block, int meta) {
|
||||
this.metaBlock = new MetaBlock(block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mutatePre(ExplosionVNT explosion, Block block, int meta, int x, int y, int z) {
|
||||
if(!block.isNormalCube()) return;
|
||||
Vec3 vec = Vec3.createVectorHelper(x + 0.5 - explosion.posX, y + 0.5 - explosion.posY, z + 0.5 - explosion.posZ);
|
||||
if(vec.lengthVector() >= explosion.size - 0.5) {
|
||||
explosion.world.setBlock(x, y, z, metaBlock.block, metaBlock.meta, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void mutatePost(ExplosionVNT explosion, int x, int y, int z) { }
|
||||
}
|
||||
@ -63,6 +63,7 @@ public class BlockProcessorStandard implements IBlockProcessor {
|
||||
}
|
||||
|
||||
block.onBlockExploded(world, blockX, blockY, blockZ, explosion.compat);
|
||||
if(this.convert != null) this.convert.mutatePre(explosion, block, world.getBlockMetadata(blockX, blockY, blockZ), blockX, blockY, blockZ);
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +79,7 @@ public class BlockProcessorStandard implements IBlockProcessor {
|
||||
Block block = world.getBlock(blockX, blockY, blockZ);
|
||||
|
||||
if(block.getMaterial() == Material.air) {
|
||||
this.convert.mutateAtPosition(explosion, blockX, blockY, blockZ);
|
||||
this.convert.mutatePost(explosion, blockX, blockY, blockZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,6 +77,14 @@ public class BulletConfigSyncingUtil {
|
||||
public static int G12_SLEEK = i++;
|
||||
public static int G12_PERCUSSION = i++;
|
||||
|
||||
public static int G12HS_NORMAL = i++;
|
||||
public static int G12HS_INCENDIARY = i++;
|
||||
public static int G12HS_SHRAPNEL = i++;
|
||||
public static int G12HS_DU = i++;
|
||||
public static int G12HS_AM = i++;
|
||||
public static int G12HS_SLEEK = i++;
|
||||
public static int G12HS_PERCUSSION = i++;
|
||||
|
||||
public static int LR22_NORMAL = i++;
|
||||
public static int LR22_AP = i++;
|
||||
public static int LR22_NORMAL_FIRE = i++;
|
||||
@ -359,6 +367,13 @@ public class BulletConfigSyncingUtil {
|
||||
configSet.put(G12_AM, Gun12GaugeFactory.get12GaugeAMConfig());
|
||||
configSet.put(G12_SLEEK, Gun12GaugeFactory.get12GaugeSleekConfig());
|
||||
configSet.put(G12_PERCUSSION, Gun12GaugeFactory.get12GaugePercussionConfig());
|
||||
configSet.put(G12HS_NORMAL, Gun12GaugeFactory.get12GaugeConfig().setHeadshot(2F));
|
||||
configSet.put(G12HS_INCENDIARY, Gun12GaugeFactory.get12GaugeFireConfig().setHeadshot(2F));
|
||||
configSet.put(G12HS_SHRAPNEL, Gun12GaugeFactory.get12GaugeShrapnelConfig().setHeadshot(2F));
|
||||
configSet.put(G12HS_DU, Gun12GaugeFactory.get12GaugeDUConfig().setHeadshot(2F));
|
||||
configSet.put(G12HS_AM, Gun12GaugeFactory.get12GaugeAMConfig().setHeadshot(2F));
|
||||
configSet.put(G12HS_SLEEK, Gun12GaugeFactory.get12GaugeSleekConfig().setHeadshot(2F));
|
||||
configSet.put(G12HS_PERCUSSION, Gun12GaugeFactory.get12GaugePercussionConfig().setHeadshot(2F));
|
||||
|
||||
configSet.put(LR22_NORMAL, Gun22LRFactory.get22LRConfig());
|
||||
configSet.put(LR22_AP, Gun22LRFactory.get22LRAPConfig());
|
||||
|
||||
@ -137,6 +137,7 @@ public class BulletConfiguration implements Cloneable {
|
||||
public static final int STYLE_APDS = 14;
|
||||
public static final int STYLE_BLADE = 15;
|
||||
public static final int STYLE_BARREL = 16;
|
||||
public static final int STYLE_TAU = 17;
|
||||
|
||||
public static final int PLINK_NONE = 0;
|
||||
public static final int PLINK_BULLET = 1;
|
||||
|
||||
@ -52,6 +52,7 @@ public class GunConfiguration implements Cloneable {
|
||||
public String reloadSound = "";
|
||||
//sound path to the shooting sound
|
||||
public String firingSound = "";
|
||||
public float firingVolume = 1.0F;
|
||||
public float firingPitch = 1.0F;
|
||||
//whether the reload sound should be played at the beginning or at the end of the reload
|
||||
public boolean reloadSoundEnd = true;
|
||||
|
||||
@ -48,6 +48,44 @@ public class Gun12GaugeFactory {
|
||||
|
||||
CASING12GAUGE = new SpentCasing(CasingType.SHOTGUN).setScale(1.5F).setBounceMotion(0.05F, 0.02F).setupSmoke(0.5F, 0.5D, 60, 20);
|
||||
}
|
||||
|
||||
public static GunConfiguration getRemington870Config() {
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
|
||||
config.rateOfFire = 25;
|
||||
config.roundsPerCycle = 1;
|
||||
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||
config.reloadDuration = 10;
|
||||
config.firingDuration = 5;
|
||||
config.ammoCap = 5;
|
||||
config.durability = 1000;
|
||||
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
||||
config.allowsInfinity = true;
|
||||
config.crosshair = Crosshair.CIRCLE;
|
||||
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||
config.firingSound = "hbm:weapon.shotgunPump";
|
||||
|
||||
config.name = "remington870";
|
||||
config.manufacturer = EnumGunManufacturer.REMINGTON;
|
||||
|
||||
config.config = HbmCollection.g12hs;
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL_TRANSLATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -2, 100))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
)
|
||||
.addBus("PUMP", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 450))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -1.8, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
)
|
||||
);
|
||||
|
||||
config.ejector = EJECTOR_SPAS;
|
||||
return config;
|
||||
}
|
||||
|
||||
public static GunConfiguration getSpas12Config() {
|
||||
|
||||
@ -109,7 +147,7 @@ public class Gun12GaugeFactory {
|
||||
config.firingSound = "hbm:weapon.shotgunPump";
|
||||
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
||||
|
||||
config.config = HbmCollection.g12;
|
||||
config.config = HbmCollection.g12hs;
|
||||
|
||||
config.ejector = EJECTOR_SPAS_ALT;
|
||||
|
||||
@ -137,7 +175,7 @@ public class Gun12GaugeFactory {
|
||||
config.name = "uboinik";
|
||||
config.manufacturer = EnumGunManufacturer.METRO;
|
||||
|
||||
config.config = HbmCollection.g12;
|
||||
config.config = HbmCollection.g12hs;
|
||||
|
||||
config.ejector = EJECTOR_UBOINIK;
|
||||
|
||||
@ -190,7 +228,7 @@ public class Gun12GaugeFactory {
|
||||
config.manufacturer = EnumGunManufacturer.UAC;
|
||||
config.comment.add("God-damned ARCH-VILES!");
|
||||
|
||||
config.config = HbmCollection.g12;
|
||||
config.config = HbmCollection.g12hs;
|
||||
|
||||
config.ejector = EJECTOR_SSG;
|
||||
|
||||
@ -346,5 +384,4 @@ public class Gun12GaugeFactory {
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,10 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class GunGaussFactory {
|
||||
@ -25,9 +29,10 @@ public class GunGaussFactory {
|
||||
config.ammoCap = 0;
|
||||
config.reloadType = GunConfiguration.RELOAD_NONE;
|
||||
config.allowsInfinity = true;
|
||||
config.crosshair = Crosshair.L_RAD;
|
||||
config.durability = 6000;
|
||||
config.crosshair = Crosshair.CIRCLE;
|
||||
config.durability = 15000;
|
||||
config.firingSound = "hbm:weapon.tauShoot";
|
||||
config.firingVolume = 0.5F;
|
||||
|
||||
config.name = "tau";
|
||||
config.manufacturer = EnumGunManufacturer.BLACK_MESA;
|
||||
@ -35,6 +40,13 @@ public class GunGaussFactory {
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.add(BulletConfigSyncingUtil.SPECIAL_GAUSS);
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
)
|
||||
);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -63,10 +75,9 @@ public class GunGaussFactory {
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.gun_xvl1456_ammo);
|
||||
bullet.dmgMin = 6;
|
||||
bullet.dmgMax = 9;
|
||||
bullet.trail = 1;
|
||||
bullet.vPFX = "fireworksSpark";
|
||||
bullet.dmgMin = 18;
|
||||
bullet.dmgMax = 27;
|
||||
bullet.style = bullet.STYLE_TAU;
|
||||
bullet.LBRC = 80;
|
||||
bullet.HBRC = 5;
|
||||
|
||||
@ -77,7 +88,7 @@ public class GunGaussFactory {
|
||||
|
||||
BulletConfiguration bullet = getGaussConfig();
|
||||
|
||||
bullet.vPFX = "reddust";
|
||||
bullet.trail = 1;
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
16
src/main/java/com/hbm/handler/nei/CokingHandler.java
Normal file
16
src/main/java/com/hbm/handler/nei/CokingHandler.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.CokerRecipes;
|
||||
|
||||
public class CokingHandler extends NEIUniversalHandler {
|
||||
|
||||
public CokingHandler() {
|
||||
super("Coking", ModBlocks.machine_coker, CokerRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmCoking";
|
||||
}
|
||||
}
|
||||
@ -553,6 +553,7 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("dyeGray", fromOne(oil_tar, EnumTarType.COAL));
|
||||
OreDictionary.registerOre("dyeBrown", fromOne(oil_tar, EnumTarType.WOOD));
|
||||
OreDictionary.registerOre("dyeCyan", fromOne(oil_tar, EnumTarType.WAX));
|
||||
OreDictionary.registerOre("dyeWhite", fromOne(oil_tar, EnumTarType.PARAFFIN));
|
||||
OreDictionary.registerOre("dye", new ItemStack(oil_tar, 1, OreDictionary.WILDCARD_VALUE));
|
||||
OreDictionary.registerOre("dyeOrange", powder_cadmium);
|
||||
OreDictionary.registerOre("dye", powder_cadmium);
|
||||
|
||||
@ -9,7 +9,6 @@ import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -55,11 +54,6 @@ public class ContainerMachineCatalyticReformer extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCoker;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineCoker extends Container {
|
||||
|
||||
private TileEntityMachineCoker coker;
|
||||
|
||||
public ContainerMachineCoker(InventoryPlayer invPlayer, TileEntityMachineCoker tedf) {
|
||||
|
||||
coker = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 35, 72));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 1, 97, 27));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 1) {
|
||||
if(!this.mergeItemStack(var5, 2, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(var3.getItem() instanceof IItemFluidIdentifier) {
|
||||
if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return coker.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import com.hbm.inventory.fluid.trait.*;
|
||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.*;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
||||
@ -123,6 +124,12 @@ public class Fluids {
|
||||
public static FluidType PHOSGENE;
|
||||
public static FluidType MUSTARDGAS;
|
||||
public static FluidType IONGEL;
|
||||
public static FluidType OIL_COKER; //heavy fractions from coking, mostly bitumen
|
||||
public static FluidType NAPHTHA_COKER; //medium fractions from coking, aromatics and fuel oil
|
||||
public static FluidType GAS_COKER; //light fractions from coking, natgas and co2
|
||||
public static FluidType EGG;
|
||||
public static FluidType CHOLESTEROL;
|
||||
public static FluidType ESTRADIOL;
|
||||
|
||||
private static final HashMap<Integer, FluidType> idMapping = new HashMap();
|
||||
private static final HashMap<String, FluidType> nameMapping = new HashMap();
|
||||
@ -257,7 +264,13 @@ public class Fluids {
|
||||
COLLOID = new FluidType("COLLOID", 0x787878, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
PHOSGENE = new FluidType("PHOSGENE", 0xCFC4A4, 4, 0, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xCFC4A4, 0x361414)).addTraits(GASEOUS);
|
||||
MUSTARDGAS = new FluidType("MUSTARDGAS", 0xBAB572, 4, 1, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xBAB572, 0x361414)).addTraits(GASEOUS);
|
||||
IONGEL = new FluidType(103, "IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
IONGEL = new FluidType("IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
OIL_COKER = new FluidType("OIL_COKER", 0x001802, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
NAPHTHA_COKER = new FluidType("NAPHTHA_COKER", 0x495944, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
GAS_COKER = new FluidType("GAS_COKER", 0xDEF4CA, 1, 4, 0, EnumSymbol.NONE).addTraits(GASEOUS);
|
||||
EGG = new FluidType("EGG", 0xD2C273, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
CHOLESTEROL = new FluidType("CHOLESTEROL", 0xD6D2BD, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
ESTRADIOL = new FluidType(109, "ESTRADIOL", 0xCDD5D8, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^
|
||||
//ADD NEW FLUIDS HERE
|
||||
@ -298,12 +311,14 @@ public class Fluids {
|
||||
metaOrder.add(OIL);
|
||||
metaOrder.add(CRACKOIL);
|
||||
metaOrder.add(COALOIL);
|
||||
metaOrder.add(OIL_COKER);
|
||||
metaOrder.add(HOTOIL);
|
||||
metaOrder.add(HOTCRACKOIL);
|
||||
metaOrder.add(HEAVYOIL);
|
||||
metaOrder.add(HEAVYOIL_VACUUM);
|
||||
metaOrder.add(NAPHTHA);
|
||||
metaOrder.add(NAPHTHA_CRACK);
|
||||
metaOrder.add(NAPHTHA_COKER);
|
||||
metaOrder.add(REFORMATE);
|
||||
metaOrder.add(LIGHTOIL);
|
||||
metaOrder.add(LIGHTOIL_CRACK);
|
||||
@ -315,6 +330,7 @@ public class Fluids {
|
||||
metaOrder.add(RECLAIMED);
|
||||
metaOrder.add(LUBRICANT);
|
||||
metaOrder.add(GAS);
|
||||
metaOrder.add(GAS_COKER);
|
||||
metaOrder.add(PETROLEUM);
|
||||
metaOrder.add(SOURGAS);
|
||||
metaOrder.add(LPG);
|
||||
@ -360,11 +376,14 @@ public class Fluids {
|
||||
metaOrder.add(PAIN);
|
||||
metaOrder.add(DEATH);
|
||||
metaOrder.add(WATZ);
|
||||
metaOrder.add(EGG);
|
||||
metaOrder.add(CHOLESTEROL);
|
||||
//solutions and working fluids
|
||||
metaOrder.add(FRACKSOL);
|
||||
//the fun guys
|
||||
metaOrder.add(PHOSGENE);
|
||||
metaOrder.add(MUSTARDGAS);
|
||||
metaOrder.add(ESTRADIOL);
|
||||
//antimatter
|
||||
metaOrder.add(AMAT);
|
||||
metaOrder.add(ASCHRAB);
|
||||
@ -386,6 +405,7 @@ public class Fluids {
|
||||
PHOSGENE.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 4F, 20, HazardClass.GAS_CHLORINE, false)));
|
||||
MUSTARDGAS.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 4F, 10, HazardClass.GAS_CORROSIVE, false))
|
||||
.addEntry(new ToxinEffects(HazardClass.GAS_CORROSIVE, true).add(new PotionEffect(Potion.wither.id, 100, 1), new PotionEffect(Potion.confusion.id, 100, 0))));
|
||||
ESTRADIOL.addTraits(new FT_Toxin().addEntry(new ToxinEffects(HazardClass.PARTICLE_FINE, false).add(new PotionEffect(HbmPotion.death.id, 60 * 60 * 20, 0))));
|
||||
|
||||
double eff_steam_boil = 1.0D;
|
||||
double eff_steam_heatex = 0.25D;
|
||||
@ -437,6 +457,7 @@ public class Fluids {
|
||||
double complexityRefinery = 1.1D;
|
||||
double complexityFraction = 1.05D;
|
||||
double complexityCracking = 1.25D;
|
||||
double complexityCoker = 1.25D;
|
||||
double complexityChemplant = 1.1D;
|
||||
double complexityLubed = 1.15D;
|
||||
double complexityLeaded = 1.5D;
|
||||
@ -449,7 +470,9 @@ public class Fluids {
|
||||
/// the allmighty excel spreadsheet has spoken! ///
|
||||
registerCalculatedFuel(OIL, (baseline / 1D * flammabilityLow * demandLow), 0, null);
|
||||
registerCalculatedFuel(CRACKOIL, (baseline / 1D * flammabilityLow * demandLow * complexityCracking), 0, null);
|
||||
registerCalculatedFuel(OIL_COKER, (baseline / 1D * flammabilityLow * demandLow * complexityCoker), 0, null);
|
||||
registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 1.25, FuelGrade.GAS);
|
||||
registerCalculatedFuel(GAS_COKER, (baseline / 1D * flammabilityNormal * demandVeryLow * complexityCoker), 1.25, FuelGrade.GAS);
|
||||
registerCalculatedFuel(HEAVYOIL, (baseline / 0.5 * flammabilityLow * demandLow * complexityRefinery), 1.25D, FuelGrade.LOW);
|
||||
registerCalculatedFuel(SMEAR, (baseline / 0.35 * flammabilityLow * demandLow * complexityRefinery * complexityFraction), 1.25D, FuelGrade.LOW);
|
||||
registerCalculatedFuel(RECLAIMED, (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant), 1.25D, FuelGrade.LOW);
|
||||
@ -458,6 +481,7 @@ public class Fluids {
|
||||
registerCalculatedFuel(HEATINGOIL, (baseline / 0.31 * flammabilityNormal * demandLow * complexityRefinery * complexityFraction * complexityFraction), 1.25D, FuelGrade.LOW);
|
||||
registerCalculatedFuel(NAPHTHA, (baseline / 0.25 * flammabilityLow * demandLow * complexityRefinery), 1.5D, FuelGrade.MEDIUM);
|
||||
registerCalculatedFuel(NAPHTHA_CRACK, (baseline / 0.40 * flammabilityLow * demandLow * complexityRefinery * complexityCracking), 1.5D, FuelGrade.MEDIUM);
|
||||
registerCalculatedFuel(NAPHTHA_COKER, (baseline / 0.25 * flammabilityLow * demandLow * complexityCoker), 1.5D, FuelGrade.MEDIUM);
|
||||
registerCalculatedFuel(GASOLINE, (baseline / 0.20 * flammabilityNormal * demandLow * complexityRefinery * complexityChemplant), 2.5D, FuelGrade.HIGH);
|
||||
registerCalculatedFuel(GASOLINE_LEADED, (baseline / 0.20 * flammabilityNormal * demandLow * complexityRefinery * complexityChemplant * complexityLeaded), 2.5D, FuelGrade.HIGH);
|
||||
registerCalculatedFuel(DIESEL, (baseline / 0.21 * flammabilityNormal * demandLow * complexityRefinery * complexityFraction), 2.5D, FuelGrade.HIGH);
|
||||
|
||||
61
src/main/java/com/hbm/inventory/gui/GUIMachineCoker.java
Normal file
61
src/main/java/com/hbm/inventory/gui/GUIMachineCoker.java
Normal file
@ -0,0 +1,61 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineCoker;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCoker;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineCoker extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_coker.png");
|
||||
private TileEntityMachineCoker refinery;
|
||||
|
||||
public GUIMachineCoker(InventoryPlayer invPlayer, TileEntityMachineCoker tedf) {
|
||||
super(new ContainerMachineCoker(invPlayer, tedf));
|
||||
refinery = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float f) {
|
||||
super.drawScreen(x, y, f);
|
||||
|
||||
refinery.tanks[0].renderTankInfo(this, x, y, guiLeft + 35, guiTop + 18, 16, 52);
|
||||
refinery.tanks[1].renderTankInfo(this, x, y, guiLeft + 125, guiTop + 18, 16, 52);
|
||||
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 45, 54, 7, x, y, new String[] { String.format("%,d", refinery.progress) + " / " + String.format("%,d", refinery.processTime) + "TU" });
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 54, 54, 7, x, y, new String[] { String.format("%,d", refinery.heat) + " / " + String.format("%,d", refinery.maxHeat) + "TU" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.refinery.hasCustomInventoryName() ? this.refinery.getInventoryName() : I18n.format(this.refinery.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xC7C1A3);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int p = refinery.progress * 53 / refinery.processTime;
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 46, 176, 0, p, 5);
|
||||
|
||||
int h = refinery.heat * 52 / refinery.maxHeat;
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 55, 176, 5, h, 5);
|
||||
|
||||
refinery.tanks[0].renderTank(guiLeft + 35, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[1].renderTank(guiLeft + 125, guiTop + 70, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
@ -1,18 +1,5 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
@ -21,7 +8,6 @@ import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
@ -33,7 +19,6 @@ import com.hbm.items.machine.ItemDrillbit.EnumDrillType;
|
||||
import com.hbm.items.machine.ItemPistons.EnumPistonType;
|
||||
import com.hbm.items.weapon.ItemAmmoHIMARS;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -42,6 +27,15 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
public class AssemblerRecipes {
|
||||
|
||||
public static File config;
|
||||
@ -285,6 +279,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_well, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 20), new ComparableStack(ModBlocks.steel_beam, 8), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.pipes_steel, 3), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.wire_red_copper, 6), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_pumpjack, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 8), new OreDictStack(STEEL.block(), 8), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.tank_steel, 4), new OreDictStack(STEEL.ingot(), 24), new OreDictStack(STEEL.plate(), 16), new OreDictStack(AL.plate(), 6), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.wire_red_copper, 8), },400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_flare, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 4), new ComparableStack(ModItems.tank_steel, 1), new ComparableStack(ModBlocks.deco_pipe_quad, 8), new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(ModItems.thermo_element, 3), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_coker, 1), new AStack[] {new OreDictStack(STEEL.plate(), 24), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 8), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.steel_grate, 4) },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_refinery, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 16), new OreDictStack(CU.plate(), 16), new ComparableStack(ModItems.hull_big_steel, 6), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.plate_polymer, 8), new ComparableStack(ModItems.circuit_red_copper, 1) },350);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_epress, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new ComparableStack(ModItems.plate_polymer, 4), new ComparableStack(ModItems.bolt_tungsten, 4), new ComparableStack(ModItems.coil_copper, 2), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_copper, 1), new ComparableStack(ModItems.canister_full, 1, Fluids.LUBRICANT.getID()), },160);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_chemplant, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(CU.plate528(), 6), new ComparableStack(ModItems.tank_steel, 4), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.coil_tungsten, 3), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.plate_polymer, 8), },200);
|
||||
|
||||
149
src/main/java/com/hbm/inventory/recipes/CokerRecipes.java
Normal file
149
src/main/java/com/hbm/inventory/recipes/CokerRecipes.java
Normal file
@ -0,0 +1,149 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import static com.hbm.inventory.fluid.Fluids.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.trait.FT_Combustible;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CokerRecipes extends SerializableRecipe {
|
||||
|
||||
private static HashMap<FluidType, Triplet<Integer, ItemStack, FluidStack>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
registerAuto(HEAVYOIL, OIL_COKER);
|
||||
registerAuto(HEAVYOIL_VACUUM, REFORMATE);
|
||||
registerAuto(COALCREOSOTE, NAPHTHA_COKER);
|
||||
registerAuto(SMEAR, OIL_COKER);
|
||||
registerAuto(HEATINGOIL, OIL_COKER);
|
||||
registerAuto(HEATINGOIL_VACUUM, OIL_COKER);
|
||||
registerAuto(RECLAIMED, NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA, NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA_CRACK, NAPHTHA_COKER);
|
||||
registerAuto(DIESEL, NAPHTHA_COKER);
|
||||
registerAuto(DIESEL_REFORM, NAPHTHA_COKER);
|
||||
registerAuto(DIESEL_CRACK, GAS_COKER);
|
||||
registerAuto(DIESEL_CRACK_REFORM, GAS_COKER);
|
||||
registerAuto(LIGHTOIL, GAS_COKER);
|
||||
registerAuto(LIGHTOIL_CRACK, GAS_COKER);
|
||||
registerAuto(LIGHTOIL_VACUUM, GAS_COKER);
|
||||
registerAuto(BIOFUEL, GAS_COKER);
|
||||
registerAuto(AROMATICS, GAS_COKER);
|
||||
registerAuto(REFORMATE, GAS_COKER);
|
||||
registerAuto(XYLENE, GAS_COKER);
|
||||
|
||||
registerSFAuto(WOODOIL, 340_000L, new ItemStack(Items.coal, 1, 1), GAS_COKER);
|
||||
|
||||
registerRecipe(WATZ, 4_000, new ItemStack(ModItems.ingot_mud, 4), null);
|
||||
registerRecipe(BITUMEN, 16_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_600));
|
||||
registerRecipe(LUBRICANT, 12_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_200));
|
||||
}
|
||||
|
||||
private static void registerAuto(FluidType fluid, FluidType type) {
|
||||
registerSFAuto(fluid, 820_000L, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), type); //3200 burntime * 1.25 burntime bonus * 200 TU/t + 20000TU per operation
|
||||
}
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, ItemStack fuel, FluidType type) {
|
||||
long tuFlammable = fluid.hasTrait(FT_Flammable.class) ? fluid.getTrait(FT_Flammable.class).getHeatEnergy() : 0;
|
||||
long tuCombustible = fluid.hasTrait(FT_Combustible.class) ? fluid.getTrait(FT_Combustible.class).getCombustionEnergy() : 0;
|
||||
|
||||
long tuPerBucket = Math.max(tuFlammable, tuCombustible);
|
||||
|
||||
double penalty = 1;//1.1D; //no penalty
|
||||
|
||||
int mB = (int) (tuPerSF * 1000L * penalty / tuPerBucket);
|
||||
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
FluidStack byproduct = type == null ? null : new FluidStack(type, Math.max(10, mB / 10));
|
||||
|
||||
registerRecipe(fluid, mB, fuel, byproduct);
|
||||
}
|
||||
private static void registerRecipe(FluidType type, int quantity, ItemStack output, FluidStack byproduct) {
|
||||
recipes.put(type, new Triplet(quantity, output, byproduct));
|
||||
}
|
||||
|
||||
public static Triplet<Integer, ItemStack, FluidStack> getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
public static HashMap<ItemStack, ItemStack[]> getRecipes() {
|
||||
|
||||
HashMap<ItemStack, ItemStack[]> recipes = new HashMap<ItemStack, ItemStack[]>();
|
||||
|
||||
for(Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>> entry : CokerRecipes.recipes.entrySet()) {
|
||||
|
||||
FluidType type = entry.getKey();
|
||||
int amount = entry.getValue().getX();
|
||||
ItemStack out = entry.getValue().getY().copy();
|
||||
FluidStack byproduct = entry.getValue().getZ();
|
||||
|
||||
|
||||
if(out != null && byproduct != null) recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {out, ItemFluidIcon.make(byproduct)});
|
||||
if(out != null && byproduct == null) recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {out});
|
||||
if(out == null && byproduct != null) recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {ItemFluidIcon.make(byproduct)});
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCoker.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
FluidStack in = this.readFluidStack(obj.get("input").getAsJsonArray());
|
||||
ItemStack out = obj.has("output") ? this.readItemStack(obj.get("output").getAsJsonArray()) : null;
|
||||
FluidStack byproduct = obj.has("byproduct") ? this.readFluidStack(obj.get("byproduct").getAsJsonArray()) : null;
|
||||
recipes.put(in.type, new Triplet(in.fill, out, byproduct));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>> rec = (Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>>) recipe;
|
||||
FluidStack in = new FluidStack(rec.getKey(), rec.getValue().getX());
|
||||
writer.name("input");
|
||||
this.writeFluidStack(in, writer);
|
||||
if(rec.getValue().getY() != null) {
|
||||
writer.name("output");
|
||||
this.writeItemStack(rec.getValue().getY(), writer);
|
||||
}
|
||||
if(rec.getValue().getZ() != null) {
|
||||
writer.name("byproduct");
|
||||
this.writeFluidStack(rec.getValue().getZ(), writer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -134,9 +134,10 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(CU.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 4), 20), woodOil);
|
||||
registerRecipe(CO.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE, 4), 20), woodOil);
|
||||
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 100));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX)), new CrystallizerRecipe(new ItemStack(ModItems.pellet_charged), 200), new FluidStack(Fluids.IONGEL, 500));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 100));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX)), new CrystallizerRecipe(new ItemStack(ModItems.pellet_charged), 200), new FluidStack(Fluids.IONGEL, 500));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)), new CrystallizerRecipe(new ItemStack(ModItems.pill_red), 200), new FluidStack(Fluids.ESTRADIOL, 250));
|
||||
|
||||
registerRecipe(KEY_SAND, new CrystallizerRecipe(Blocks.clay, 20), new FluidStack(Fluids.COLLOID, 1_000));
|
||||
|
||||
|
||||
@ -47,18 +47,22 @@ public class FractionRecipes extends SerializableRecipe {
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, heavy_frac_bitu), new FluidStack(Fluids.SMEAR, heavy_frac_smear)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, smear_frac_heat), new FluidStack(Fluids.LUBRICANT, smear_frac_lube)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, napht_frac_heat), new FluidStack(Fluids.DIESEL, napht_frac_diesel)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, ncrack_frac_heat), new FluidStack(Fluids.DIESEL_CRACK, ncrack_frac_diesel)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, light_frac_diesel), new FluidStack(Fluids.KEROSENE, light_frac_kero)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, lcrack_frac_kero), new FluidStack(Fluids.PETROLEUM, lcrack_frac_petro)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, coal_frac_coalgas), new FluidStack(Fluids.OIL, coal_frac_oil)));
|
||||
fractions.put(Fluids.COALCREOSOTE, new Pair(new FluidStack(Fluids.COALOIL, creo_frac_coaloil), new FluidStack(Fluids.BITUMEN, creo_frac_bitu)));
|
||||
fractions.put(Fluids.HEAVYOIL_VACUUM, new Pair(new FluidStack(Fluids.SMEAR, hvac_frac_smear), new FluidStack(Fluids.HEATINGOIL_VACUUM, hvac_frac_heat)));
|
||||
fractions.put(Fluids.REFORMATE, new Pair(new FluidStack(Fluids.AROMATICS, reform_frac_arom), new FluidStack(Fluids.XYLENE, reform_frac_xyle)));
|
||||
fractions.put(Fluids.LIGHTOIL_VACUUM, new Pair(new FluidStack(Fluids.KEROSENE, lvac_frac_kero), new FluidStack(Fluids.REFORMGAS, lvac_frac_gas)));
|
||||
fractions.put(Fluids.SOURGAS, new Pair(new FluidStack(Fluids.GAS, 30), new FluidStack(Fluids.PETROLEUM, 20)));
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, heavy_frac_bitu), new FluidStack(Fluids.SMEAR, heavy_frac_smear)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, smear_frac_heat), new FluidStack(Fluids.LUBRICANT, smear_frac_lube)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, napht_frac_heat), new FluidStack(Fluids.DIESEL, napht_frac_diesel)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, ncrack_frac_heat), new FluidStack(Fluids.DIESEL_CRACK, ncrack_frac_diesel)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, light_frac_diesel), new FluidStack(Fluids.KEROSENE, light_frac_kero)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, lcrack_frac_kero), new FluidStack(Fluids.PETROLEUM, lcrack_frac_petro)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, coal_frac_coalgas), new FluidStack(Fluids.OIL, coal_frac_oil)));
|
||||
fractions.put(Fluids.COALCREOSOTE, new Pair(new FluidStack(Fluids.COALOIL, creo_frac_coaloil), new FluidStack(Fluids.BITUMEN, creo_frac_bitu)));
|
||||
fractions.put(Fluids.HEAVYOIL_VACUUM, new Pair(new FluidStack(Fluids.SMEAR, hvac_frac_smear), new FluidStack(Fluids.HEATINGOIL_VACUUM, hvac_frac_heat)));
|
||||
fractions.put(Fluids.REFORMATE, new Pair(new FluidStack(Fluids.AROMATICS, reform_frac_arom), new FluidStack(Fluids.XYLENE, reform_frac_xyle)));
|
||||
fractions.put(Fluids.LIGHTOIL_VACUUM, new Pair(new FluidStack(Fluids.KEROSENE, lvac_frac_kero), new FluidStack(Fluids.REFORMGAS, lvac_frac_gas)));
|
||||
fractions.put(Fluids.SOURGAS, new Pair(new FluidStack(Fluids.GAS, 30), new FluidStack(Fluids.PETROLEUM, 20)));
|
||||
fractions.put(Fluids.EGG, new Pair(new FluidStack(Fluids.CHOLESTEROL, 50), new FluidStack(Fluids.RADIOSOLVENT, 50)));
|
||||
fractions.put(Fluids.OIL_COKER, new Pair(new FluidStack(Fluids.CRACKOIL, 30), new FluidStack(Fluids.HEATINGOIL, 70)));
|
||||
fractions.put(Fluids.NAPHTHA_COKER, new Pair(new FluidStack(Fluids.NAPHTHA_CRACK, 75), new FluidStack(Fluids.LIGHTOIL_CRACK, 25)));
|
||||
fractions.put(Fluids.GAS_COKER, new Pair(new FluidStack(Fluids.AROMATICS, 25), new FluidStack(Fluids.CARBONDIOXIDE, 75)));
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {
|
||||
|
||||
@ -21,6 +21,8 @@ import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
public class MixerRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<FluidType, MixerRecipe> recipes = new HashMap();
|
||||
@ -37,6 +39,7 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
recipes.put(Fluids.PHOSGENE, new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.UNSATURATEDS, 500)).setStack2(new FluidStack(Fluids.CHLORINE, 500)));
|
||||
recipes.put(Fluids.MUSTARDGAS, new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.REFORMGAS, 750)).setStack2(new FluidStack(Fluids.CHLORINE, 250)).setSolid(new OreDictStack(S.dust())));
|
||||
recipes.put(Fluids.IONGEL, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.WATER, 1000)).setStack2(new FluidStack(Fluids.HYDROGEN, 200)).setSolid(new ComparableStack(ModItems.pellet_charged)));
|
||||
recipes.put(Fluids.EGG, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.RADIOSOLVENT, 500)).setSolid(new ComparableStack(Items.egg)));
|
||||
|
||||
recipes.put(Fluids.SOLVENT, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.NAPHTHA, 500)).setStack2(new FluidStack(Fluids.AROMATICS, 500)));
|
||||
recipes.put(Fluids.SULFURIC_ACID, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.ACID, 800)).setSolid(new OreDictStack(S.dust())));
|
||||
|
||||
@ -42,6 +42,11 @@ public class ReformingRecipes extends SerializableRecipe {
|
||||
new FluidStack(Fluids.PETROLEUM, 10),
|
||||
new FluidStack(Fluids.HYDROGEN, 15)
|
||||
));
|
||||
recipes.put(Fluids.CHOLESTEROL, new Triplet(
|
||||
new FluidStack(Fluids.ESTRADIOL, 50),
|
||||
new FluidStack(Fluids.REFORMGAS, 35),
|
||||
new FluidStack(Fluids.HYDROGEN, 15)
|
||||
));
|
||||
}
|
||||
|
||||
public static Triplet<FluidStack, FluidStack, FluidStack> getOutput(FluidType type) {
|
||||
|
||||
@ -35,7 +35,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
public static final int SF_HEATING = 50;
|
||||
public static final int SF_RECLAIMED = 100;
|
||||
public static final int SF_PETROIL = 125;
|
||||
public static final int SF_LUBE = 125;
|
||||
public static final int SF_LUBE = 100;
|
||||
public static final int SF_NAPH = 150;
|
||||
public static final int SF_DIESEL = 200;
|
||||
public static final int SF_LIGHT = 225;
|
||||
@ -76,6 +76,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerRecipe(BITUMEN, SF_BITUMEN, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE));
|
||||
registerRecipe(COALCREOSOTE, SF_CREOSOTE, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL));
|
||||
registerRecipe(WOODOIL, SF_WOOD, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WOOD));
|
||||
registerRecipe(LUBRICANT, SF_LUBE, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN));
|
||||
|
||||
registerRecipe(BALEFIRE, 250, ModItems.solid_fuel_bf);
|
||||
|
||||
@ -94,13 +95,13 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerSFAuto(LIGHTOIL_CRACK);
|
||||
registerSFAuto(LIGHTOIL_VACUUM);
|
||||
registerSFAuto(KEROSENE);
|
||||
registerSFAuto(GAS);
|
||||
//registerSFAuto(GAS);
|
||||
registerSFAuto(SOURGAS);
|
||||
registerSFAuto(REFORMGAS);
|
||||
registerSFAuto(SYNGAS);
|
||||
registerSFAuto(PETROLEUM);
|
||||
registerSFAuto(LPG);
|
||||
registerSFAuto(BIOGAS);
|
||||
//registerSFAuto(BIOGAS);
|
||||
registerSFAuto(BIOFUEL);
|
||||
registerSFAuto(AROMATICS);
|
||||
registerSFAuto(UNSATURATEDS);
|
||||
@ -111,7 +112,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
}
|
||||
|
||||
private static void registerSFAuto(FluidType fluid) {
|
||||
registerSFAuto(fluid, 144000L, ModItems.solid_fuel); //3200 burntime * 1.5 burntime bonus * 300 TU/t
|
||||
registerSFAuto(fluid, 1_440_000L, ModItems.solid_fuel); //3200 burntime * 1.5 burntime bonus * 300 TU/t
|
||||
}
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, Item fuel) {
|
||||
long tuPerBucket = fluid.getTrait(FT_Flammable.class).getHeatEnergy();
|
||||
|
||||
@ -53,6 +53,7 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new ReformingRecipes());
|
||||
recipeHandlers.add(new LiquefactionRecipes());
|
||||
recipeHandlers.add(new SolidificationRecipes());
|
||||
recipeHandlers.add(new CokerRecipes());
|
||||
recipeHandlers.add(new BreederRecipes());
|
||||
recipeHandlers.add(new CyclotronRecipes());
|
||||
recipeHandlers.add(new HadronRecipes());
|
||||
|
||||
@ -7,8 +7,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IAnimatedItem {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BusAnimation getAnimation(NBTTagCompound data, ItemStack stack);
|
||||
}
|
||||
|
||||
@ -19,7 +19,8 @@ public class ItemEnums {
|
||||
CRACK,
|
||||
COAL,
|
||||
WOOD,
|
||||
WAX
|
||||
WAX,
|
||||
PARAFFIN
|
||||
}
|
||||
|
||||
public static enum EnumBriquetteType {
|
||||
|
||||
@ -949,6 +949,7 @@ public class ModItems {
|
||||
public static Item med_bag;
|
||||
public static Item pill_iodine;
|
||||
public static Item plan_c;
|
||||
public static Item pill_red;
|
||||
public static Item stealth_boy;
|
||||
public static Item gas_mask_filter;
|
||||
public static Item gas_mask_filter_mono;
|
||||
@ -1545,6 +1546,7 @@ public class ModItems {
|
||||
public static Item gun_uzi_saturnite;
|
||||
public static Item gun_uzi_saturnite_silencer;
|
||||
public static Item gun_uboinik;
|
||||
public static Item gun_remington;
|
||||
public static Item gun_spas12;
|
||||
public static Item gun_supershotgun;
|
||||
public static Item gun_ks23;
|
||||
@ -3312,6 +3314,7 @@ public class ModItems {
|
||||
five_htp = new ItemPill(0).setUnlocalizedName("five_htp").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":5htp");
|
||||
pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine");
|
||||
plan_c = new ItemPill(0).setUnlocalizedName("plan_c").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plan_c");
|
||||
pill_red = new ItemPill(0).setUnlocalizedName("pill_red").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_red");
|
||||
stealth_boy = new ItemStarterKit().setUnlocalizedName("stealth_boy").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":stealth_boy");
|
||||
gas_mask_filter = new ItemFilter().setUnlocalizedName("gas_mask_filter").setTextureName(RefStrings.MODID + ":gas_mask_filter");
|
||||
gas_mask_filter_mono = new ItemFilter().setUnlocalizedName("gas_mask_filter_mono").setTextureName(RefStrings.MODID + ":gas_mask_filter_mono");
|
||||
@ -4154,6 +4157,7 @@ public class ModItems {
|
||||
gun_uzi_saturnite = new ItemGunBase(Gun22LRFactory.getSaturniteConfig()).setUnlocalizedName("gun_uzi_saturnite").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite");
|
||||
gun_uzi_saturnite_silencer = new ItemGunBase(Gun22LRFactory.getSaturniteConfig().silenced()).setUnlocalizedName("gun_uzi_saturnite_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite_silencer");
|
||||
gun_uboinik = new ItemGunBase(Gun12GaugeFactory.getUboinikConfig()).setUnlocalizedName("gun_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
gun_remington = new ItemGunBase(Gun12GaugeFactory.getRemington870Config()).setUnlocalizedName("gun_remington").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_spas12");
|
||||
gun_spas12 = new ItemGunBase(Gun12GaugeFactory.getSpas12Config(), Gun12GaugeFactory.getSpas12AltConfig()).setUnlocalizedName("gun_spas12").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_spas12");
|
||||
gun_supershotgun = new ItemGunShotty(Gun12GaugeFactory.getShottyConfig()).setUnlocalizedName("gun_supershotgun").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
gun_ks23 = new ItemGunBase(Gun4GaugeFactory.getKS23Config()).setUnlocalizedName("gun_ks23").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
@ -5441,6 +5445,7 @@ public class ModItems {
|
||||
nothing = new Item().setUnlocalizedName("nothing").setTextureName(RefStrings.MODID + ":nothing");
|
||||
void_anim = new Item().setUnlocalizedName("void_anim").setTextureName(RefStrings.MODID + ":void_anim");
|
||||
|
||||
|
||||
bob_metalworks = new Item().setUnlocalizedName("bob_metalworks").setTextureName(RefStrings.MODID + ":bob_metalworks");
|
||||
bob_assembly = new Item().setUnlocalizedName("bob_assembly").setTextureName(RefStrings.MODID + ":bob_assembly");
|
||||
bob_chemistry = new Item().setUnlocalizedName("bob_chemistry").setTextureName(RefStrings.MODID + ":bob_chemistry");
|
||||
@ -5455,11 +5460,11 @@ public class ModItems {
|
||||
mysteryshovel = new ItemMS().setUnlocalizedName("mysteryshovel").setFull3D().setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cursed_shovel");
|
||||
memory = new ItemBattery(Long.MAX_VALUE / 100L, 100000000000000L, 100000000000000L).setUnlocalizedName("memory").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mo8_anim");
|
||||
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.acid_fluid, 1000), new ItemStack(ModItems.bucket_acid));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.toxic_fluid, 1000), new ItemStack(ModItems.bucket_toxic));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.schrabidic_fluid, 1000), new ItemStack(ModItems.bucket_schrabidic_acid));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.sulfuric_acid_fluid, 1000), new ItemStack(ModItems.bucket_sulfuric_acid));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.mud_fluid, 1000), new ItemStack(ModItems.bucket_mud), new ItemStack(Items.bucket));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.acid_fluid, 1000), new ItemStack(ModItems.bucket_acid), new ItemStack(Items.bucket));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.toxic_fluid, 1000), new ItemStack(ModItems.bucket_toxic), new ItemStack(Items.bucket));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.schrabidic_fluid, 1000), new ItemStack(ModItems.bucket_schrabidic_acid), new ItemStack(Items.bucket));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidStack(ModBlocks.sulfuric_acid_fluid, 1000), new ItemStack(ModItems.bucket_sulfuric_acid), new ItemStack(Items.bucket));
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.mud_block, ModItems.bucket_mud);
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.acid_block, ModItems.bucket_acid);
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.toxic_block, ModItems.bucket_toxic);
|
||||
@ -6958,6 +6963,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_uzi_saturnite, gun_uzi_saturnite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_uzi_saturnite_silencer,gun_uzi_saturnite_silencer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_uboinik, gun_uboinik.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_remington, gun_remington.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_supershotgun, gun_supershotgun.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_ks23, gun_ks23.getUnlocalizedName());
|
||||
@ -7448,6 +7454,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(fmn, fmn.getUnlocalizedName());
|
||||
GameRegistry.registerItem(five_htp, five_htp.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plan_c, plan_c.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pill_red, pill_red.getUnlocalizedName());
|
||||
GameRegistry.registerItem(stealth_boy, stealth_boy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas_mask_filter, gas_mask_filter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas_mask_filter_mono, gas_mask_filter_mono.getUnlocalizedName());
|
||||
|
||||
@ -50,6 +50,10 @@ public class ItemPill extends ItemFood {
|
||||
player.attackEntityFrom(rand.nextBoolean() ? ModDamageSource.euthanizedSelf : ModDamageSource.euthanizedSelf2, 1000);
|
||||
}
|
||||
|
||||
if(this == ModItems.pill_red) {
|
||||
player.addPotionEffect(new PotionEffect(HbmPotion.death.id, 60 * 60 * 20, 0));
|
||||
}
|
||||
|
||||
if(this == ModItems.radx) {
|
||||
player.addPotionEffect(new PotionEffect(HbmPotion.radx.id, 3 * 60 * 20, 0));
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ public class ItemWatzPellet extends ItemEnumMulti {
|
||||
|
||||
if(num.passive > 0){
|
||||
list.add(color + "Base fission rate: " + reset + num.passive);
|
||||
list.add(EnumChatFormatting.RED + "Self-ingiting!");
|
||||
list.add(EnumChatFormatting.RED + "Self-igniting!");
|
||||
}
|
||||
if(num.heatEmission > 0) list.add(color + "Heat per flux: " + reset + num.heatEmission + " TU");
|
||||
if(num.burnFunc != null) {
|
||||
|
||||
@ -2,13 +2,33 @@ package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.rail.IRailNTM;
|
||||
import com.hbm.blocks.rail.IRailNTM.RailContext;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorBulkie;
|
||||
import com.hbm.explosion.vanillant.standard.BlockMutatorBulkie;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.world.feature.OilSpot;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemWandD extends Item {
|
||||
@ -23,6 +43,14 @@ public class ItemWandD extends Item {
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(world, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 7);
|
||||
vnt.setBlockAllocator(new BlockAllocatorBulkie(60));
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorBulkie(ModBlocks.block_slag)).setNoDrop());
|
||||
vnt.setEntityProcessor(new EntityProcessorStandard());
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectStandard());
|
||||
vnt.explode();
|
||||
|
||||
/*TimeAnalyzer.startCount("setBlock");
|
||||
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt);
|
||||
TimeAnalyzer.startEndCount("getBlock");
|
||||
@ -58,8 +86,6 @@ public class ItemWandD extends Item {
|
||||
//MapGenStronghold.Start startS = new MapGenStronghold.Start(world, world.rand, pos.blockX >> 4, pos.blockZ >> 4);
|
||||
//startS.generateStructure(world, world.rand, new StructureBoundingBox(k - 124, l - 124, k + 15 + 124, l + 15 + 124));
|
||||
|
||||
OilSpot.generateOilSpot(world, pos.blockX, pos.blockZ, 3, 50, true);
|
||||
|
||||
/*EntityNukeTorex torex = new EntityNukeTorex(world);
|
||||
torex.setPositionAndRotation(pos.blockX, pos.blockY + 1, pos.blockZ, 0, 0);
|
||||
torex.getDataWatcher().updateObject(10, 1.5F);
|
||||
|
||||
@ -229,7 +229,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
setItemWear(stack, getItemWear(stack) + wear);
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, mainConfig.firingSound, 1.0F, mainConfig.firingPitch);
|
||||
world.playSoundAtEntity(player, mainConfig.firingSound, mainConfig.firingVolume, mainConfig.firingPitch);
|
||||
|
||||
if(mainConfig.ejector != null && !mainConfig.ejector.getAfterReload())
|
||||
queueCasing(player, mainConfig.ejector, config, stack);
|
||||
@ -263,7 +263,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
setItemWear(stack, getItemWear(stack) + config.wear);
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, altConfig.firingSound, 1.0F, altConfig.firingPitch);
|
||||
world.playSoundAtEntity(player, altConfig.firingSound, mainConfig.firingVolume, altConfig.firingPitch);
|
||||
|
||||
if(altConfig.ejector != null)
|
||||
queueCasing(player, altConfig.ejector, config, stack);
|
||||
@ -458,6 +458,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
{
|
||||
final BulletConfiguration bulletConfig = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack)));
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.gunDamage, bulletConfig.dmgMin, bulletConfig.dmgMax));
|
||||
if(bulletConfig.bulletsMax != 1)
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.gunPellets, bulletConfig.bulletsMin, bulletConfig.bulletsMax));
|
||||
int dura = Math.max(mainConfig.durability - getItemWear(stack), 0);
|
||||
|
||||
list.add(I18nUtil.resolveKey(HbmCollection.durability, dura + " / " + mainConfig.durability));
|
||||
|
||||
@ -5,9 +5,13 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.GunAnimationPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -22,17 +26,20 @@ public class ItemGunGauss extends ItemGunBase {
|
||||
public void endAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
|
||||
|
||||
if(getHasShot(stack)) {
|
||||
world.playSoundAtEntity(player, "hbm:weapon.sparkShoot", 1.0F, 1.0F);
|
||||
world.playSoundAtEntity(player, "hbm:weapon.sparkShoot", 2.0F, 1.0F);
|
||||
setHasShot(stack, false);
|
||||
}
|
||||
|
||||
if(!main && getStored(stack) > 0) {
|
||||
EntityBulletBase bullet = new EntityBulletBase(world, altConfig.config.get(0), player);
|
||||
bullet.overrideDamage = Math.min(getStored(stack), 13) * 3.5F;
|
||||
bullet.overrideDamage = Math.max(getStored(stack), 1) * 10F;
|
||||
world.spawnEntityInWorld(bullet);
|
||||
world.playSoundAtEntity(player, "hbm:weapon.tauShoot", 1.0F, 0.75F);
|
||||
world.playSoundAtEntity(player, "hbm:weapon.tauShoot", 0.5F, 0.75F);
|
||||
setItemWear(stack, getItemWear(stack) + (getCharge(stack)) * 2);
|
||||
setCharge(stack, 0);
|
||||
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +114,7 @@ public class ItemGunGauss extends ItemGunBase {
|
||||
chargeLoop = rebootAudio(chargeLoop, player);
|
||||
}
|
||||
chargeLoop.updatePosition((float)player.posX, (float)player.posY, (float)player.posZ);
|
||||
chargeLoop.updatePitch(chargeLoop.getPitch() + 0.01F);
|
||||
chargeLoop.updatePitch(1 + (getCharge(stack)) * 0.01F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ public class HbmCollection {
|
||||
// SHOTGUNS
|
||||
/** 12 GAUGE **/
|
||||
public static final List<Integer> g12 = ImmutableList.of(BulletConfigSyncingUtil.G12_NORMAL, BulletConfigSyncingUtil.G12_INCENDIARY, BulletConfigSyncingUtil.G12_SHRAPNEL, BulletConfigSyncingUtil.G12_DU, BulletConfigSyncingUtil.G12_AM, BulletConfigSyncingUtil.G12_SLEEK, BulletConfigSyncingUtil.G12_PERCUSSION);
|
||||
public static final List<Integer> g12hs = ImmutableList.of(BulletConfigSyncingUtil.G12HS_NORMAL, BulletConfigSyncingUtil.G12HS_INCENDIARY, BulletConfigSyncingUtil.G12HS_SHRAPNEL, BulletConfigSyncingUtil.G12HS_DU, BulletConfigSyncingUtil.G12HS_AM, BulletConfigSyncingUtil.G12HS_SLEEK, BulletConfigSyncingUtil.G12HS_PERCUSSION);
|
||||
/** 20 GAUGE **/
|
||||
public static final List<Integer> g20 = ImmutableList.of(BulletConfigSyncingUtil.G20_NORMAL, BulletConfigSyncingUtil.G20_SLUG, BulletConfigSyncingUtil.G20_FLECHETTE, BulletConfigSyncingUtil.G20_FIRE, BulletConfigSyncingUtil.G20_SHRAPNEL, BulletConfigSyncingUtil.G20_EXPLOSIVE, BulletConfigSyncingUtil.G20_CAUSTIC, BulletConfigSyncingUtil.G20_SHOCK, BulletConfigSyncingUtil.G20_WITHER, BulletConfigSyncingUtil.G20_SLEEK);
|
||||
/** 4 GAUGE **/
|
||||
@ -140,6 +141,8 @@ public class HbmCollection {
|
||||
LUNA,
|
||||
/**Raytheon Missile Systems**/
|
||||
RAYTHEON,
|
||||
/**Remingotn Arms**/
|
||||
REMINGTON,
|
||||
/**Rockwell International Corporation**/
|
||||
ROCKWELL,
|
||||
/**Rockwell International Corporation?**/
|
||||
@ -181,6 +184,7 @@ public class HbmCollection {
|
||||
public static final String gunName = "desc.item.gun.name";
|
||||
public static final String gunMaker = "desc.item.gun.manufacturer";
|
||||
public static final String gunDamage = "desc.item.gun.damage";
|
||||
public static final String gunPellets = "desc.item.gun.pellets";
|
||||
// MISC
|
||||
public static final String capacity = "desc.block.barrel.capacity";
|
||||
public static final String durability = "desc.item.durability";
|
||||
|
||||
@ -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 (4578)";
|
||||
public static final String VERSION = "1.0.27 BETA (4592)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -60,6 +60,8 @@ import com.hbm.entity.mob.botprime.*;
|
||||
import com.hbm.entity.mob.siege.*;
|
||||
import com.hbm.entity.particle.*;
|
||||
import com.hbm.entity.projectile.*;
|
||||
import com.hbm.entity.train.*;
|
||||
import com.hbm.entity.train.EntityRailCarRidable.SeatDummyEntity;
|
||||
import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.HbmKeybinds;
|
||||
import com.hbm.handler.ImpactWorldHandler;
|
||||
@ -273,6 +275,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAutosaw.class, new RenderAutosaw());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineVacuumDistill.class, new RenderVacuumDistill());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCatalyticReformer.class, new RenderCatalyticReformer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCoker.class, new RenderCoker());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFan.class, new RenderFan());
|
||||
//Foundry
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryBasin.class, new RenderFoundry());
|
||||
@ -448,7 +451,7 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_proto, new ItemRenderFatMan());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_mirv, new ItemRenderMIRVLauncher());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bf, new ItemRenderBFLauncher());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_xvl1456, new ItemRenderXVL1456());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_xvl1456, new ItemRenderWeaponTau());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_zomg, new ItemRenderZOMG());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_osipr, new ItemRenderOSIPR());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_mp, new ItemRenderMP());
|
||||
@ -501,6 +504,7 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ar15, new ItemRenderWeaponAR15());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_detonator, new ItemRenderDetonatorLaser());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.detonator_laser, new ItemRenderDetonatorLaser());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_remington, new ItemRenderWeaponRemington());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderWeaponSpas12());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_glass_cannon, new ItemRenderWeaponGlass());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_chemthrower, new ItemRenderWeaponChemthrower());
|
||||
@ -679,6 +683,9 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMinecartCrate.class, new RenderMinecart());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMinecartNTM.class, new RenderNeoCart());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMagnusCartus.class, new RenderMagnusCartus());
|
||||
//trains
|
||||
RenderingRegistry.registerEntityRenderingHandler(SeatDummyEntity.class, new RenderEmpty());
|
||||
RenderingRegistry.registerEntityRenderingHandler(TrainCargoTram.class, new RenderTrainCargoTram());
|
||||
//items
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMovingItem.class, new RenderMovingItem());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMovingPackage.class, new RenderMovingPackage());
|
||||
@ -687,6 +694,8 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperNuclear.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor.png").setSwellMod(5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperTainted.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_tainted.png", RefStrings.MODID + ":" + "textures/entity/creeper_armor_taint.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperPhosgene.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_phosgene.png", "textures/entity/creeper/creeper_armor.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperVolatile.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_volatile.png", "textures/entity/creeper/creeper_armor.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCreeperGold.class, new RenderCreeperUniversal(RefStrings.MODID + ":" + "textures/entity/creeper_gold.png", "textures/entity/creeper/creeper_armor.png"));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHunterChopper.class, new RenderHunterChopper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCyberCrab.class, new RenderCyberCrab());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaCrab.class, new RenderTeslaCrab());
|
||||
|
||||
@ -49,6 +49,7 @@ import com.hbm.blocks.generic.BlockMotherOfAllOres;
|
||||
import com.hbm.blocks.generic.BlockToolConversion;
|
||||
import com.hbm.commands.CommandReloadRecipes;
|
||||
import com.hbm.config.*;
|
||||
import com.hbm.crafting.RodRecipes;
|
||||
import com.hbm.creativetabs.*;
|
||||
import com.hbm.entity.EntityMappings;
|
||||
import com.hbm.entity.grenade.*;
|
||||
@ -254,7 +255,6 @@ public class MainRegistry {
|
||||
logger.info("Let us celebrate the fact that the logger finally works again!");
|
||||
|
||||
// Reroll Polaroid
|
||||
|
||||
if(generalOverride > 0 && generalOverride < 19) {
|
||||
polaroidID = generalOverride;
|
||||
} else {
|
||||
@ -637,6 +637,8 @@ public class MainRegistry {
|
||||
|
||||
@EventHandler
|
||||
public static void load(FMLInitializationEvent event) {
|
||||
|
||||
RodRecipes.registerInit();
|
||||
|
||||
achSacrifice = new Achievement("achievement.sacrifice", "sacrifice", -3, 1, ModItems.burnt_bark, null).initIndependentStat().setSpecial().registerStat();
|
||||
achImpossible = new Achievement("achievement.impossible", "impossible", 18, 10, ModItems.nothing, null).initIndependentStat().setSpecial().registerStat();
|
||||
@ -845,6 +847,7 @@ public class MainRegistry {
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20).withFluid(ModBlocks.sulfuric_acid_block); //sulfur
|
||||
new OreCave(ModBlocks.stone_resource, 1).setThreshold(1.75D).setRangeMult(20).setYLevel(25).setMaxRange(20); //asbestos
|
||||
new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.HEMATITE.ordinal());
|
||||
//new BiomeCave().setThreshold(1.5D).setRangeMult(20).setYLevel(40).setMaxRange(20);
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
|
||||
Compat.handleRailcraftNonsense();
|
||||
|
||||
@ -574,7 +574,7 @@ public class ModEventHandler {
|
||||
|
||||
float eRad = HbmLivingProps.getRadiation(entity);
|
||||
|
||||
if(entity instanceof EntityCreeper && eRad >= 200 && entity.getHealth() > 0) {
|
||||
if(entity.getClass().equals(EntityCreeper.class) && eRad >= 200 && entity.getHealth() > 0) {
|
||||
|
||||
if(event.world.rand.nextInt(3) == 0 ) {
|
||||
EntityCreeperNuclear creep = new EntityCreeperNuclear(event.world);
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.effect.EntityNukeTorex;
|
||||
import com.hbm.entity.mob.EntityHunterChopper;
|
||||
import com.hbm.entity.projectile.EntityChopperMine;
|
||||
import com.hbm.entity.train.EntityRailCarRidable;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
@ -84,12 +85,14 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
@ -103,6 +106,8 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.client.C03PacketPlayer;
|
||||
import net.minecraft.network.play.client.C0CPacketInput;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -200,6 +205,71 @@ public class ModEventHandlerClient {
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}*/
|
||||
|
||||
/*List<String> text = new ArrayList();
|
||||
MovingObjectPosition pos = Library.rayTrace(player, 500, 1, false, true, false);
|
||||
|
||||
for(int i = 0; i < 2; i++) if(pos != null && pos.typeOfHit == pos.typeOfHit.BLOCK) {
|
||||
|
||||
float yaw = player.rotationYaw;
|
||||
|
||||
Vec3 next = Vec3.createVectorHelper(pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord);
|
||||
int it = 0;
|
||||
|
||||
BlockPos anchor = new BlockPos(pos.blockX, pos.blockY, pos.blockZ);
|
||||
|
||||
double distanceToCover = 4D * (i == 0 ? 1 : -1);
|
||||
|
||||
do {
|
||||
|
||||
it++;
|
||||
|
||||
if(it > 30) {
|
||||
world.createExplosion(player, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 5F, false);
|
||||
break;
|
||||
}
|
||||
|
||||
int x = anchor.getX();
|
||||
int y = anchor.getY();
|
||||
int z = anchor.getZ();
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
Vec3 rot = Vec3.createVectorHelper(0, 0, 1);
|
||||
rot.rotateAroundY((float) (-yaw * Math.PI / 180D));
|
||||
|
||||
if(block instanceof IRailNTM) {
|
||||
IRailNTM rail = (IRailNTM) block;
|
||||
RailContext info = new RailContext();
|
||||
|
||||
boolean flip = distanceToCover < 0;
|
||||
|
||||
if(it == 1) {
|
||||
Vec3 snap = next = rail.getTravelLocation(world, x, y, z, next.xCoord, next.yCoord, next.zCoord, rot.xCoord, rot.yCoord, rot.zCoord, 0, info);
|
||||
if(i == 0) world.spawnParticle("reddust", snap.xCoord, snap.yCoord + 0.25, snap.zCoord, 0.1, 1, 0.1);
|
||||
}
|
||||
|
||||
Vec3 prev = next;
|
||||
next = rail.getTravelLocation(world, x, y, z, prev.xCoord, prev.yCoord, prev.zCoord, rot.xCoord, rot.yCoord, rot.zCoord, distanceToCover, info);
|
||||
distanceToCover = info.overshoot;
|
||||
anchor = info.pos;
|
||||
if(i == 0) world.spawnParticle("reddust", next.xCoord, next.yCoord + 0.25, next.zCoord, 0, distanceToCover != 0 ? 0.5 : 0, 0);
|
||||
else world.spawnParticle("reddust", next.xCoord, next.yCoord + 0.25, next.zCoord, 0, distanceToCover != 0 ? 0.5 : 0, 1);
|
||||
|
||||
double deltaX = next.xCoord - prev.xCoord;
|
||||
double deltaZ = next.zCoord - prev.zCoord;
|
||||
double radians = -Math.atan2(deltaX, deltaZ);
|
||||
yaw = (float) MathHelper.wrapAngleTo180_double(radians * 180D / Math.PI + (flip ? 180 : 0));
|
||||
|
||||
text.add(it + ": " + yaw);
|
||||
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
} while(distanceToCover != 0);
|
||||
|
||||
ILookOverlay.printGeneric(event, "DEBUG", 0xffff00, 0x4040000, text);
|
||||
}*/
|
||||
}
|
||||
|
||||
/// HANLDE ANIMATION BUSES ///
|
||||
@ -1092,4 +1162,21 @@ public class ModEventHandlerClient {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldTick(WorldTickEvent event) {
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if(player != null && player.ridingEntity instanceof EntityRailCarRidable && player instanceof EntityClientPlayerMP) {
|
||||
EntityRailCarRidable train = (EntityRailCarRidable) player.ridingEntity;
|
||||
EntityClientPlayerMP client = (EntityClientPlayerMP) player;
|
||||
|
||||
//mojank compensation, because apparently the "this makes the render work" method also determines the fucking input
|
||||
if(!train.shouldRiderSit()) {
|
||||
client.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(client.rotationYaw, client.rotationPitch, client.onGround));
|
||||
client.sendQueue.addToSendQueue(new C0CPacketInput(client.moveStrafing, client.moveForward, client.movementInput.jump, client.movementInput.sneak));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.blocks.ICustomBlockHighlight;
|
||||
import com.hbm.items.armor.IArmorDisableModel;
|
||||
import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.packet.PermaSyncHandler;
|
||||
import com.hbm.render.model.ModelMan;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
@ -36,7 +36,7 @@ public class ModEventHandlerRenderer {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
RenderPlayer renderer = event.renderer;
|
||||
|
||||
boolean isManly = player.isPotionActive(HbmPotion.death.id);
|
||||
boolean isManly = PermaSyncHandler.boykissers.contains(player.getEntityId());
|
||||
|
||||
for(int j = 0; j < 7; j++) {
|
||||
|
||||
@ -78,7 +78,7 @@ public class ModEventHandlerRenderer {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
RenderPlayer renderer = event.renderer;
|
||||
|
||||
boolean isManly = player.isPotionActive(HbmPotion.death.id);
|
||||
boolean isManly = PermaSyncHandler.boykissers.contains(player.getEntityId());
|
||||
|
||||
if(isManly) {
|
||||
if(manlyModel == null)
|
||||
@ -117,7 +117,7 @@ public class ModEventHandlerRenderer {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
//RenderPlayer renderer = event.renderer;
|
||||
|
||||
boolean isManly = player.isPotionActive(HbmPotion.death.id);
|
||||
boolean isManly = PermaSyncHandler.boykissers.contains(player.getEntityId());
|
||||
|
||||
if(!isManly)
|
||||
return;
|
||||
|
||||
@ -63,6 +63,7 @@ public class NEIConfig implements IConfigureNEI {
|
||||
}
|
||||
registerHandler(new LiquefactionHandler());
|
||||
registerHandler(new SolidificationHandler());
|
||||
registerHandler(new CokingHandler());
|
||||
registerHandler(new FractioningHandler());
|
||||
registerHandler(new BoilingHandler());
|
||||
registerHandler(new CombinationHandler());
|
||||
@ -72,8 +73,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
|
||||
//fluids
|
||||
registerHandler(new FluidRecipeHandler());
|
||||
|
||||
//registerHandler(new ChunkyHandler());
|
||||
|
||||
//Some things are even beyond my control...or are they?
|
||||
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
|
||||
|
||||
@ -76,6 +76,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom catalytic_reformer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/catalytic_reformer.obj"));
|
||||
public static final IModelCustom liquefactor = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/liquefactor.obj"));
|
||||
public static final IModelCustom solidifier = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/solidifier.obj"));
|
||||
public static final IModelCustom coker = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/coker.obj"));
|
||||
|
||||
//Flare Stack
|
||||
public static final IModelCustom oilflare = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/flare_stack.obj"));
|
||||
@ -401,6 +402,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation catalytic_reformer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/catalytic_reformer.png");
|
||||
public static final ResourceLocation liquefactor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/liquefactor.png");
|
||||
public static final ResourceLocation solidifier_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/solidifier.png");
|
||||
public static final ResourceLocation coker_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/coker.png");
|
||||
|
||||
//Flare Stack
|
||||
public static final ResourceLocation oilflare_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/flare_stack.png");
|
||||
@ -706,6 +708,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom rem700sat = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/rem700sat.obj"));
|
||||
public static final IModelCustom cursed_revolver = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cursed.obj"));
|
||||
public static final IModelCustom detonator_laser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/detonator_laser.obj"));
|
||||
public static final IModelCustom remington = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/remington.obj"));
|
||||
public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj"));
|
||||
public static final IModelCustom nightmare_dark = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/nightmare_dark.obj"));
|
||||
public static final IModelCustom glass_cannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/glass_cannon.obj"));
|
||||
@ -715,6 +718,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom novac_scoped = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/novac_scoped.obj"));
|
||||
public static final IModelCustom m2 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/m2_browning.obj")).asDisplayList(); //large fella should be a display list
|
||||
public static final IModelCustom lunatic_sniper = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lunatic_sniper.obj")).asDisplayList();
|
||||
public static final IModelCustom tau = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/tau.obj"));
|
||||
|
||||
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
|
||||
|
||||
@ -791,6 +795,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation rem700poly_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/rem700poly.png");
|
||||
public static final ResourceLocation rem700sat_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/rem700sat.png");
|
||||
public static final ResourceLocation detonator_laser_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/detonator_laser.png");
|
||||
public static final ResourceLocation remington_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/remington.png");
|
||||
public static final ResourceLocation spas_12_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/spas-12.png");
|
||||
public static final ResourceLocation glass_cannon_panel_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/glass_cannon_panel.png");
|
||||
public static final ResourceLocation bio_revolver_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/bio_revolver.png");
|
||||
@ -803,6 +808,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation red_key_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/red_key.png");
|
||||
public static final ResourceLocation m2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/m2_browning.png");
|
||||
public static final ResourceLocation lunatic_sniper_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lunatic_sniper.png");
|
||||
public static final ResourceLocation tau_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tau.png");
|
||||
|
||||
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
|
||||
|
||||
@ -999,6 +1005,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom cart = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/cart.obj"));
|
||||
public static final IModelCustom cart_destroyer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/cart_destroyer.obj"));
|
||||
public static final IModelCustom cart_powder = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/cart_powder.obj"));
|
||||
public static final IModelCustom train_cargo_tram = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/vehicles/tram.obj"));
|
||||
|
||||
////Texture Entities
|
||||
|
||||
@ -1272,6 +1279,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation cart_powder_tex = new ResourceLocation(RefStrings.MODID, "textures/blocks/block_gunpowder.png");
|
||||
public static final ResourceLocation cart_semtex_side = new ResourceLocation(RefStrings.MODID, "textures/blocks/semtex_side.png");
|
||||
public static final ResourceLocation cart_semtex_top = new ResourceLocation(RefStrings.MODID, "textures/blocks/semtex_bottom.png");
|
||||
public static final ResourceLocation train_tram = new ResourceLocation(RefStrings.MODID, "textures/models/trains/tram.png");
|
||||
|
||||
//ISBRHs
|
||||
public static final IModelCustom scaffold = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/scaffold.obj"));
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.ImpactWorldHandler;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@ -14,6 +19,8 @@ import net.minecraft.world.World;
|
||||
* @author hbm
|
||||
*/
|
||||
public class PermaSyncHandler {
|
||||
|
||||
public static HashSet<Integer> boykissers = new HashSet();
|
||||
|
||||
public static void writePacket(ByteBuf buf, World world, EntityPlayerMP player) {
|
||||
|
||||
@ -23,6 +30,18 @@ public class PermaSyncHandler {
|
||||
buf.writeFloat(data.dust);
|
||||
buf.writeBoolean(data.impact);
|
||||
/// TOM IMPACT DATA ///
|
||||
|
||||
/// SHITTY MEMES ///
|
||||
List<Integer> ids = new ArrayList();
|
||||
for(Object o : world.playerEntities) {
|
||||
EntityPlayer p = (EntityPlayer) o;
|
||||
if(p.isPotionActive(HbmPotion.death.id)) {
|
||||
ids.add(p.getEntityId());
|
||||
}
|
||||
}
|
||||
buf.writeShort((short) ids.size());
|
||||
for(Integer i : ids) buf.writeInt(i);
|
||||
/// SHITTY MEMES ///
|
||||
}
|
||||
|
||||
public static void readPacket(ByteBuf buf, World world, EntityPlayer player) {
|
||||
@ -33,5 +52,11 @@ public class PermaSyncHandler {
|
||||
ImpactWorldHandler.dust = buf.readFloat();
|
||||
ImpactWorldHandler.impact = buf.readBoolean();
|
||||
/// TOM IMPACT DATA ///
|
||||
|
||||
/// SHITTY MEMES ///
|
||||
boykissers.clear();
|
||||
int ids = buf.readShort();
|
||||
for(int i = 0; i < ids; i++) boykissers.add(buf.readInt());
|
||||
/// SHITTY MEMES ///
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package com.hbm.render.entity.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderTrainCargoTram extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float swing, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
GL11.glRotated( -entity.rotationYaw, 0, 1, 0);
|
||||
GL11.glRotated(-entity.rotationPitch, 0, 0, 1);
|
||||
|
||||
MainRegistry.proxy.displayTooltip("Render Yaw: " + entity.rotationYaw, 666);
|
||||
MainRegistry.proxy.displayTooltip("Render Pitch: " + entity.rotationPitch, 667);
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
bindTexture(ResourceManager.train_tram);
|
||||
ResourceManager.train_cargo_tram.renderAll();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return ResourceManager.train_tram;
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -11,6 +12,7 @@ import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.model.ModelBaleflare;
|
||||
import com.hbm.render.model.ModelBullet;
|
||||
import com.hbm.render.util.RenderSparks;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@ -19,8 +21,10 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class RenderBullet extends Render {
|
||||
|
||||
@ -37,10 +41,8 @@ public class RenderBullet extends Render {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
GL11.glRotatef(bullet.prevRotationYaw + (bullet.rotationYaw - bullet.prevRotationYaw) * f1 - 90.0F,
|
||||
0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(bullet.prevRotationPitch + (bullet.rotationPitch - bullet.prevRotationPitch) * f1 + 180,
|
||||
0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(bullet.prevRotationYaw + (bullet.rotationYaw - bullet.prevRotationYaw) * f1 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(bullet.prevRotationPitch + (bullet.rotationPitch - bullet.prevRotationPitch) * f1 + 180, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
|
||||
int style = bullet.getDataWatcher().getWatchableObjectByte(16);
|
||||
@ -69,6 +71,7 @@ public class RenderBullet extends Render {
|
||||
case BulletConfiguration.STYLE_APDS: renderAPDS(); break;
|
||||
case BulletConfiguration.STYLE_BLADE: renderBlade(); break;
|
||||
case BulletConfiguration.STYLE_BARREL: renderNuke(3); break;
|
||||
case BulletConfiguration.STYLE_TAU: renderTau((EntityBulletBase) bullet, trail, f1); break;
|
||||
default: renderBullet(trail); break;
|
||||
}
|
||||
|
||||
@ -450,11 +453,11 @@ public class RenderBullet extends Render {
|
||||
tess.addVertex(0, -0.5, -0.5);
|
||||
tess.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@ -479,6 +482,111 @@ public class RenderBullet extends Render {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private void renderTau(EntityBulletBase bullet, int trail, float interp) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
float scale = 0.125F;
|
||||
|
||||
double pX = bullet.prevPosX + (bullet.posX - bullet.prevPosX) * interp;
|
||||
double pY = bullet.prevPosY + (bullet.posY - bullet.prevPosY) * interp;
|
||||
double pZ = bullet.prevPosZ + (bullet.posZ - bullet.prevPosZ) * interp;
|
||||
|
||||
if(bullet.prevRenderY == 0) {
|
||||
bullet.prevRenderX = pX;
|
||||
bullet.prevRenderY = pY;
|
||||
bullet.prevRenderZ = pZ;
|
||||
}
|
||||
|
||||
double deltaX = bullet.prevRenderX - pX;
|
||||
double deltaY = bullet.prevRenderY - pY;
|
||||
double deltaZ = bullet.prevRenderZ - pZ;
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
double dX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)interp;
|
||||
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)interp;
|
||||
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(pX - dX, pY - dY, pZ - dZ);
|
||||
|
||||
float r = 1F;
|
||||
float g = 0.5F;
|
||||
float b = 0F;
|
||||
|
||||
if(trail == 1) {
|
||||
r = 1;
|
||||
g = 1;
|
||||
b = 1;
|
||||
}
|
||||
|
||||
for(Pair<Vec3, Double> pair : bullet.trailNodes) {
|
||||
Vec3 pos = pair.getKey();
|
||||
|
||||
double mult = 1D;
|
||||
pos.xCoord += deltaX * mult;
|
||||
pos.yCoord += deltaY * mult;
|
||||
pos.zCoord += deltaZ * mult;
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
|
||||
for(int i = 0; i < bullet.trailNodes.size() - 1; i++) {
|
||||
final Pair<Vec3, Double> node = bullet.trailNodes.get(i), past = bullet.trailNodes.get(i + 1);
|
||||
final Vec3 nodeLoc = node.getKey(), pastLoc = past.getKey();
|
||||
float nodeAlpha = node.getValue().floatValue();
|
||||
float pastAlpha = past.getValue().floatValue();
|
||||
|
||||
double timeAlpha = Math.max(2D - bullet.ticksExisted * 0.2, 0D);
|
||||
nodeAlpha *= timeAlpha;
|
||||
pastAlpha *= timeAlpha;
|
||||
float outerAlpha = 0.25F;
|
||||
|
||||
if(nodeAlpha == 0 && pastAlpha == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
tessellator.setColorRGBA_F(r, g, b, nodeAlpha);
|
||||
tessellator.addVertex(nodeLoc.xCoord, nodeLoc.yCoord, nodeLoc.zCoord);
|
||||
tessellator.setColorRGBA_F(r, g, b, nodeAlpha * outerAlpha);
|
||||
tessellator.addVertex(nodeLoc.xCoord, nodeLoc.yCoord + scale, nodeLoc.zCoord);
|
||||
tessellator.setColorRGBA_F(r, g, b, pastAlpha * outerAlpha);
|
||||
tessellator.addVertex(pastLoc.xCoord, pastLoc.yCoord + scale, pastLoc.zCoord);
|
||||
tessellator.setColorRGBA_F(r, g, b, pastAlpha);
|
||||
tessellator.addVertex(pastLoc.xCoord, pastLoc.yCoord, pastLoc.zCoord);
|
||||
|
||||
tessellator.setColorRGBA_F(r, g, b, nodeAlpha);
|
||||
tessellator.addVertex(nodeLoc.xCoord, nodeLoc.yCoord, nodeLoc.zCoord);
|
||||
tessellator.setColorRGBA_F(r, g, b, nodeAlpha * outerAlpha);
|
||||
tessellator.addVertex(nodeLoc.xCoord, nodeLoc.yCoord - scale, nodeLoc.zCoord);
|
||||
tessellator.setColorRGBA_F(r, g, b, pastAlpha * outerAlpha);
|
||||
tessellator.addVertex(pastLoc.xCoord, pastLoc.yCoord - scale, pastLoc.zCoord);
|
||||
tessellator.setColorRGBA_F(r, g, b, pastAlpha);
|
||||
tessellator.addVertex(pastLoc.xCoord, pastLoc.yCoord, pastLoc.zCoord);
|
||||
}
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
tessellator.draw();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F);
|
||||
|
||||
bullet.prevRenderX = pX;
|
||||
bullet.prevRenderY = pY;
|
||||
bullet.prevRenderZ = pZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/models/bullet.png");
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
package com.hbm.render.item.weapon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderWeaponRemington implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.remington_tex);
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
|
||||
double[] recoilT = HbmAnimations.getRelevantTransformation("RECOIL_TRANSLATE");
|
||||
double[] pump = HbmAnimations.getRelevantTransformation("PUMP");
|
||||
|
||||
double s0 = 0.35D;
|
||||
GL11.glRotated(25, 0, 0, 1);
|
||||
GL11.glRotated(-10, 0, 1, 0);
|
||||
GL11.glTranslated(1.25, -1.25, -0.25);
|
||||
GL11.glScaled(s0, s0, s0);
|
||||
|
||||
GL11.glTranslated(recoilT[2], 0, 0);
|
||||
|
||||
ResourceManager.remington.renderPart("Gun");
|
||||
|
||||
GL11.glTranslated(pump[2] * 0.5, 0, 0);
|
||||
|
||||
ResourceManager.remington.renderPart("Pump");
|
||||
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(-80, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-15F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(2.5F, -3.5F, -2F);
|
||||
|
||||
ResourceManager.remington.renderAll();
|
||||
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
|
||||
double s1 = 0.25D;
|
||||
GL11.glScaled(s1, s1, s1);
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
|
||||
ResourceManager.remington.renderAll();
|
||||
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
double s = 1.25D;
|
||||
GL11.glTranslated(4, 11, 0);
|
||||
GL11.glRotated(-135, 0, 0, 1);
|
||||
GL11.glScaled(s, s, -s);
|
||||
|
||||
ResourceManager.remington.renderAll();
|
||||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -112,5 +112,4 @@ public class ItemRenderWeaponSpas12 implements IItemRenderer {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,116 @@
|
||||
package com.hbm.render.item.weapon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.ItemGunGauss;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderWeaponTau implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.tau_tex);
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
|
||||
double s0 = 0.35D;
|
||||
GL11.glRotated(25, 0, 0, 1);
|
||||
GL11.glTranslated(1.5, 0, 0.1);
|
||||
GL11.glRotated(80, 0, 1, 0);
|
||||
GL11.glScaled(s0, s0, s0);
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
GL11.glTranslated(0, 0, recoil[0] * -1);
|
||||
GL11.glTranslated(0, 0, -3);
|
||||
GL11.glRotated(recoil[0] * -5, 1, 0, 0);
|
||||
GL11.glTranslated(0, 0, 3);
|
||||
|
||||
ResourceManager.tau.renderPart("Body");
|
||||
|
||||
if(ItemGunGauss.getCharge(item) > 0) {
|
||||
GL11.glTranslated(0, -0.2, 0);
|
||||
GL11.glRotated(System.currentTimeMillis() % 360D, 0, 0, 1);
|
||||
GL11.glTranslated(0, 0.2, 0);
|
||||
}
|
||||
|
||||
ResourceManager.tau.renderPart("Rotor");
|
||||
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
|
||||
double scale = 0.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(10, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(15F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(2F, 1F, 3F);
|
||||
|
||||
ResourceManager.tau.renderAll();
|
||||
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
|
||||
double s1 = 0.25D;
|
||||
GL11.glScaled(s1, s1, s1);
|
||||
GL11.glTranslated(0, 1, 0);
|
||||
|
||||
ResourceManager.tau.renderAll();
|
||||
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
double s = 1.6D;
|
||||
GL11.glTranslated(8, 7, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
GL11.glRotated(-135, 1, 0, 0);
|
||||
GL11.glScaled(s, s, -s);
|
||||
|
||||
ResourceManager.tau.renderAll();
|
||||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
package com.hbm.render.item.weapon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.model.ModelXVL1456;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderXVL1456 implements IItemRenderer {
|
||||
|
||||
protected ModelXVL1456 swordModel;
|
||||
|
||||
public ItemRenderXVL1456() {
|
||||
swordModel = new ModelXVL1456();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
float f = 0;
|
||||
if((Entity)data[1] instanceof EntityPlayer)
|
||||
//f = ((EntityPlayer)data[1]).getItemInUseCount() > 0 && ((Entity)data[1]).isSneaking() ? 0.05F : 0;
|
||||
f = (((EntityPlayer)data[1]).getItemInUse() != null &&((EntityPlayer)data[1]).getItemInUse().getItemUseAction() == EnumAction.bow) ? 0.05F : 0;
|
||||
switch(type) {
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelXVL1456.png"));
|
||||
GL11.glRotatef(-150.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(-0.9F, -0.1F, -0.1F);
|
||||
GL11.glScalef(0.3F, 0.3F, 0.3F);
|
||||
swordModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, f);
|
||||
GL11.glPopMatrix();
|
||||
break;
|
||||
case EQUIPPED:
|
||||
case ENTITY:
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelXVL1456.png"));
|
||||
GL11.glTranslatef(0.25F, 0F, 1F);
|
||||
GL11.glRotatef(-200.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(75.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -0.2F, -0.5F);
|
||||
GL11.glRotatef(-5.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.5F, -0.2F, -0.2F);
|
||||
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||
swordModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, f);
|
||||
GL11.glPopMatrix();
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -45,6 +45,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
public static final ResourceLocation bobble_nos = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/nos.png");
|
||||
public static final ResourceLocation bobble_drillgon = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/drillgon200.png");
|
||||
public static final ResourceLocation bobble_cirno = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/cirno.png");
|
||||
public static final ResourceLocation bobble_microwave = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/microwave.png");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float intero) {
|
||||
@ -94,6 +95,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
case VAER: bindTexture(bobble_vaer); break;
|
||||
case NOS: bindTexture(bobble_nos); break;
|
||||
case DRILLGON: bindTexture(bobble_drillgon); break;
|
||||
case MICROWAVE: bindTexture(bobble_microwave); break;
|
||||
default: bindTexture(ResourceManager.universal);
|
||||
}
|
||||
|
||||
@ -311,19 +313,19 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
public void renderPellet(BobbleType type) {
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
bobble.renderPart("Pellet");
|
||||
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 0.0F, 0.1F + (float)Math.sin(System.currentTimeMillis() * 0.001D) * 0.05F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 0.0F, 0.1F + (float) Math.sin(System.currentTimeMillis() * 0.001D) * 0.05F);
|
||||
bobble.renderPart("PelletShine");
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
|
||||
54
src/main/java/com/hbm/render/tileentity/RenderCoker.java
Normal file
54
src/main/java/com/hbm/render/tileentity/RenderCoker.java
Normal file
@ -0,0 +1,54 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderCoker extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.coker_tex);
|
||||
ResourceManager.coker.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_coker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(2.75, 2.75, 2.75);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.25, 0.25, 0.25);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.coker_tex);
|
||||
ResourceManager.coker.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -306,6 +306,7 @@ public class TileMappings {
|
||||
put(TileEntitySpacer.class, "tileentity_fraction_spacer");
|
||||
put(TileEntityMachineCatalyticCracker.class, "tileentity_catalytic_cracker");
|
||||
put(TileEntityMachineCatalyticReformer.class, "tileentity_catalytic_reformer");
|
||||
put(TileEntityMachineCoker.class, "tileentity_coker");
|
||||
|
||||
put(TileEntityReactorZirnox.class, "tileentity_zirnox");
|
||||
put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.container.ContainerCoreEmitter;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -11,10 +12,6 @@ import com.hbm.inventory.gui.GUICoreEmitter;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -35,6 +32,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider {
|
||||
|
||||
@ -311,50 +310,50 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
return "dfc_emitter";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEnergyStored(Context context, Arguments args) {
|
||||
return new Object[] {getPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxEnergy(Context context, Arguments args) {
|
||||
return new Object[] {getMaxPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryogel(Context context, Arguments args) {
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInput(Context context, Arguments args) {
|
||||
return new Object[] {watts};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {getPower(), getMaxPower(), tank.getFill(), watts, isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 2)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] isActive(Context context, Arguments args) {
|
||||
return new Object[] {isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 2)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setActive(Context context, Arguments args) {
|
||||
isOn = args.checkBoolean(0);
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 2)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setInput(Context context, Arguments args) {
|
||||
int newOutput = args.checkInteger(0);
|
||||
|
||||
@ -200,19 +200,19 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
return "dfc_injector";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 2)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFirstFuel(Context context, Arguments args) {
|
||||
return new Object[] {tanks[0].getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 2)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getSecondFuel(Context context, Arguments args) {
|
||||
return new Object[] {tanks[1].getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {tanks[0].getFill(), tanks[1].getFill()};
|
||||
|
||||
@ -191,25 +191,25 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
return "dfc_receiver";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInput(Context context, Arguments args) {
|
||||
return new Object[] {joules};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getOutput(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryogel(Context context, Arguments args) {
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {joules, power, tank.getFill()};
|
||||
|
||||
@ -173,25 +173,25 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
return "dfc_stabilizer";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEnergyStored(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxEnergy(Context context, Arguments args) {
|
||||
return new Object[] {maxPower};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInput(Context context, Arguments args) {
|
||||
return new Object[] {watts};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getDurability(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.ams_lens && ItemLens.getLensDamage(slots[0]) < ((ItemLens)ModItems.ams_lens).maxDamage) {
|
||||
@ -200,7 +200,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
Object lens_damage_buf;
|
||||
@ -212,7 +212,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
return new Object[] {power, maxPower, watts, lens_damage_buf};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 2)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setInput(Context context, Arguments args) {
|
||||
int newOutput = args.checkInteger(0);
|
||||
|
||||
@ -545,7 +545,7 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
int matMaximum = recipeInputRequired * this.recipeZCapacity / recipeContent;
|
||||
int amountStored = getQuantaFromType(recipeStack, stack.material);
|
||||
|
||||
return amountStored < matMaximum;
|
||||
return amountStored < matMaximum && getQuantaFromType(this.recipeStack, null) < this.recipeZCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -577,6 +577,7 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
}
|
||||
|
||||
int toAdd = matMaximum - stack.amount;
|
||||
toAdd = Math.min(toAdd, this.recipeZCapacity - getQuantaFromType(this.recipeStack, null));
|
||||
this.addToStack(this.recipeStack, new MaterialStack(stack.material, toAdd));
|
||||
return new MaterialStack(stack.material, stack.amount - toAdd);
|
||||
}
|
||||
|
||||
@ -215,12 +215,16 @@ public class TileEntityFurnaceCombination extends TileEntityMachineBase implemen
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.tank.readFromNBT(nbt, "tank");
|
||||
this.progress = nbt.getInteger("prog");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
this.tank.writeToNBT(nbt, "tank");
|
||||
nbt.setInteger("prog", progress);
|
||||
nbt.setInteger("heat", heat);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -185,9 +185,9 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord, yCoord - 1, zCoord, Library.NEG_Y),
|
||||
new DirPos(xCoord + 1, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord, zCoord + 1, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.NEG_Z),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,12 @@ public class TileEntityMachinePress extends TileEntityMachineBase implements IGU
|
||||
|
||||
if(slots[0] != null && burnTime < 200 && TileEntityFurnace.getItemBurnTime(slots[0]) > 0) { // less than one operation stored? burn more fuel!
|
||||
burnTime += TileEntityFurnace.getItemBurnTime(slots[0]);
|
||||
this.decrStackSize(0, 1);
|
||||
|
||||
if(slots[0].stackSize == 1 && slots[0].getItem().hasContainerItem(slots[0])) {
|
||||
slots[0] = slots[0].getItem().getContainerItem(slots[0]).copy();
|
||||
} else {
|
||||
this.decrStackSize(0, 1);
|
||||
}
|
||||
this.markChanged();
|
||||
}
|
||||
|
||||
|
||||
@ -222,14 +222,20 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
slots[13] = output;
|
||||
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
|
||||
slots[13].stackTagCompound.removeTag("ntmContagion");
|
||||
if(slots[13].stackTagCompound.hasNoTags()) {
|
||||
slots[13].stackTagCompound = null;
|
||||
}
|
||||
} else if(slots[13].isItemEqual(output) && slots[13].stackSize + output.stackSize <= slots[13].getMaxStackSize()) {
|
||||
slots[12].stackSize -= output.stackSize;
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
|
||||
slots[13].stackSize += output.stackSize;
|
||||
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
|
||||
slots[13].stackTagCompound.removeTag("ntmContagion");
|
||||
if(slots[13].stackTagCompound.hasNoTags()) {
|
||||
slots[13].stackTagCompound = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,14 +125,16 @@ public class TileEntityTesla extends TileEntityMachineBase implements IEnergyUse
|
||||
continue;
|
||||
}
|
||||
|
||||
if(e instanceof EntityCreeper) {
|
||||
((EntityCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
|
||||
ret.add(new double[] {e.posX, e.posY + e.height / 2, e.posZ});
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!(e instanceof EntityPlayer && ArmorUtil.checkForFaraday((EntityPlayer)e)))
|
||||
if(e.attackEntityFrom(ModDamageSource.electricity, MathHelper.clamp_float(e.getMaxHealth() * 0.5F, 3, 20) / (float)targets.size()))
|
||||
worldObj.playSoundAtEntity(e, "hbm:weapon.tesla", 1.0F, 1.0F);
|
||||
|
||||
if(e instanceof EntityCreeper) {
|
||||
((EntityCreeper)e).getDataWatcher().updateObject(17, Byte.valueOf((byte)1));
|
||||
}
|
||||
|
||||
double offset = 0;
|
||||
|
||||
if(source != null && e instanceof EntityPlayer && worldObj.isRemote)
|
||||
|
||||
@ -133,8 +133,8 @@ public class TileEntityMachineCatalyticReformer extends TileEntityMachineBase im
|
||||
new DirPos(xCoord + dir.offsetX * 2 - rot.offsetX, yCoord, zCoord + dir.offsetZ * 2 - rot.offsetZ, dir),
|
||||
new DirPos(xCoord - dir.offsetX * 2 + rot.offsetX, yCoord, zCoord - dir.offsetZ * 2 + rot.offsetZ, dir.getOpposite()),
|
||||
new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ, dir.getOpposite()),
|
||||
new DirPos(xCoord + rot.offsetX * 3, yCoord, zCoord + rot.offsetZ * 3, dir),
|
||||
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, dir)
|
||||
new DirPos(xCoord + rot.offsetX * 3, yCoord, zCoord + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,286 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.container.ContainerMachineCoker;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMachineCoker;
|
||||
import com.hbm.inventory.recipes.CokerRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineCoker extends TileEntityMachineBase implements IFluidStandardTransceiver, IGUIProvider {
|
||||
|
||||
public boolean wasOn;
|
||||
public int progress;
|
||||
public static int processTime = 20_000;
|
||||
|
||||
public int heat;
|
||||
public static int maxHeat = 100_000;
|
||||
public static double diffusion = 0.25D;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityMachineCoker() {
|
||||
super(2);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.HEAVYOIL, 16_000);
|
||||
tanks[1] = new FluidTank(Fluids.OIL_COKER, 8_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineCoker";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.tryPullHeat();
|
||||
this.tanks[0].setType(0, slots);
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
this.wasOn = false;
|
||||
|
||||
if(canProcess()) {
|
||||
int burn = heat / 100;
|
||||
|
||||
if(burn > 0) {
|
||||
this.wasOn = true;
|
||||
this.progress += burn;
|
||||
this.heat -= burn;
|
||||
|
||||
if(progress >= processTime) {
|
||||
this.markChanged();
|
||||
progress -= this.processTime;
|
||||
|
||||
Triplet<Integer, ItemStack, FluidStack> recipe = CokerRecipes.getOutput(tanks[0].getTankType());
|
||||
int fillReq = recipe.getX();
|
||||
ItemStack output = recipe.getY();
|
||||
FluidStack byproduct = recipe.getZ();
|
||||
|
||||
if(output != null) {
|
||||
if(slots[1] == null) {
|
||||
slots[1] = output.copy();
|
||||
} else {
|
||||
slots[1].stackSize += output.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
if(byproduct != null) {
|
||||
tanks[1].setFill(tanks[1].getFill() + byproduct.fill);
|
||||
}
|
||||
|
||||
tanks[0].setFill(tanks[0].getFill() - fillReq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
if(this.tanks[1].getFill() > 0) this.sendFluid(tanks[1].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("wasOn", this.wasOn);
|
||||
data.setInteger("heat", this.heat);
|
||||
data.setInteger("progress", this.progress);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
this.networkPack(data, 25);
|
||||
} else {
|
||||
|
||||
if(this.wasOn) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 2 == 0) {
|
||||
NBTTagCompound fx = new NBTTagCompound();
|
||||
fx.setString("type", "tower");
|
||||
fx.setFloat("lift", 10F);
|
||||
fx.setFloat("base", 0.75F);
|
||||
fx.setFloat("max", 3F);
|
||||
fx.setInteger("life", 200 + worldObj.rand.nextInt(50));
|
||||
fx.setInteger("color",0x404040);
|
||||
fx.setDouble("posX", xCoord + 0.5);
|
||||
fx.setDouble("posY", yCoord + 22);
|
||||
fx.setDouble("posZ", zCoord + 0.5);
|
||||
MainRegistry.proxy.effectNT(fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 2, yCoord, zCoord + 1, Library.POS_X),
|
||||
new DirPos(xCoord + 2, yCoord, zCoord - 1, Library.POS_X),
|
||||
new DirPos(xCoord - 2, yCoord, zCoord + 1, Library.NEG_X),
|
||||
new DirPos(xCoord - 2, yCoord, zCoord - 1, Library.NEG_X),
|
||||
new DirPos(xCoord + 1, yCoord, zCoord + 2, Library.POS_Z),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord + 2, Library.POS_Z),
|
||||
new DirPos(xCoord + 1, yCoord, zCoord - 2, Library.NEG_Z),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord - 2, Library.NEG_Z)
|
||||
};
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
Triplet<Integer, ItemStack, FluidStack> recipe = CokerRecipes.getOutput(tanks[0].getTankType());
|
||||
|
||||
if(recipe == null) return false;
|
||||
|
||||
int fillReq = recipe.getX();
|
||||
ItemStack output = recipe.getY();
|
||||
FluidStack byproduct = recipe.getZ();
|
||||
|
||||
if(byproduct != null) tanks[1].setTankType(byproduct.type);
|
||||
|
||||
if(tanks[0].getFill() < fillReq) return false;
|
||||
if(byproduct != null && byproduct.fill + tanks[1].getFill() > tanks[1].getMaxFill()) return false;
|
||||
|
||||
if(output != null && slots[1] != null) {
|
||||
if(output.getItem() != slots[1].getItem()) return false;
|
||||
if(output.getItemDamage() != slots[1].getItemDamage()) return false;
|
||||
if(output.stackSize + slots[1].stackSize > output.getMaxStackSize()) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.wasOn = nbt.getBoolean("wasOn");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
tanks[0].readFromNBT(nbt, "t0");
|
||||
tanks[1].readFromNBT(nbt, "t1");
|
||||
}
|
||||
|
||||
protected void tryPullHeat() {
|
||||
|
||||
if(this.heat >= this.maxHeat) return;
|
||||
|
||||
TileEntity con = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
|
||||
if(con instanceof IHeatSource) {
|
||||
IHeatSource source = (IHeatSource) con;
|
||||
int diff = source.getHeatStored() - this.heat;
|
||||
|
||||
if(diff == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(diff > 0) {
|
||||
diff = (int) Math.ceil(diff * diffusion);
|
||||
source.useUpHeat(diff);
|
||||
this.heat += diff;
|
||||
if(this.heat > this.maxHeat)
|
||||
this.heat = this.maxHeat;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.heat = Math.max(this.heat - Math.max(this.heat / 1000, 1), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] { 1 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.tanks[0].readFromNBT(nbt, "t0");
|
||||
this.tanks[1].readFromNBT(nbt, "t1");
|
||||
this.progress = nbt.getInteger("prog");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
this.tanks[0].writeToNBT(nbt, "t0");
|
||||
this.tanks[1].writeToNBT(nbt, "t1");
|
||||
nbt.setInteger("prog", progress);
|
||||
nbt.setInteger("heat", heat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] { tanks[1] };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tanks[0] };
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 2,
|
||||
yCoord,
|
||||
zCoord - 2,
|
||||
xCoord + 3,
|
||||
yCoord + 23,
|
||||
zCoord + 3
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineCoker(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineCoker(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,5 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
@ -10,10 +8,14 @@ import com.hbm.items.machine.ItemRBMKRod;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -23,11 +25,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCraneConsole extends TileEntity implements INBTPacketReceiver, SimpleComponent {
|
||||
@ -341,7 +339,7 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
|
||||
return "rbmk_crane";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] move(Context context, Arguments args) {
|
||||
if(setUpCrane == true) {
|
||||
@ -371,7 +369,7 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
|
||||
return new Object[] {"Crane not found"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] load(Context context, Arguments args) {
|
||||
if (setUpCrane == true) {
|
||||
@ -381,7 +379,7 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
|
||||
return new Object[] {"Crane not found"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getDepletion(Context context, Arguments args) {
|
||||
if(loadedItem != null && loadedItem.getItem() instanceof ItemRBMKRod) {
|
||||
@ -390,7 +388,7 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getXenonPoison(Context context, Arguments args) {
|
||||
if(loadedItem != null && loadedItem.getItem() instanceof ItemRBMKRod) {
|
||||
|
||||
@ -2,8 +2,14 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
public class TileEntityRBMKAbsorber extends TileEntityRBMKBase {
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKAbsorber extends TileEntityRBMKBase implements SimpleComponent {
|
||||
|
||||
@Override
|
||||
public void onMelt(int reduce) {
|
||||
@ -17,6 +23,24 @@ public class TileEntityRBMKAbsorber extends TileEntityRBMKBase {
|
||||
super.onMelt(reduce);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "rbmk_absorber_rod";
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnType getConsoleType() {
|
||||
return ColumnType.ABSORBER;
|
||||
|
||||
@ -1,14 +1,8 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import api.hbm.fluid.IFluidConductor;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import api.hbm.fluid.IPipeNet;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.entity.effect.EntitySpear;
|
||||
@ -25,10 +19,6 @@ import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.fluid.IFluidConductor;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import api.hbm.fluid.IPipeNet;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -46,6 +36,9 @@ import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Base class for all RBMK components, active or passive. Handles heat and the explosion sequence
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.fluid.IFluidUser;
|
||||
import api.hbm.fluid.IPipeNet;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
@ -16,10 +16,6 @@ import com.hbm.inventory.gui.GUIRBMKBoiler;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.fluid.IFluidUser;
|
||||
import api.hbm.fluid.IPipeNet;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -34,6 +30,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent {
|
||||
|
||||
@ -333,35 +332,41 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
return "rbmk_boiler";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getSteam(Context context, Arguments args) {
|
||||
return new Object[] {steam.getFill()};
|
||||
}
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getSteamMax(Context context, Arguments args) {
|
||||
return new Object[] {steam.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getWater(Context context, Arguments args) {
|
||||
return new Object[] {feed.getFill()};
|
||||
}
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getWaterMax(Context context, Arguments args) {
|
||||
return new Object[] {feed.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
FluidType type = steam.getTankType();
|
||||
@ -370,11 +375,11 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
else if(type == Fluids.HOTSTEAM) {type_1 = "1";}
|
||||
else if(type == Fluids.SUPERHOTSTEAM) {type_1 = "2";}
|
||||
else if(type == Fluids.ULTRAHOTSTEAM) {type_1 = "3";}
|
||||
else {type_1 = "Unknown Error";}
|
||||
return new Object[] {heat, steam.getFill(), steam.getMaxFill(), feed.getFill(), feed.getMaxFill(), type_1};
|
||||
else {type_1 = "Steam out-of-bounds";}
|
||||
return new Object[] {heat, steam.getFill(), steam.getMaxFill(), feed.getFill(), feed.getMaxFill(), type_1, xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getSteamType(Context context, Arguments args) {
|
||||
FluidType type = steam.getTankType();
|
||||
@ -385,6 +390,8 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
else {return new Object[] {"Unknown Error"};}
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setSteamType(Context context, Arguments args) {
|
||||
int type = args.checkInteger(0);
|
||||
if(type > 3) {
|
||||
|
||||
@ -1,16 +1,14 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase implements SimpleComponent {
|
||||
@ -128,32 +126,37 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase im
|
||||
return "rbmk_control_rod";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getLevel(Context context, Arguments args) {
|
||||
return new Object[] {getMult() * 100};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTargetLevel(Context context, Arguments args) {
|
||||
return new Object[] {targetLevel * 100};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, getMult() * 100, targetLevel * 100};
|
||||
return new Object[] {heat, getMult() * 100, targetLevel * 100, xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setLevel(Context context, Arguments args) {
|
||||
double newLevel = args.checkDouble(0)/100.0;
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -9,16 +7,17 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent {
|
||||
@ -150,27 +149,33 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
return "rbmk_cooler";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[]{heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryo(Context context, Arguments args) {
|
||||
return new Object[]{tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryoMax(Context context, Arguments args) {
|
||||
return new Object[]{tank.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{heat, tank.getFill(), tank.getMaxFill()};
|
||||
return new Object[]{heat, tank.getFill(), tank.getMaxFill(), xCoord, yCoord, zCoord};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -18,20 +16,21 @@ import com.hbm.inventory.gui.GUIRBMKHeater;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, SimpleComponent {
|
||||
@ -281,51 +280,57 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
return "rbmk_heater";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFill(Context context, Arguments args) {
|
||||
return new Object[] {feed.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFillMax(Context context, Arguments args) {
|
||||
return new Object[] {feed.getMaxFill()};
|
||||
}
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getExport(Context context, Arguments args) {
|
||||
return new Object[] {steam.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getExportMax(Context context, Arguments args) {
|
||||
return new Object[] {steam.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFillType(Context context, Arguments args) {
|
||||
return new Object[] {feed.getTankType().getID()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getExportType(Context context, Arguments args) {
|
||||
return new Object[] {steam.getTankType().getID()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, feed.getFill(), feed.getMaxFill(), steam.getFill(), steam.getMaxFill(), feed.getTankType().getID(), steam.getTankType().getID()};
|
||||
return new Object[] {heat, feed.getFill(), feed.getMaxFill(), steam.getFill(), steam.getMaxFill(), feed.getTankType().getID(), steam.getTankType().getID(), xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
@ -12,8 +13,6 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -227,28 +226,34 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
|
||||
return "rbmk_outgasser";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getGas(Context context, Arguments args) {
|
||||
return new Object[] {gas.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getGasMax(Context context, Arguments args) {
|
||||
return new Object[] {gas.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getProgress(Context context, Arguments args) {
|
||||
return new Object[] {progress};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {gas.getFill(), gas.getMaxFill(), progress};
|
||||
return new Object[] {gas.getFill(), gas.getMaxFill(), progress, xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -2,8 +2,14 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
public class TileEntityRBMKReflector extends TileEntityRBMKBase {
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKReflector extends TileEntityRBMKBase implements SimpleComponent {
|
||||
|
||||
@Override
|
||||
public void onMelt(int reduce) {
|
||||
@ -16,6 +22,22 @@ public class TileEntityRBMKReflector extends TileEntityRBMKBase {
|
||||
|
||||
super.onMelt(reduce);
|
||||
}
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "rbmk_reflector_rod";
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnType getConsoleType() {
|
||||
|
||||
@ -11,7 +11,6 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemRBMKRod;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -385,25 +384,25 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
return "rbmk_fuel_rod";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluxSlow(Context context, Arguments args) {
|
||||
return new Object[] {fluxSlow};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluxFast(Context context, Arguments args) {
|
||||
return new Object[] {fluxFast};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getDepletion(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
@ -412,7 +411,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getXenonPoison(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
@ -421,7 +420,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoreHeat(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
@ -430,7 +429,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getSkinHeat(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
@ -439,7 +438,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
Object OC_enrich_buf;
|
||||
@ -451,7 +450,19 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
OC_enrich_buf = "N/A";
|
||||
OC_poison_buf = "N/A";
|
||||
}
|
||||
return new Object[] {heat, fluxSlow, fluxFast, OC_enrich_buf, OC_poison_buf};
|
||||
return new Object[] {heat, fluxSlow, fluxFast, OC_enrich_buf, OC_poison_buf, ((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getModerated(Context context, Arguments args) {
|
||||
return new Object[] {((RBMKRod)this.getBlockType()).moderated};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -4,16 +4,21 @@ import com.hbm.inventory.container.ContainerRBMKStorage;
|
||||
import com.hbm.inventory.gui.GUIRBMKStorage;
|
||||
import com.hbm.items.machine.ItemRBMKRod;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityRBMKStorage extends TileEntityRBMKSlottedBase implements IRBMKLoadable {
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKStorage extends TileEntityRBMKSlottedBase implements IRBMKLoadable, SimpleComponent {
|
||||
|
||||
public TileEntityRBMKStorage() {
|
||||
super(12);
|
||||
@ -86,6 +91,35 @@ public class TileEntityRBMKStorage extends TileEntityRBMKSlottedBase implements
|
||||
slots[0] = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "rbmk_storage_rod";
|
||||
}
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCoordinates(Context context, Arguments args) {
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getStored(Context context, Arguments args) {
|
||||
return new Object[] {slots[0], slots[1], slots[2], slots[3], slots[4], slots[5], slots[6], slots[7], slots[8], slots[9], slots[10], slots[11]};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, slots[0], slots[1], slots[2], slots[3], slots[4], slots[5], slots[6], slots[7], slots[8], slots[9], slots[10], slots[11], xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerRBMKStorage(player.inventory, this);
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import api.hbm.fluid.*;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
@ -21,14 +17,13 @@ import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidConductor;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.fluid.IPipeNet;
|
||||
import api.hbm.fluid.PipeNet;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -39,7 +34,13 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, IPersistentNBT, IGUIProvider {
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource, SimpleComponent, IFluidStandardTransceiver, IPersistentNBT, IGUIProvider {
|
||||
|
||||
public FluidTank tank;
|
||||
public short mode = 0;
|
||||
@ -349,4 +350,33 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIBarrel(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "ntm_fluid_tank";
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluidStored(Context context, Arguments args) {
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxStored(Context context, Arguments args) {
|
||||
return new Object[] {tank.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTypeStored(Context context, Arguments args) {
|
||||
return new Object[] {tank.getTankType().getName()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{tank.getFill(), tank.getMaxFill(), tank.getTankType().getName()};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import api.hbm.energy.*;
|
||||
import com.hbm.blocks.machine.MachineBattery;
|
||||
import com.hbm.inventory.container.ContainerMachineBattery;
|
||||
import com.hbm.inventory.gui.GUIMachineBattery;
|
||||
@ -12,13 +8,6 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.energy.IPowerNet;
|
||||
import api.hbm.energy.PowerNet;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -36,6 +25,11 @@ import net.minecraft.util.MathHelper;
|
||||
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.Set;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyUser, IPersistentNBT, SimpleComponent, IGUIProvider {
|
||||
|
||||
@ -379,19 +373,19 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
return "ntm_energy_storage"; // need a way to somehow detect the first word of the energy storage block so people wont get confused when it comes to multiple energy storage blocks
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEnergyStored(Context context, Arguments args) {
|
||||
return new Object[] {getPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxEnergy(Context context, Arguments args) {
|
||||
return new Object[] {getMaxPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {getPower(), getMaxPower()};
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
@ -35,11 +32,14 @@ import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -50,7 +50,12 @@ import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineFluidTank extends TileEntityMachineBase implements IFluidContainer, IFluidSource, IFluidAcceptor, IFluidStandardTransceiver, IPersistentNBT, IOverpressurable, IGUIProvider, IRepairable {
|
||||
import java.util.ArrayList;
|
||||
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 IFluidContainer, SimpleComponent, IFluidSource, IFluidAcceptor, IFluidStandardTransceiver, IPersistentNBT, IOverpressurable, IGUIProvider, IRepairable {
|
||||
|
||||
public FluidTank tank;
|
||||
public short mode = 0;
|
||||
@ -438,4 +443,33 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
this.hasExploded = false;
|
||||
this.markChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "ntm_tank";
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluidStored(Context context, Arguments args) {
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxStored(Context context, Arguments args) {
|
||||
return new Object[] {tank.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTypeStored(Context context, Arguments args) {
|
||||
return new Object[] {tank.getTankType().getName()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{tank.getFill(), tank.getMaxFill(), tank.getTankType().getName()};
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user