mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'upstream/master' into Optimization
# Conflicts: # src/main/java/com/hbm/tileentity/bomb/TileEntityNukeBalefire.java # src/main/java/com/hbm/tileentity/machine/TileEntityAshpit.java # src/main/java/com/hbm/tileentity/machine/TileEntityChungus.java # src/main/java/com/hbm/tileentity/machine/TileEntityCondenser.java # src/main/java/com/hbm/tileentity/machine/TileEntityCore.java # src/main/java/com/hbm/tileentity/machine/TileEntityDiFurnace.java # src/main/java/com/hbm/tileentity/machine/TileEntityDiFurnaceRTG.java # src/main/java/com/hbm/tileentity/machine/TileEntityElectrolyser.java # src/main/java/com/hbm/tileentity/machine/TileEntityFurnaceIron.java # src/main/java/com/hbm/tileentity/machine/TileEntityFurnaceSteel.java # src/main/java/com/hbm/tileentity/machine/TileEntityHeatBoiler.java # src/main/java/com/hbm/tileentity/machine/TileEntityHeatBoilerIndustrial.java # src/main/java/com/hbm/tileentity/machine/TileEntityHeaterHeatex.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutosaw.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineDiesel.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineEPress.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineHephaestus.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineMixer.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachinePlasmaHeater.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachinePress.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachinePumpBase.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadGen.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadiolysis.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineSchrabidiumTransmutator.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineSolderingStation.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineStrandCaster.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbofan.java # src/main/java/com/hbm/tileentity/machine/TileEntitySoyuzLauncher.java # src/main/java/com/hbm/tileentity/machine/TileEntitySteamEngine.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCatalyticCracker.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCatalyticReformer.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCoker.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineGasFlare.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineLiquefactor.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineRefinery.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineSolidifier.java # src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineVacuumDistill.java # src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKConsole.java # src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKControlAuto.java # src/main/java/com/hbm/tileentity/machine/storage/TileEntityMassStorage.java # src/main/java/com/hbm/tileentity/network/TileEntityCraneRouter.java # src/main/java/com/hbm/tileentity/network/TileEntityDroneCrate.java # src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java # src/main/java/com/hbm/tileentity/turret/TileEntityTurretFritz.java # src/main/java/com/hbm/tileentity/turret/TileEntityTurretMaxwell.java # src/main/java/com/hbm/tileentity/turret/TileEntityTurretRichard.java # src/main/java/com/hbm/tileentity/turret/TileEntityTurretSentry.java # src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java
This commit is contained in:
commit
e7b5240a9d
16
.editorconfig
Normal file
16
.editorconfig
Normal file
@ -0,0 +1,16 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = crlf
|
||||
indent_style = tab
|
||||
indent_size = tab
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
max_line_length = off
|
||||
|
||||
[{*.info,*.json,*.mcmeta,*.md,*.cfg,*.yml,*.toml}]
|
||||
tab_width = 2
|
||||
|
||||
[{*.info,*.mcmeta,*.cfg}]
|
||||
end_of_line = lf
|
||||
16
changelog
16
changelog
@ -1,6 +1,16 @@
|
||||
## Changed
|
||||
* Most loot piles now have configurable loot pools
|
||||
* The ambient radiation generator's functionality and recipe have been disabled as it is being deprecated
|
||||
* The pyrolysis oven is now compatible with overdrive upgrades
|
||||
* Steel walls and corners no longer use TESRs for rendering, making them more performant at large scale and fixing any oddities regarding their rendering
|
||||
* Steel walls and corners can now be rotated using the screwdriver (right click for clockwise, shift click for counter-clockwise)
|
||||
* Steel walls and corners now use new textures as well as slightly cleaner models
|
||||
* Steel corner bounding boxes now closely match their model
|
||||
|
||||
## Fixed
|
||||
* Fixed some things not using variable max charge for armor mods, like static pads and DNT nanosuit tooltips
|
||||
* Fixed arc furnace recipe config parser breaking when reading fluid recipes
|
||||
* Fixed crash caused by the pyrolysis oven on servers
|
||||
* Due this type of issue happening constantly, the GUI provider system no longer uses any client-only code
|
||||
* Fixed small black bar rendering under the arrow box of NEI universal handlers when using the NH NEI fork
|
||||
* Fixed desh screwdrivers not being usable for picking locks
|
||||
* Possibly fixed an issue caused by MouseTweaks (in combination with other mods) duplicating click input (I can't replicate the issue so I can at best guess)
|
||||
* Fixed pyrolysis ovens not being able to operate due to the output buffer being full, despite the buffer being a different type
|
||||
* Fixed a vanilla bug in the standard block renderer causing boxduct bends to have incorrect UV on the -Z and +X sides
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5082
|
||||
mod_build_number=5091
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.handler.ThreeInts;
|
||||
import com.hbm.interfaces.ICopiable;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
|
||||
@ -32,7 +33,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight {
|
||||
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight, ICopiable {
|
||||
|
||||
public BlockDummyable(Material mat) {
|
||||
super(mat);
|
||||
@ -507,4 +508,31 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(meta - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
ICustomBlockHighlight.cleanup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getSettings(World world, int x, int y, int z) {
|
||||
int[] pos = findCore(world, x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (tile instanceof ICopiable)
|
||||
return ((ICopiable) tile).getSettings(world, pos[0], pos[1], pos[2]);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
int[] pos = findCore(world, x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (tile instanceof ICopiable)
|
||||
((ICopiable) tile).pasteSettings(nbt, index, world, player, pos[0], pos[1], pos[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] infoForDisplay(World world, int x, int y, int z) {
|
||||
int[] pos = findCore(world, x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (tile instanceof ICopiable)
|
||||
return ((ICopiable) tile).infoForDisplay(world, x, y, z);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,6 +407,7 @@ public class ModBlocks {
|
||||
public static Block steel_scaffold;
|
||||
public static Block steel_grate;
|
||||
public static Block steel_grate_wide;
|
||||
public static Block scaffold_dynamic;
|
||||
|
||||
public static Block deco_pipe;
|
||||
public static Block deco_pipe_rusted;
|
||||
@ -943,6 +944,7 @@ public class ModBlocks {
|
||||
public static Block machine_catalytic_reformer;
|
||||
public static Block machine_hydrotreater;
|
||||
public static Block machine_coker;
|
||||
public static Block machine_pyrooven;
|
||||
|
||||
public static Block machine_boiler_off;
|
||||
|
||||
@ -1573,12 +1575,13 @@ public class ModBlocks {
|
||||
pole_top = new DecoPoleTop(Material.iron).setBlockName("pole_top").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_pole_top");
|
||||
pole_satellite_receiver = new DecoPoleSatelliteReceiver(Material.iron).setBlockName("pole_satellite_receiver").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_satellite_receiver");
|
||||
steel_wall = new DecoBlock(Material.iron).setBlockName("steel_wall").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_wall");
|
||||
steel_corner = new DecoBlock(Material.iron).setBlockName("steel_corner").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_corner");
|
||||
steel_corner = new DecoBlock(Material.iron).setBlockName("steel_corner").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_wall");
|
||||
steel_roof = new DecoBlock(Material.iron).setBlockName("steel_roof").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_roof");
|
||||
steel_beam = new DecoBlock(Material.iron).setBlockName("steel_beam").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam");
|
||||
steel_scaffold = new BlockScaffold().setBlockName("steel_scaffold").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_steel_orig");
|
||||
steel_grate = new BlockGrate(Material.iron).setBlockName("steel_grate").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
|
||||
steel_grate_wide = new BlockGrate(Material.iron).setBlockName("steel_grate_wide").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
|
||||
scaffold_dynamic = new BlockScaffoldDynamic().setBlockName("scaffold_dynamic").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
deco_pipe = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 0).setBlockName("deco_pipe").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 0).setBlockName("deco_pipe_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
@ -2080,7 +2083,6 @@ public class ModBlocks {
|
||||
turret_howard_damaged = new TurretHowardDamaged(Material.iron).setBlockName("turret_howard_damaged").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_rust");
|
||||
turret_maxwell = new TurretMaxwell(Material.iron).setBlockName("turret_maxwell").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_fritz = new TurretFritz(Material.iron).setBlockName("turret_fritz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
//turret_brandon = new TurretBrandon(Material.iron).setBlockName("turret_brandon").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_arty = new TurretArty(Material.iron).setBlockName("turret_arty").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_himars = new TurretHIMARS(Material.iron).setBlockName("turret_himars").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_sentry = new TurretSentry().setBlockName("turret_sentry").setHardness(5.0F).setResistance(5.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2164,6 +2166,7 @@ public class ModBlocks {
|
||||
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_hydrotreater = new MachineHydrotreater(Material.iron).setBlockName("machine_hydrotreater").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_pyrooven = new MachinePyroOven(Material.iron).setBlockName("machine_pyrooven").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_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_ore_slopper = new MachineOreSlopper().setBlockName("machine_ore_slopper").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2733,6 +2736,7 @@ public class ModBlocks {
|
||||
register(steel_scaffold);
|
||||
GameRegistry.registerBlock(steel_grate, steel_grate.getUnlocalizedName());
|
||||
register(steel_grate_wide);
|
||||
register(scaffold_dynamic);
|
||||
GameRegistry.registerBlock(deco_pipe, ItemBlockBase.class, deco_pipe.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_pipe_rusted, ItemBlockBase.class, deco_pipe_rusted.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_pipe_green, ItemBlockBase.class, deco_pipe_green.getUnlocalizedName());
|
||||
@ -3228,6 +3232,7 @@ public class ModBlocks {
|
||||
register(machine_catalytic_reformer);
|
||||
register(machine_hydrotreater);
|
||||
register(machine_coker);
|
||||
register(machine_pyrooven);
|
||||
register(machine_autosaw);
|
||||
register(machine_excavator);
|
||||
register(machine_ore_slopper);
|
||||
|
||||
@ -9,7 +9,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@ -227,7 +226,7 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenBobble((TileEntityBobble) world.getTileEntity(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
270
src/main/java/com/hbm/blocks/generic/BlockScaffoldDynamic.java
Normal file
270
src/main/java/com/hbm/blocks/generic/BlockScaffoldDynamic.java
Normal file
@ -0,0 +1,270 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import static com.hbm.blocks.generic.BlockScaffoldDynamic.TileEntityScaffoldDynamic.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemBlowtorch;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockScaffoldDynamic extends BlockContainer implements IToolable, ILookOverlay {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconPoleTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconPoleSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconGrateTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconGrateSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBarTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBarSide;
|
||||
|
||||
public static int renderMode;
|
||||
|
||||
public BlockScaffoldDynamic() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
public static int renderIDScaffold = RenderingRegistry.getNextAvailableRenderId();
|
||||
@Override public int getRenderType(){ return renderIDScaffold; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityScaffoldDynamic();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(renderMode == 0) return side == 0 || side == 1 ? iconPoleTop : iconPoleSide;
|
||||
if(renderMode == 1) return side == 0 || side == 1 ? iconGrateTop : iconGrateSide;
|
||||
if(renderMode == 2) return side == 0 || side == 1 ? iconBarTop : iconBarSide;
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.iconPoleTop = reg.registerIcon(RefStrings.MODID + ":scaffold_pole_top");
|
||||
this.iconPoleSide = reg.registerIcon(RefStrings.MODID + ":scaffold_pole_side");
|
||||
this.iconGrateTop = reg.registerIcon(RefStrings.MODID + ":scaffold_grate_top");
|
||||
this.iconGrateSide = reg.registerIcon(RefStrings.MODID + ":scaffold_grate_side");
|
||||
this.iconBarTop = reg.registerIcon(RefStrings.MODID + ":scaffold_bar_top");
|
||||
this.iconBarSide = reg.registerIcon(RefStrings.MODID + ":scaffold_bar_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
TileEntityScaffoldDynamic tile = (TileEntityScaffoldDynamic) world.getTileEntity(x, y, z);
|
||||
if(tool == ToolType.SCREWDRIVER) {
|
||||
tile.locked = !tile.locked;
|
||||
tile.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(tool != ToolType.TORCH) return false;
|
||||
|
||||
|
||||
int part = getPartFromCoord(fX, fY, fZ);
|
||||
|
||||
if(part != 0 && tile.canToggle(part)) {
|
||||
tile.toggle(part);
|
||||
tile.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getPartFromCoord(float fX, float fY, float fZ) {
|
||||
if(fX < 0.25 && fZ < 0.25) return POLE_NX_NZ;
|
||||
if(fX > 0.75 && fZ < 0.25) return POLE_PX_NZ;
|
||||
if(fX > 0.75 && fZ > 0.75) return POLE_PX_PZ;
|
||||
if(fX < 0.25 && fZ > 0.75) return POLE_NX_PZ;
|
||||
|
||||
if(fY == 0 && fX < 0.25) return BAR_LOWER_NEG_X;
|
||||
if(fY == 0 && fX > 0.75) return BAR_LOWER_POS_X;
|
||||
if(fY == 0 && fZ < 0.25) return BAR_LOWER_NEG_Z;
|
||||
if(fY == 0 && fZ > 0.75) return BAR_LOWER_POS_Z;
|
||||
if(fY == 1 && fX < 0.25) return BAR_UPPER_NEG_X;
|
||||
if(fY == 1 && fX > 0.75) return BAR_UPPER_POS_X;
|
||||
if(fY == 1 && fZ < 0.25) return BAR_UPPER_NEG_Z;
|
||||
if(fY == 1 && fZ > 0.75) return BAR_UPPER_POS_Z;
|
||||
|
||||
if(fY < 0.125) return GRATE_LOWER;
|
||||
if(fY > 0.875) return GRATE_UPPER;
|
||||
|
||||
if(fX == 0 && fY < 0.5) return BAR_LOWER_NEG_X;
|
||||
if(fX == 1 && fY < 0.5) return BAR_LOWER_POS_X;
|
||||
if(fZ == 0 && fY < 0.5) return BAR_LOWER_NEG_Z;
|
||||
if(fZ == 1 && fY < 0.5) return BAR_LOWER_POS_Z;
|
||||
if(fX == 0 && fY > 0.5) return BAR_UPPER_NEG_X;
|
||||
if(fX == 1 && fY > 0.5) return BAR_UPPER_POS_X;
|
||||
if(fZ == 0 && fY > 0.5) return BAR_UPPER_NEG_Z;
|
||||
if(fZ == 1 && fY > 0.5) return BAR_UPPER_POS_Z;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//ttoo lazy to make an itemblock just to provide this in the one method that needs it
|
||||
public static float lastFX;
|
||||
public static float lastFY;
|
||||
public static float lastFZ;
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
|
||||
lastFX = fX;
|
||||
lastFY = fY;
|
||||
lastFZ = fZ;
|
||||
|
||||
if(side == Library.POS_X.ordinal()) lastFX = 0;
|
||||
if(side == Library.NEG_X.ordinal()) lastFX = 1;
|
||||
if(side == Library.POS_Z.ordinal()) lastFZ = 0;
|
||||
if(side == Library.NEG_Z.ordinal()) lastFZ = 1;
|
||||
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
TileEntityScaffoldDynamic tile = (TileEntityScaffoldDynamic) world.getTileEntity(x, y, z);
|
||||
|
||||
// DEFAUL: POLES
|
||||
if(stack.getItemDamage() == 0) {
|
||||
if(lastFX < 0.5 && lastFZ < 0.5) tile.toggle(tile.POLE_NX_NZ);
|
||||
if(lastFX >= 0.5 && lastFZ < 0.5) tile.toggle(tile.POLE_PX_NZ);
|
||||
if(lastFX < 0.5 && lastFZ >= 0.5) tile.toggle(tile.POLE_NX_PZ);
|
||||
if(lastFX >= 0.5 && lastFZ >= 0.5) tile.toggle(tile.POLE_PX_PZ);
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileEntityScaffoldDynamic extends TileEntity {
|
||||
|
||||
public int composite;
|
||||
public int prevComposite;
|
||||
public boolean locked;
|
||||
public static final int BAR_LOWER_POS_X = (1 << 0);
|
||||
public static final int BAR_LOWER_NEG_X = (1 << 1);
|
||||
public static final int BAR_LOWER_POS_Z = (1 << 2);
|
||||
public static final int BAR_LOWER_NEG_Z = (1 << 3);
|
||||
public static final int BAR_UPPER_POS_X = (1 << 4);
|
||||
public static final int BAR_UPPER_NEG_X = (1 << 5);
|
||||
public static final int BAR_UPPER_POS_Z = (1 << 6);
|
||||
public static final int BAR_UPPER_NEG_Z = (1 << 7);
|
||||
public static final int POLE_PX_PZ = (1 << 8);
|
||||
public static final int POLE_PX_NZ = (1 << 9);
|
||||
public static final int POLE_NX_PZ = (1 << 10);
|
||||
public static final int POLE_NX_NZ = (1 << 11);
|
||||
public static final int GRATE_LOWER = (1 << 12);
|
||||
public static final int GRATE_UPPER = (1 << 13);
|
||||
|
||||
public boolean canToggle(int part) { return !locked && (composite ^ part) != 0; }
|
||||
public void toggle(int part) { this.composite ^= part; System.out.println("" + this.composite); }
|
||||
public boolean has(int part) { return (this.composite & part) != 0; }
|
||||
|
||||
@Override
|
||||
public void updateEntity() { }
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.composite = nbt.getInteger("c");
|
||||
this.prevComposite = nbt.getInteger("p");
|
||||
this.locked = nbt.getBoolean("l");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("c", composite);
|
||||
nbt.setInteger("p", prevComposite);
|
||||
nbt.setBoolean("l", locked);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
ItemStack held = player.getHeldItem();
|
||||
|
||||
boolean holdsBlowtorch = held != null && held.getItem() instanceof ItemBlowtorch;
|
||||
boolean holdScrewdriver = held != null && (held.getItem() == ModItems.screwdriver || held.getItem() == ModItems.screwdriver_desh);
|
||||
|
||||
MovingObjectPosition mop = mc.objectMouseOver;
|
||||
|
||||
if(mop != null && mop.typeOfHit == mop.typeOfHit.BLOCK) {
|
||||
float fX = (float) (mop.hitVec.xCoord - x);
|
||||
float fY = (float) (mop.hitVec.yCoord - y);
|
||||
float fZ = (float) (mop.hitVec.zCoord - z);
|
||||
|
||||
TileEntityScaffoldDynamic tile = (TileEntityScaffoldDynamic) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null && tile.locked && (holdsBlowtorch || holdScrewdriver)) {
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.RED + "Locked!");
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
return;
|
||||
}
|
||||
|
||||
if(holdsBlowtorch) {
|
||||
String name = null;
|
||||
int part = getPartFromCoord(fX, fY, fZ);
|
||||
if(part <= (1 << 3)) name = "Lower Vertical Bar";
|
||||
else if(part <= (1 << 7)) name = "Upper Vertical Bar";
|
||||
else if(part <= (1 << 10)) name = "Pole";
|
||||
else if(part <= (1 << 13)) name = "Grate";
|
||||
|
||||
if(name != null) {
|
||||
List<String> text = new ArrayList();
|
||||
text.add("Toggle:");
|
||||
text.add(name);
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@ -193,7 +192,7 @@ public class BlockSnowglobe extends BlockContainer implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenSnowglobe((TileEntitySnowglobe) world.getTileEntity(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,19 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.tileentity.deco.TileEntityDecoBlock;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -17,7 +22,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DecoBlock extends BlockContainer {
|
||||
public class DecoBlock extends BlockContainer implements IToolable {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@ -25,20 +30,44 @@ public class DecoBlock extends BlockContainer {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if(tool != ToolType.SCREWDRIVER) return false;
|
||||
if(this != ModBlocks.steel_wall && this != ModBlocks.steel_corner) return false;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
if(meta == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 3);
|
||||
else if(meta == 4) world.setBlockMetadataWithNotify(x, y, z, 2, 3);
|
||||
else if(meta == 2) world.setBlockMetadataWithNotify(x, y, z, 5, 3);
|
||||
else if(meta == 5) world.setBlockMetadataWithNotify(x, y, z, 3, 3);
|
||||
} else {
|
||||
if(meta == 3) world.setBlockMetadataWithNotify(x, y, z, 5, 3);
|
||||
else if(meta == 4) world.setBlockMetadataWithNotify(x, y, z, 3, 3);
|
||||
else if(meta == 2) world.setBlockMetadataWithNotify(x, y, z, 4, 3);
|
||||
else if(meta == 5) world.setBlockMetadataWithNotify(x, y, z, 2, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
if(this == ModBlocks.steel_scaffold || this == ModBlocks.steel_beam) return null;
|
||||
if(this == ModBlocks.steel_scaffold || this == ModBlocks.steel_beam || this == ModBlocks.steel_wall || this == ModBlocks.steel_corner) return null;
|
||||
return new TileEntityDecoBlock();
|
||||
}
|
||||
|
||||
public static int renderIDBeam = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int renderIDWall = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int renderIDCorner = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
if(this == ModBlocks.steel_beam)
|
||||
return renderIDBeam;
|
||||
else
|
||||
return -1;
|
||||
if(this == ModBlocks.steel_wall) return renderIDWall;
|
||||
if(this == ModBlocks.steel_corner) return renderIDCorner;
|
||||
if(this == ModBlocks.steel_beam) return renderIDBeam;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,95 +89,23 @@ public class DecoBlock extends BlockContainer {
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
if(i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
if(i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {
|
||||
int te = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_);
|
||||
float f = 0.0625F;
|
||||
|
||||
if(this == ModBlocks.steel_wall) {
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(14 * f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 14 * f, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 2 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2 * f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_corner) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_roof) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1 * f, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_beam) {
|
||||
this.setBlockBounds(7 * f, 0.0F, 7 * f, 9 * f, 1.0F, 9 * f);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_scaffold) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
int te = world.getBlockMetadata(x, y, z);
|
||||
float f = 0.0625F;
|
||||
|
||||
if(this == ModBlocks.steel_wall) {
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(14 * f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 14 * f, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 2 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2 * f);
|
||||
break;
|
||||
case 4: this.setBlockBounds(14 * f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); break;
|
||||
case 2: this.setBlockBounds(0.0F, 0.0F, 14 * f, 1.0F, 1.0F, 1.0F); break;
|
||||
case 5: this.setBlockBounds(0.0F, 0.0F, 0.0F, 2 * f, 1.0F, 1.0F); break;
|
||||
case 3: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2 * f); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,21 +124,57 @@ public class DecoBlock extends BlockContainer {
|
||||
if(this == ModBlocks.steel_scaffold) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
case 4: this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F); break;
|
||||
case 2: this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f); break;
|
||||
case 5: this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F); break;
|
||||
case 3: this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity collider) {
|
||||
|
||||
if(this == ModBlocks.steel_corner) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
List<AxisAlignedBB> bbs = new ArrayList();
|
||||
|
||||
switch(meta) {
|
||||
case 2:
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.25D, y + 0D, z + 0.875D, x + 1D, y + 1D, z + 1D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0D, y + 0D, z + 0.75D, x + 0.25D, y + 1D, z + 1D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0D, y + 0D, z + 0D, x + 0.125D, y + 1D, z + 0.75D));
|
||||
break;
|
||||
case 3:
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0D, y + 0D, z + 0D, x + 0.75D, y + 1D, z + 0.125D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.75D, y + 0D, z + 0D, x + 1D, y + 1D, z + 0.25D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.875D, y + 0D, z + 0.25D, x + 1D, y + 1D, z + 1D));
|
||||
break;
|
||||
case 4:
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.875D, y + 0D, z + 0D, x + 1D, y + 1D, z + 0.75D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.75D, y + 0D, z + 0.75D, x + 1D, y + 1D, z + 1D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0D, y + 0D, z + 0.875D, x + 0.75D, y + 1D, z + 1D));
|
||||
break;
|
||||
case 5:
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0D, y + 0D, z + 0.25D, x + 0.125D, y + 1D, z + 1D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0D, y + 0D, z + 0D, x + 0.25D, y + 1D, z + 0.25D));
|
||||
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.25D, y + 0D, z + 0D, x + 1D, y + 1D, z + 0.125D));
|
||||
break;
|
||||
}
|
||||
|
||||
for(AxisAlignedBB bb : bbs) {
|
||||
if(aabb.intersectsWith(bb)) {
|
||||
list.add(bb);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, collider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -65,7 +64,7 @@ public class BlockArmorTable extends Block implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIArmorTable(player.inventory);
|
||||
}
|
||||
|
||||
|
||||
55
src/main/java/com/hbm/blocks/machine/MachinePyroOven.java
Normal file
55
src/main/java/com/hbm/blocks/machine/MachinePyroOven.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePyroOven;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachinePyroOven extends BlockDummyable {
|
||||
|
||||
public MachinePyroOven(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachinePyroOven();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().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 this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 3, 3, 2, 2};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@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;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
for(int i = -2; i <= 2; i++) {
|
||||
this.makeExtra(world, x + dir.offsetX * i + rot.offsetX * 2, y, z + dir.offsetZ * i + rot.offsetZ * 2);
|
||||
}
|
||||
|
||||
this.makeExtra(world, x - rot.offsetX, y + 2, z - rot.offsetZ);
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@ -192,7 +191,7 @@ public class NTMAnvil extends BlockFallingNT implements ITooltipProvider, IGUIPr
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIAnvil(player.inventory, ((NTMAnvil)world.getBlock(x, y, z)).tier);
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -102,7 +101,7 @@ public class RadioRec extends BlockContainer implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRadioRec)
|
||||
|
||||
@ -4,8 +4,11 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.IAnalyzable;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.HbmKeybinds;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.items.machine.ItemFluidIDMulti;
|
||||
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
||||
|
||||
import api.hbm.fluid.IPipeNet;
|
||||
@ -14,6 +17,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -36,13 +40,24 @@ public class FluidDuctBase extends BlockContainer implements IBlockFluidDuct, IA
|
||||
IItemFluidIdentifier id = (IItemFluidIdentifier) player.getHeldItem().getItem();
|
||||
FluidType type = id.getType(world, x, y, z, player.getHeldItem());
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
if(!HbmPlayerProps.getData(player).getKeyPressed(HbmKeybinds.EnumKeybind.TOOL_CTRL) && !player.isSneaking()) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityPipeBaseNT) {
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
||||
|
||||
|
||||
if(HbmPlayerProps.getData(player).getKeyPressed(HbmKeybinds.EnumKeybind.TOOL_ALT)) {
|
||||
Item item = player.getHeldItem().getItem();
|
||||
if (item instanceof ItemFluidIDMulti) {
|
||||
if (id.getType(world, x, y, z, player.getHeldItem()) != pipe.getType()) {
|
||||
ItemFluidIDMulti.setType(player.getHeldItem(), pipe.getType(), true);
|
||||
world.playSoundAtEntity(player, "random.orb", 0.25F, 0.75F);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(pipe.getType() != type) {
|
||||
pipe.setType(type);
|
||||
return true;
|
||||
@ -51,9 +66,21 @@ public class FluidDuctBase extends BlockContainer implements IBlockFluidDuct, IA
|
||||
} else {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
|
||||
if(te instanceof TileEntityPipeBaseNT) {
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
||||
|
||||
if(HbmPlayerProps.getData(player).getKeyPressed(HbmKeybinds.EnumKeybind.TOOL_ALT)) {
|
||||
Item item = player.getHeldItem().getItem();
|
||||
if (item instanceof ItemFluidIDMulti) {
|
||||
if (id.getType(world, x, y, z, player.getHeldItem()) != pipe.getType()) {
|
||||
ItemFluidIDMulti.setType(player.getHeldItem(), pipe.getType(), true);
|
||||
world.playSoundAtEntity(player, "random.orb", 0.25F, 0.75F);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
changeTypeRecursively(world, x, y, z, pipe.getType(), type, 64);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -15,7 +15,6 @@ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@ -56,7 +55,7 @@ public class RadioTorchCounter extends RadioTorchBase {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICounterTorch(player.inventory, (TileEntityRadioTorchCounter) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -74,7 +73,7 @@ public class RadioTorchLogic extends RadioTorchRWBase {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRadioTorchLogic)
|
||||
|
||||
@ -10,7 +10,6 @@ import com.hbm.util.I18nUtil;
|
||||
|
||||
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.tileentity.TileEntity;
|
||||
@ -51,7 +50,7 @@ public abstract class RadioTorchRWBase extends RadioTorchBase {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRadioTorchBase)
|
||||
|
||||
@ -183,6 +183,11 @@ public class ConsumableRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pads_slime, 1), new Object[] { "SPS", "DSD", "SPS", 'S', KEY_SLIME, 'P', ModItems.pads_rubber, 'D', ModItems.ducttape });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pads_static, 1), new Object[] { "CDC", "ISI", "CDC", 'C', CU.ingot(), 'D', ModItems.ducttape, 'I', ANY_RUBBER.ingot(), 'S', ModItems.pads_slime });
|
||||
|
||||
//Batteries
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.armor_battery, 1), new Object[] { "PCP", "PCP", "PCP", 'P', STEEL.plate(), 'C', ModBlocks.capacitor_gold });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.armor_battery_mk2, 1), new Object[] { "PCP", "PCP", "PCP", 'P', ANY_PLASTIC.ingot(), 'C', ModBlocks.capacitor_niobium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.armor_battery_mk3, 1), new Object[] { "PCP", "PCP", "PCP", 'P', GOLD.plate(), 'C', ModBlocks.block_tantalium });
|
||||
|
||||
//Special Mods
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.horseshoe_magnet, 1), new Object[] { "L L", "I I", "ILI", 'L', ModItems.lodestone, 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.industrial_magnet, 1), new Object[] { "SMS", " B ", "SMS", 'S', STEEL.ingot(), 'M', ModItems.horseshoe_magnet, 'B', ModBlocks.fusion_conductor });
|
||||
|
||||
@ -137,6 +137,7 @@ public class ToolRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bismuth_tool, 1), new Object[] { "TBT", "SRS", "SCS", 'T', TA.nugget(), 'B', ModItems.nugget_bismuth, 'S', ANY_RESISTANTALLOY.ingot(), 'R', ModItems.reacher, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.sat_designator, 1), new Object[] { "RRD", "PIC", " P", 'P', GOLD.plate(), 'R', Items.redstone, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'D', ModItems.sat_chip, 'I', GOLD.ingot() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.sat_relay), new Object[] { ModItems.sat_chip, ModItems.ducttape, ModItems.radar_linker });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.settings_tool), new Object[] { " P ", "PCP", "III", 'P', IRON.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ANALOG), 'I', ModItems.plate_polymer });
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pipette, 1), new Object[] { " L", " G ", "G ", 'L', ANY_RUBBER.ingot(), 'G', KEY_CLEARGLASS});
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pipette_boron, 1), new Object[] { " P", " B ", "B ", 'P', RUBBER.ingot(), 'B', ModBlocks.glass_boron});
|
||||
|
||||
@ -151,6 +151,7 @@ public class EntityMappings {
|
||||
addEntity(EntityGrenadeIFNull.class, "entity_grenade_ironshod_null", 250);
|
||||
addEntity(EntityFallingNuke.class, "entity_falling_bomb", 1000);
|
||||
addEntity(EntityBulletBaseNT.class, "entity_bullet_mk3", 250, false);
|
||||
addEntity(EntityBulletBaseMK4.class, "entity_bullet_mk4", 250, false);
|
||||
addEntity(EntityMinerRocket.class, "entity_miner_lander", 1000);
|
||||
addEntity(EntityFogFX.class, "entity_nuclear_fog", 1000);
|
||||
addEntity(EntityDuchessGambit.class, "entity_duchessgambit", 1000);
|
||||
|
||||
@ -15,7 +15,6 @@ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -111,7 +110,7 @@ public class EntityMinecartCrate extends EntityMinecartContainerBase implements
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICrateSteel(player.inventory, (EntityMinecartCrate) player.worldObj.getEntityByID(x));
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -147,7 +146,7 @@ public class EntityMinecartDestroyer extends EntityMinecartContainerBase impleme
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICartDestroyer(player.inventory, (EntityMinecartDestroyer) player.worldObj.getEntityByID(x));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
|
||||
public BulletConfig config;
|
||||
|
||||
public EntityBulletBaseMK4(World world) {
|
||||
super(world);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityBulletBaseMK4(EntityLivingBase entity, BulletConfig config, float baseDamage, float spreadMod, double sideOffset, double heightOffset, double frontOffset) {
|
||||
this(entity.worldObj);
|
||||
|
||||
this.thrower = entity;
|
||||
this.config = config;
|
||||
|
||||
this.setLocationAndAngles(thrower.posX, thrower.posY + thrower.getEyeHeight(), thrower.posZ, thrower.rotationYaw, thrower.rotationPitch);
|
||||
|
||||
Vec3 offset = Vec3.createVectorHelper(sideOffset, heightOffset, frontOffset);
|
||||
offset.rotateAroundX(-this.rotationPitch / 180F * (float) Math.PI);
|
||||
offset.rotateAroundY(-this.rotationYaw / 180F * (float) Math.PI);
|
||||
|
||||
this.posX += offset.xCoord;
|
||||
this.posY += offset.yCoord;
|
||||
this.posZ += offset.zCoord;
|
||||
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread * spreadMod);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(3, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
public void setBulletConfig(BulletConfig config) {
|
||||
this.dataWatcher.updateObject(3, config.id);
|
||||
}
|
||||
|
||||
public BulletConfig getBulletConfig() {
|
||||
int id = this.dataWatcher.getWatchableObjectInt(3);
|
||||
if(id < 0 || id > BulletConfig.configs.size()) return null;
|
||||
return BulletConfig.configs.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
if(config == null) config = this.getBulletConfig();
|
||||
|
||||
if(config == null){
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
this.prevPosX = posX;
|
||||
this.prevPosY = posY;
|
||||
this.prevPosZ = posZ;
|
||||
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition mop) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@Override protected double headingForceMult() { return 1D; }
|
||||
@Override public double getGravityVelocity() { return this.config.gravity; }
|
||||
@Override protected double motionMult() { return this.config.velocity; }
|
||||
@Override protected float getAirDrag() { return 1F; }
|
||||
@Override protected float getWaterDrag() { return 1F; }
|
||||
}
|
||||
@ -11,7 +11,6 @@ import api.hbm.energymk2.IBatteryItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@ -97,7 +96,7 @@ public class TrainCargoTram extends EntityRailCarElectric implements IGUIProvide
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUITrainCargoTram(player.inventory, this);
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@ import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@ -88,7 +87,7 @@ public class TrainCargoTramTrailer extends EntityRailCarCargo implements IGUIPro
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUITrainCargoTramTrailer(player.inventory, this);
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ import com.hbm.util.ArmorUtil;
|
||||
import api.hbm.energymk2.IEnergyHandlerMK2;
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
|
||||
@Spaghetti("this sucks ass")
|
||||
public class ExplosionNukeGeneric {
|
||||
|
||||
private final static Random random = new Random();
|
||||
|
||||
@ -5,10 +5,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
@ -25,6 +25,9 @@ public class HbmKeybinds {
|
||||
public static KeyBinding hudKey = new KeyBinding(category + ".toggleHUD", Keyboard.KEY_V, category);
|
||||
public static KeyBinding dashKey = new KeyBinding(category + ".dash", Keyboard.KEY_LSHIFT, category);
|
||||
public static KeyBinding trainKey = new KeyBinding(category + ".trainInv", Keyboard.KEY_R, category);
|
||||
public static KeyBinding copyToolAlt = new KeyBinding(category + ".copyToolAlt", Keyboard.KEY_LMENU, category);
|
||||
|
||||
public static KeyBinding copyToolCtrl = new KeyBinding(category + ".copyToolCtrl", Keyboard.KEY_LCONTROL, category);
|
||||
|
||||
public static KeyBinding reloadKey = new KeyBinding(category + ".reload", Keyboard.KEY_R, category);
|
||||
public static KeyBinding gunPrimaryKey = new KeyBinding(category + ".gunPrimary", -100, category);
|
||||
@ -54,6 +57,8 @@ public class HbmKeybinds {
|
||||
ClientRegistry.registerKeyBinding(craneLeftKey);
|
||||
ClientRegistry.registerKeyBinding(craneRightKey);
|
||||
ClientRegistry.registerKeyBinding(craneLoadKey);
|
||||
ClientRegistry.registerKeyBinding(copyToolAlt);
|
||||
ClientRegistry.registerKeyBinding(copyToolCtrl);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@ -101,10 +106,11 @@ public class HbmKeybinds {
|
||||
CRANE_LEFT,
|
||||
CRANE_RIGHT,
|
||||
CRANE_LOAD,
|
||||
|
||||
TOOL_ALT,
|
||||
TOOL_CTRL,
|
||||
GUN_PRIMARY,
|
||||
GUN_SECONDARY,
|
||||
GUN_TERTIARY,
|
||||
RELOAD,
|
||||
RELOAD
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo12Gauge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.main.ResourceManager;
|
||||
@ -19,7 +20,6 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo20Gauge;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
@ -15,7 +16,6 @@ import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@ -5,12 +5,12 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo22LR;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class Gun22LRFactory {
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.main.ResourceManager;
|
||||
@ -16,7 +17,6 @@ import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo44Magnum;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -23,8 +24,6 @@ import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo45ACP;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
@ -14,7 +15,6 @@ import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class Gun45ACPFactory {
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo4Gauge;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
@ -27,8 +28,6 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
@ -5,12 +5,12 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo50AE;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class Gun50AEFactory {
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo50BMG;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoLunaticSniper;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
@ -22,7 +23,6 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
@ -10,6 +10,7 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo556mm;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
@ -20,8 +21,6 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@ -6,11 +6,11 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo5mm;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class Gun5mmFactory {
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo75Bolt;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
@ -16,8 +17,6 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo762NATO;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -17,7 +18,6 @@ import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@ -8,11 +8,11 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo9mm;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class Gun9mmFactory {
|
||||
|
||||
|
||||
@ -10,9 +10,9 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoDart;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGunDart;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -9,10 +9,10 @@ import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.IBomb.BombReturnCode;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.PlayerInformPacket;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.items.ItemAmmoEnums.AmmoCoilgun;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFireExt;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFlamethrower;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
@ -23,7 +24,6 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.packet.toclient.ExplosionKnockbackPacket;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.IRepairable.EnumExtinguishType;
|
||||
import com.hbm.util.CompatExternal;
|
||||
|
||||
@ -15,11 +15,11 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@ -7,11 +7,11 @@ import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class GunGaussFactory {
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoGrenade;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
@ -17,8 +18,6 @@ import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@ -8,11 +8,10 @@ import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
@ -5,9 +5,8 @@ import java.util.ArrayList;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class GunPoweredFactory {
|
||||
|
||||
@ -10,13 +10,12 @@ import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoRocket;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@ -9,9 +9,8 @@ import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoStinger;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class GunRocketHomingFactory {
|
||||
|
||||
@ -139,7 +139,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
drawTexturedModalRect(pos[0] - 1, pos[1] - 1, 5, 87, 18, 18);
|
||||
}
|
||||
|
||||
drawTexturedModalRect(74, 14, 59, 87, 18, 38);
|
||||
drawTexturedModalRect(74, 14, 59, 87, 18, 36);
|
||||
}
|
||||
|
||||
public static int[][] getInputCoords(int count) {
|
||||
|
||||
27
src/main/java/com/hbm/handler/nei/PyroHandler.java
Normal file
27
src/main/java/com/hbm/handler/nei/PyroHandler.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIPyroOven;
|
||||
import com.hbm.inventory.recipes.PyroOvenRecipes;
|
||||
|
||||
public class PyroHandler extends NEIUniversalHandler {
|
||||
|
||||
public PyroHandler() {
|
||||
super("Pyrolysis", ModBlocks.machine_pyrooven, PyroOvenRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmPyrolysis";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
super.loadTransferRects();
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(50, 35, 28, 14), "ntmPyrolysis"));
|
||||
guiGui.add(GUIPyroOven.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
}
|
||||
29
src/main/java/com/hbm/interfaces/ICopiable.java
Normal file
29
src/main/java/com/hbm/interfaces/ICopiable.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import com.hbm.util.Either;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ICopiable {
|
||||
|
||||
NBTTagCompound getSettings(World world, int x, int y, int z);
|
||||
|
||||
void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z);
|
||||
|
||||
default String getSettingsSourceID(Either<TileEntity, Block> self) {
|
||||
Block block = self.isLeft() ? self.left().getBlockType() : self.right();
|
||||
return block.getUnlocalizedName();
|
||||
}
|
||||
|
||||
default String getSettingsSourceDisplay(Either<TileEntity, Block> self) {
|
||||
Block block = self.isLeft() ? self.left().getBlockType() : self.right();
|
||||
return block.getLocalizedName();
|
||||
}
|
||||
|
||||
default String[] infoForDisplay(World world, int x, int y, int z){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
|
||||
public interface IHoldableWeapon {
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.inventory.SlotUpgrade;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
|
||||
|
||||
@ -35,7 +36,7 @@ public class ContainerChemfac extends Container {
|
||||
|
||||
for(int k = 0; k < 2; k++) {
|
||||
for(int l = 0; l < 2; l++) {
|
||||
this.addSlotToContainer(new Slot(tile, this.inventorySlots.size(), 69 + j * 110 + l * 16, 14 + i * 38 + k * 16));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(playerInv.player, tile, this.inventorySlots.size(), 69 + j * 110 + l * 16, 14 + i * 38 + k * 16));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,86 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePyroOven;
|
||||
|
||||
import api.hbm.energymk2.IBatteryItem;
|
||||
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 ContainerPyroOven extends Container {
|
||||
|
||||
private TileEntityMachinePyroOven pyro;
|
||||
|
||||
public ContainerPyroOven(InventoryPlayer invPlayer, TileEntityMachinePyroOven tedf) {
|
||||
pyro = tedf;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 152, 72));
|
||||
//Input
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 35, 45));
|
||||
//Output
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 89, 45));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 8, 72));
|
||||
//Upgrades
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 71, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 89, 72));
|
||||
|
||||
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 player, int index) {
|
||||
ItemStack rStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index <= 5) {
|
||||
if(!this.mergeItemStack(stack, 6, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) {
|
||||
if(!this.mergeItemStack(stack, 0, 1, false)) return null;
|
||||
} else if(rStack.getItem() instanceof IItemFluidIdentifier) {
|
||||
if(!this.mergeItemStack(stack, 3, 4, false)) return null;
|
||||
} else if(rStack.getItem() instanceof ItemMachineUpgrade) {
|
||||
if(!this.mergeItemStack(stack, 4, 6, false)) return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(stack, 1, 2, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return rStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return pyro.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
62
src/main/java/com/hbm/inventory/gui/GUIPyroOven.java
Normal file
62
src/main/java/com/hbm/inventory/gui/GUIPyroOven.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPyroOven;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePyroOven;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIPyroOven extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_pyrooven.png");
|
||||
private TileEntityMachinePyroOven pyro;
|
||||
|
||||
public GUIPyroOven(InventoryPlayer playerInv, TileEntityMachinePyroOven tile) {
|
||||
super(new ContainerPyroOven(playerInv, tile));
|
||||
|
||||
this.pyro = tile;
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float interp) {
|
||||
super.drawScreen(x, y, interp);
|
||||
|
||||
pyro.tanks[0].renderTankInfo(this, x, y, guiLeft + 8, guiTop + 18, 16, 52);
|
||||
pyro.tanks[1].renderTankInfo(this, x, y, guiLeft + 116, guiTop + 18, 16, 52);
|
||||
this.drawElectricityInfo(this, x, y, guiLeft + 152, guiTop + 18, 16, 52, pyro.getPower(), pyro.getMaxPower());
|
||||
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 108, guiTop + 76, 8, 8, guiLeft + 108, guiTop + 76, this.getUpgradeInfo(pyro));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.pyro.hasCustomInventoryName() ? this.pyro.getInventoryName() : I18n.format(this.pyro.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 18, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = (int) (pyro.power * 52 / pyro.maxPower);
|
||||
drawTexturedModalRect(guiLeft + 152, guiTop + 70 - i, 176, 64 - i, 16, i);
|
||||
|
||||
int p = (int) (pyro.progress * 27);
|
||||
drawTexturedModalRect(guiLeft + 57, guiTop + 47, 176, 0, p, 12);
|
||||
|
||||
pyro.tanks[0].renderTank(guiLeft + 8, guiTop + 70, this.zLevel, 16, 52);
|
||||
pyro.tanks[1].renderTank(guiLeft + 116, guiTop + 70, this.zLevel, 16, 52);
|
||||
|
||||
this.drawInfoPanel(guiLeft + 108, guiTop + 76, 8, 8, 8);
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,6 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
@ -302,10 +301,10 @@ public abstract class GuiInfoContainer extends GuiContainer implements INEIGuiHa
|
||||
if(inventorySlots instanceof ContainerBase) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger("slot", slot.slotNumber);
|
||||
//Item IDs are usually dangerous, but this is only getting called from clientside, while ingame anyway
|
||||
//if someone somehow gets an ID shift with this i will eat my shoe - 70k
|
||||
tag.setInteger("id", Item.getIdFromItem(stack.getItem()));
|
||||
tag.setInteger("meta", stack.getItemDamage());
|
||||
|
||||
NBTTagCompound item = new NBTTagCompound();
|
||||
stack.writeToNBT(item);
|
||||
tag.setTag("stack", item);
|
||||
|
||||
TileEntity te = (TileEntity) ((ContainerBase) inventorySlots).tile;
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(tag, te.xCoord, te.yCoord, te.zCoord));
|
||||
|
||||
@ -957,6 +957,14 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
new ComparableStack(ModItems.motor_desh, 2),
|
||||
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_pyrooven, 1), new AStack[] {
|
||||
!exp ? new OreDictStack(STEEL.plateWelded(), 16) : new OreDictStack(STEEL.heavyComp(), 4),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
|
||||
new ComparableStack(ModItems.ingot_cft, 4),
|
||||
new OreDictStack(CU.pipe(), 12),
|
||||
new ComparableStack(ModItems.motor_desh, 1),
|
||||
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_compressor, 1), new AStack[] {
|
||||
new OreDictStack(STEEL.plateCast(), 8),
|
||||
|
||||
224
src/main/java/com/hbm/inventory/recipes/PyroOvenRecipes.java
Normal file
224
src/main/java/com/hbm/inventory/recipes/PyroOvenRecipes.java
Normal file
@ -0,0 +1,224 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
import static com.hbm.inventory.fluid.Fluids.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
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.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.items.special.ItemBedrockOreNew;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PyroOvenRecipes extends SerializableRecipe {
|
||||
|
||||
public static List<PyroOvenRecipe> recipes = new ArrayList();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
//solid fuel
|
||||
registerSFAuto(SMEAR);
|
||||
registerSFAuto(HEATINGOIL);
|
||||
registerSFAuto(HEATINGOIL_VACUUM);
|
||||
registerSFAuto(RECLAIMED);
|
||||
registerSFAuto(PETROIL);
|
||||
registerSFAuto(NAPHTHA);
|
||||
registerSFAuto(NAPHTHA_CRACK);
|
||||
registerSFAuto(DIESEL);
|
||||
registerSFAuto(DIESEL_REFORM);
|
||||
registerSFAuto(DIESEL_CRACK);
|
||||
registerSFAuto(DIESEL_CRACK_REFORM);
|
||||
registerSFAuto(LIGHTOIL);
|
||||
registerSFAuto(LIGHTOIL_CRACK);
|
||||
registerSFAuto(LIGHTOIL_VACUUM);
|
||||
registerSFAuto(KEROSENE);
|
||||
registerSFAuto(KEROSENE_REFORM);
|
||||
registerSFAuto(SOURGAS);
|
||||
registerSFAuto(REFORMGAS);
|
||||
registerSFAuto(SYNGAS);
|
||||
registerSFAuto(PETROLEUM);
|
||||
registerSFAuto(LPG);
|
||||
registerSFAuto(BIOFUEL);
|
||||
registerSFAuto(AROMATICS);
|
||||
registerSFAuto(UNSATURATEDS);
|
||||
registerSFAuto(REFORMATE);
|
||||
registerSFAuto(XYLENE);
|
||||
registerSFAuto(BALEFIRE, 24_000_000L, ModItems.solid_fuel_bf);
|
||||
|
||||
//bedrock ores
|
||||
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
recipes.add(new PyroOvenRecipe(10).in(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type))).out(new FluidStack(Fluids.VITRIOL, 50)).out(ItemBedrockOreNew.make(BedrockOreGrade.BASE_ROASTED, type)));
|
||||
recipes.add(new PyroOvenRecipe(10).in(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY, type))).out(new FluidStack(Fluids.VITRIOL, 50)).out(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_ROASTED, type)));
|
||||
recipes.add(new PyroOvenRecipe(10).in(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_BYPRODUCT, type))).out(new FluidStack(Fluids.VITRIOL, 50)).out(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ROASTED, type)));
|
||||
recipes.add(new PyroOvenRecipe(10).in(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_BYPRODUCT, type))).out(new FluidStack(Fluids.VITRIOL, 50)).out(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ROASTED, type)));
|
||||
recipes.add(new PyroOvenRecipe(10).in(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_BYPRODUCT, type))).out(new FluidStack(Fluids.VITRIOL, 50)).out(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ROASTED, type)));
|
||||
}
|
||||
|
||||
//syngas from coal
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new FluidStack(Fluids.STEAM, 500)).in(new OreDictStack(COAL.gem()))
|
||||
.out(new FluidStack(Fluids.SYNGAS, 1_000)));
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new FluidStack(Fluids.STEAM, 500)).in(new OreDictStack(COAL.dust()))
|
||||
.out(new FluidStack(Fluids.SYNGAS, 1_000)));
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new FluidStack(Fluids.STEAM, 250)).in(new OreDictStack(ANY_COKE.gem()))
|
||||
.out(new FluidStack(Fluids.SYNGAS, 1_000)));
|
||||
//syngas from biomass
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new ComparableStack(ModItems.biomass, 4))
|
||||
.out(new FluidStack(Fluids.SYNGAS, 1_000)).out(new ItemStack(Items.coal, 1, 1)));
|
||||
//soot from tar
|
||||
recipes.add(new PyroOvenRecipe(40)
|
||||
.out(new FluidStack(Fluids.HYDROGEN, 250)).in(new OreDictStack(ANY_TAR.any(), 8))
|
||||
.out(new FluidStack(Fluids.CARBONDIOXIDE, 1_000)).out(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.SOOT)));
|
||||
//heavyoil from coal
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new FluidStack(Fluids.HYDROGEN, 500)).in(new OreDictStack(COAL.gem()))
|
||||
.out(new FluidStack(Fluids.HEAVYOIL, 1_000)));
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new FluidStack(Fluids.HYDROGEN, 500)).in(new OreDictStack(COAL.dust()))
|
||||
.out(new FluidStack(Fluids.HEAVYOIL, 1_000)));
|
||||
recipes.add(new PyroOvenRecipe(100)
|
||||
.in(new FluidStack(Fluids.HYDROGEN, 250)).in(new OreDictStack(ANY_COKE.gem()))
|
||||
.out(new FluidStack(Fluids.HEAVYOIL, 1_000)));
|
||||
//coalgas from coal
|
||||
recipes.add(new PyroOvenRecipe(50)
|
||||
.in(new FluidStack(Fluids.HEAVYOIL, 500)).in(new OreDictStack(COAL.gem()))
|
||||
.out(new FluidStack(Fluids.COALGAS, 1_000)));
|
||||
recipes.add(new PyroOvenRecipe(50)
|
||||
.in(new FluidStack(Fluids.HEAVYOIL, 500)).in(new OreDictStack(COAL.dust()))
|
||||
.out(new FluidStack(Fluids.COALGAS, 1_000)));
|
||||
recipes.add(new PyroOvenRecipe(50)
|
||||
.in(new FluidStack(Fluids.HEAVYOIL, 500)).in(new OreDictStack(ANY_COKE.gem()))
|
||||
.out(new FluidStack(Fluids.COALGAS, 1_000)));
|
||||
//refgas from coker gas
|
||||
recipes.add(new PyroOvenRecipe(60)
|
||||
.in(new FluidStack(GAS_COKER, 4_000))
|
||||
.out(new FluidStack(Fluids.REFORMGAS, 100)));
|
||||
}
|
||||
|
||||
private static void registerSFAuto(FluidType fluid) {
|
||||
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();
|
||||
double bonus = 0.5D; //double efficiency!!
|
||||
|
||||
int mB = (int) (tuPerSF * 1000L * bonus / tuPerBucket);
|
||||
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
mB = Math.max(mB, 1);
|
||||
|
||||
registerRecipe(fluid, mB, fuel);
|
||||
}
|
||||
|
||||
private static void registerRecipe(FluidType type, int quantity, Item output) { registerRecipe(type, quantity, new ItemStack(output)); }
|
||||
private static void registerRecipe(FluidType type, int quantity, ItemStack output) { recipes.add(new PyroOvenRecipe(60).in(new FluidStack(type, quantity)).out(output)); }
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
HashMap<Object[], Object[]> map = new HashMap<Object[], Object[]>();
|
||||
|
||||
for(PyroOvenRecipe rec : recipes) {
|
||||
|
||||
Object[] in = null;
|
||||
Object[] out = null;
|
||||
|
||||
if(rec.inputFluid != null && rec.inputItem != null) in = new Object[] {ItemFluidIcon.make(rec.inputFluid), rec.inputItem};
|
||||
if(rec.inputFluid != null && rec.inputItem == null) in = new Object[] {ItemFluidIcon.make(rec.inputFluid)};
|
||||
if(rec.inputFluid == null && rec.inputItem != null) in = new Object[] {rec.inputItem};
|
||||
|
||||
if(rec.outputFluid != null && rec.outputItem != null) out = new Object[] {rec.outputItem, ItemFluidIcon.make(rec.outputFluid)};
|
||||
if(rec.outputFluid != null && rec.outputItem == null) out = new Object[] {ItemFluidIcon.make(rec.outputFluid)};
|
||||
if(rec.outputFluid == null && rec.outputItem != null) out = new Object[] {rec.outputItem};
|
||||
|
||||
if(in != null && out != null) {
|
||||
map.put(in, out);
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmPyrolysis.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
AStack inputItem = obj.has("inputItem") ? this.readAStack(obj.get("inputItem").getAsJsonArray()) : null;
|
||||
FluidStack inputFluid = obj.has("inputFluid") ? this.readFluidStack(obj.get("inputFluid").getAsJsonArray()) : null;
|
||||
ItemStack outputItem = obj.has("outputItem") ? this.readItemStack(obj.get("outputItem").getAsJsonArray()) : null;
|
||||
FluidStack outputFluid = obj.has("outputFluid") ? this.readFluidStack(obj.get("outputFluid").getAsJsonArray()) : null;
|
||||
int duration = obj.get("duration").getAsInt();
|
||||
|
||||
recipes.add(new PyroOvenRecipe(duration).in(inputFluid).in(inputItem).out(outputFluid).out(outputItem));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
|
||||
PyroOvenRecipe rec = (PyroOvenRecipe) recipe;
|
||||
|
||||
if(rec.inputFluid != null) { writer.name("inputFluid"); this.writeFluidStack(rec.inputFluid, writer); }
|
||||
if(rec.inputItem != null) { writer.name("inputItem"); this.writeAStack(rec.inputItem, writer); }
|
||||
if(rec.outputFluid != null) { writer.name("outputFluid"); this.writeFluidStack(rec.outputFluid, writer); }
|
||||
if(rec.outputItem != null) { writer.name("outputItem"); this.writeItemStack(rec.outputItem, writer); }
|
||||
writer.name("duration").value(rec.duration);
|
||||
}
|
||||
|
||||
public static class PyroOvenRecipe {
|
||||
public FluidStack inputFluid;
|
||||
public AStack inputItem;
|
||||
public FluidStack outputFluid;
|
||||
public ItemStack outputItem;
|
||||
public int duration;
|
||||
|
||||
public PyroOvenRecipe(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public PyroOvenRecipe in(FluidStack stack) { this.inputFluid = stack; return this; }
|
||||
public PyroOvenRecipe in(AStack stack) { this.inputItem = stack; return this; }
|
||||
public PyroOvenRecipe out(FluidStack stack) { this.outputFluid = stack; return this; }
|
||||
public PyroOvenRecipe out(ItemStack stack) { this.outputItem = stack; return this; }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -196,7 +196,7 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
ShredderRecipes.setRecipe(ModBlocks.boxcar, new ItemStack(ModItems.powder_steel, 32));
|
||||
ShredderRecipes.setRecipe(ModItems.ingot_schrabidate, new ItemStack(ModItems.powder_schrabidate, 1));
|
||||
ShredderRecipes.setRecipe(ModBlocks.block_schrabidate, new ItemStack(ModItems.powder_schrabidate, 9));
|
||||
ShredderRecipes.setRecipe(ModItems.coal_infernal, new ItemStack(ModItems.powder_coal, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.coal_infernal, new ItemStack(ModItems.powder_coal, 2));
|
||||
ShredderRecipes.setRecipe(Items.fermented_spider_eye, new ItemStack(ModItems.powder_poison, 3));
|
||||
ShredderRecipes.setRecipe(Items.poisonous_potato, new ItemStack(ModItems.powder_poison, 1));
|
||||
ShredderRecipes.setRecipe(ModBlocks.ore_tektite_osmiridium, new ItemStack(ModItems.powder_tektite, 1));
|
||||
|
||||
@ -99,6 +99,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerSFAuto(LIGHTOIL_CRACK);
|
||||
registerSFAuto(LIGHTOIL_VACUUM);
|
||||
registerSFAuto(KEROSENE);
|
||||
registerSFAuto(KEROSENE_REFORM);
|
||||
//registerSFAuto(GAS);
|
||||
registerSFAuto(SOURGAS);
|
||||
registerSFAuto(REFORMGAS);
|
||||
@ -111,7 +112,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerSFAuto(UNSATURATEDS);
|
||||
registerSFAuto(REFORMATE);
|
||||
registerSFAuto(XYLENE);
|
||||
registerSFAuto(BALEFIRE, 24000000L, ModItems.solid_fuel_bf); //holy shit this is energy dense*/
|
||||
registerSFAuto(BALEFIRE, 24_000_000L, ModItems.solid_fuel_bf); //holy shit this is energy dense*/
|
||||
|
||||
}
|
||||
|
||||
@ -127,6 +128,8 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
mB = Math.max(mB, 1);
|
||||
|
||||
registerRecipe(fluid, mB, fuel);
|
||||
}
|
||||
|
||||
@ -58,6 +58,7 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new LiquefactionRecipes());
|
||||
recipeHandlers.add(new SolidificationRecipes());
|
||||
recipeHandlers.add(new CokerRecipes());
|
||||
recipeHandlers.add(new PyroOvenRecipes());
|
||||
recipeHandlers.add(new BreederRecipes());
|
||||
recipeHandlers.add(new CyclotronRecipes());
|
||||
recipeHandlers.add(new HadronRecipes());
|
||||
|
||||
@ -1251,6 +1251,7 @@ public class ModItems {
|
||||
public static Item coupling_tool;
|
||||
public static Item drone_linker;
|
||||
public static Item radar_linker;
|
||||
public static Item settings_tool;
|
||||
|
||||
public static Item template_folder;
|
||||
public static Item journal_pip;
|
||||
@ -4528,6 +4529,7 @@ public class ModItems {
|
||||
coupling_tool = new ItemCouplingTool().setUnlocalizedName("coupling_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coupling_tool");
|
||||
drone_linker = new ItemDroneLinker().setUnlocalizedName("drone_linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":drone_linker");
|
||||
radar_linker = new ItemRadarLinker().setUnlocalizedName("radar_linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":radar_linker");
|
||||
settings_tool = new ItemSettingsTool().setUnlocalizedName("settings_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":settings_tool");
|
||||
|
||||
key = new ItemKey().setUnlocalizedName("key").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key");
|
||||
key_red = new ItemCustomLore().setUnlocalizedName("key_red").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":key_red");
|
||||
@ -6700,6 +6702,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(power_net_tool, power_net_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(analysis_tool, analysis_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(coupling_tool, coupling_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(settings_tool, settings_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(dosimeter, dosimeter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(geiger_counter, geiger_counter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(digamma_diagnostic, digamma_diagnostic.getUnlocalizedName());
|
||||
|
||||
@ -15,7 +15,6 @@ import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@ -150,7 +149,7 @@ public class ItemFluidIDMulti extends Item implements IItemFluidIdentifier, IIte
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenFluid(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ import com.hbm.util.I18nUtil;
|
||||
|
||||
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.Item;
|
||||
@ -44,7 +43,7 @@ public class ItemTemplateFolder extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenTemplateFolder(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ 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.item.Item;
|
||||
@ -40,7 +39,7 @@ public class ItemBook extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIBook(player.inventory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -115,7 +114,7 @@ public class ItemBookLore extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIBookLore(player);
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.util.EnumUtil;
|
||||
|
||||
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;
|
||||
@ -81,7 +80,7 @@ public class ItemHolotapeImage extends ItemHoloTape implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenHolotape();
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ 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.item.Item;
|
||||
@ -29,7 +28,7 @@ public class ItemBookLemegeton extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUILemegeton(player.inventory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ 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.item.Item;
|
||||
@ -44,7 +43,7 @@ public class ItemCatalog extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if(BobmazonOfferFactory.getOffers(player.getHeldItem()) != null)
|
||||
return new GUIScreenBobmazon(player, BobmazonOfferFactory.getOffers(player.getHeldItem()));
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.tileentity.IGUIProvider;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
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.Item;
|
||||
@ -56,7 +55,7 @@ public class ItemDesingatorManual extends Item implements IDesignatorItem, IGUIP
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenDesignator(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -324,7 +323,7 @@ public class ItemGuideBook extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenGuide(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,11 +8,11 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.IBomb.BombReturnCode;
|
||||
import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.PlayerInformPacket;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -8,7 +8,6 @@ import com.hbm.util.ItemStackUtil;
|
||||
|
||||
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.inventory.IInventory;
|
||||
@ -42,7 +41,7 @@ public class ItemLeadBox extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUILeadBox(player.inventory, new InventoryLeadBox(player, player.getHeldItem()));
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import com.hbm.util.ItemStackUtil;
|
||||
|
||||
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.inventory.IInventory;
|
||||
@ -42,7 +41,7 @@ public class ItemPlasticBag extends Item implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIPlasticBag(player.inventory, new InventoryPlasticBag(player, player.getHeldItem()));
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ 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.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@ -59,7 +58,7 @@ public class ItemSatInterface extends ItemSatChip implements IGUIProvider {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if(this == ModItems.sat_interface)
|
||||
return new GUIScreenSatInterface(player);
|
||||
else if(this == ModItems.sat_coord)
|
||||
|
||||
139
src/main/java/com/hbm/items/tool/ItemSettingsTool.java
Normal file
139
src/main/java/com/hbm/items/tool/ItemSettingsTool.java
Normal file
@ -0,0 +1,139 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.HbmKeybinds;
|
||||
import com.hbm.interfaces.ICopiable;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.PlayerInformPacket;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
import com.hbm.util.Either;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSettingsTool extends Item {
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean bool) {
|
||||
NBTTagList displayInfo;
|
||||
if(!(entity instanceof EntityPlayerMP)) return;
|
||||
|
||||
if(((EntityPlayer) entity).getHeldItem() == stack && stack.hasTagCompound()) {
|
||||
EntityPlayer player = ((EntityPlayer) entity);
|
||||
int delay = stack.stackTagCompound.getInteger("inputDelay");
|
||||
delay++;
|
||||
displayInfo = stack.stackTagCompound.getTagList("displayInfo", 10);
|
||||
|
||||
if (HbmPlayerProps.getData(player).getKeyPressed(HbmKeybinds.EnumKeybind.TOOL_ALT) && delay > 4) {
|
||||
int index = stack.stackTagCompound.getInteger("copyIndex") + 1;
|
||||
if(index > displayInfo.tagCount() - 1) index = 0;
|
||||
stack.stackTagCompound.setInteger("copyIndex", index);
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
stack.stackTagCompound.setInteger("inputDelay", delay);
|
||||
if(world.getTotalWorldTime() % 5 != 0) return;
|
||||
|
||||
if(displayInfo.tagCount() > 0){
|
||||
for (int j = 0; j < displayInfo.tagCount(); j++) {
|
||||
NBTTagCompound nbt = displayInfo.getCompoundTagAt(j);
|
||||
EnumChatFormatting format = stack.stackTagCompound.getInteger("copyIndex") == j ? EnumChatFormatting.AQUA : EnumChatFormatting.YELLOW;
|
||||
PacketDispatcher.wrapper.sendTo(
|
||||
new PlayerInformPacket(ChatBuilder.startTranslation(nbt.getString("info"))
|
||||
.color(format)
|
||||
.flush()
|
||||
, 897 + j, 4000 ), (EntityPlayerMP) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add("Can copy the settings (filters, fluid ID, etc) of machines");
|
||||
list.add("Shift right-click to copy, right click to paste");
|
||||
list.add("Ctrl click on pipes to paste settings to multiple pipes");
|
||||
if(stack.stackTagCompound != null) {
|
||||
NBTTagCompound nbt = stack.stackTagCompound;
|
||||
if (nbt.hasKey("tileName")){
|
||||
list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey(nbt.getString("tileName") + ".name"));
|
||||
} else {
|
||||
list.add(EnumChatFormatting.RED + " None ");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
|
||||
Either<TileEntity, Block> schrodinger = getCopyInfoSource(world, x, y, z);
|
||||
if(schrodinger == null) return false;
|
||||
ICopiable copiable = schrodinger.cast();
|
||||
|
||||
if(player.isSneaking()) {
|
||||
stack.stackTagCompound = copiable.getSettings(world, x, y, z);
|
||||
if(stack.stackTagCompound != null) {
|
||||
|
||||
stack.stackTagCompound.setString("tileName", copiable.getSettingsSourceID(schrodinger));
|
||||
stack.stackTagCompound.setInteger("copyIndex", 0);
|
||||
stack.stackTagCompound.setInteger("inputDelay", 0);
|
||||
String[] info = copiable.infoForDisplay(world, x, y, z);
|
||||
if (info != null) {
|
||||
NBTTagList displayInfo = new NBTTagList();
|
||||
for (String str : info) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setString("info", str);
|
||||
displayInfo.appendTag(nbt);
|
||||
}
|
||||
stack.stackTagCompound.setTag("displayInfo", displayInfo);
|
||||
}
|
||||
|
||||
if (world.isRemote) {
|
||||
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
|
||||
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
|
||||
.next("] ").color(EnumChatFormatting.DARK_AQUA)
|
||||
.next("Copied settings of " + copiable.getSettingsSourceDisplay(schrodinger)).color(EnumChatFormatting.AQUA).flush());
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
|
||||
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
|
||||
.next("] ").color(EnumChatFormatting.DARK_AQUA)
|
||||
.next("Copy failed, machine has no settings tool support: " + copiable.getSettingsSourceDisplay(schrodinger)).color(EnumChatFormatting.RED).flush());
|
||||
}
|
||||
|
||||
} else if(stack.hasTagCompound()) {
|
||||
int index = stack.stackTagCompound.getInteger("copyIndex");
|
||||
copiable.pasteSettings(stack.stackTagCompound, index, world, player, x, y, z);
|
||||
}
|
||||
|
||||
return !world.isRemote;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Either<TileEntity, Block> getCopyInfoSource(World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof ICopiable) {
|
||||
return Either.left(te);
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if(block instanceof ICopiable) {
|
||||
return Either.right(block);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@ import com.hbm.entity.projectile.EntityBulletBaseNT;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@ -9,12 +9,12 @@ import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.GunAnimationPacket;
|
||||
import com.hbm.packet.toserver.GunButtonPacket;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.IEquipReceiver;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.armor.ArmorFSB;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
@ -26,7 +27,6 @@ import com.hbm.packet.toserver.GunButtonPacket;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
|
||||
@ -10,12 +10,11 @@ import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.GunAnimationPacket;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import api.hbm.fluid.IFillableItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@ -31,6 +31,15 @@ public class BulletConfig {
|
||||
this.id = configs.size();
|
||||
configs.add(this);
|
||||
}
|
||||
|
||||
public BulletConfig setItem(Item ammo) { this.ammo = new ComparableStack(ammo); return this; }
|
||||
|
||||
public BulletConfig setItem(Item ammo) { this.ammo = new ComparableStack(ammo); return this; }
|
||||
public BulletConfig setReloadCount(int ammoReloadCount) { this.ammoReloadCount = ammoReloadCount; return this; }
|
||||
public BulletConfig setVel(float velocity) { this.velocity = velocity; return this; }
|
||||
public BulletConfig setSpread(float spread) { this.spread = spread; return this; }
|
||||
public BulletConfig setWear(float wear) { this.wear = wear; return this; }
|
||||
public BulletConfig setProjectiles(int min, int max) { this.projectilesMin = min; this.projectilesMax = max; return this; }
|
||||
public BulletConfig setDamage(float damageMult) { this.damageMult = damageMult; return this; }
|
||||
public BulletConfig setHeadshot(float headshotMult) { this.headshotMult = headshotMult; return this; }
|
||||
public BulletConfig setGrav(double gravity) { this.gravity = gravity; return this; }
|
||||
public BulletConfig setLife(int expires) { this.expires = expires; return this; }
|
||||
}
|
||||
|
||||
34
src/main/java/com/hbm/items/weapon/sedna/Crosshair.java
Normal file
34
src/main/java/com/hbm/items/weapon/sedna/Crosshair.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.hbm.items.weapon.sedna;
|
||||
|
||||
public enum Crosshair {
|
||||
|
||||
NONE(0, 0, 0),
|
||||
CROSS(1, 55, 16),
|
||||
CIRCLE(19, 55, 16),
|
||||
SEMI(37, 55, 16),
|
||||
KRUCK(55, 55, 16),
|
||||
DUAL(1, 73, 16),
|
||||
SPLIT(19, 73, 16),
|
||||
CLASSIC(37, 73, 16),
|
||||
BOX(55, 73, 16),
|
||||
|
||||
L_CROSS(0, 90, 32),
|
||||
L_KRUCK(32, 90, 32),
|
||||
L_CLASSIC(64, 90, 32),
|
||||
L_CIRCLE(96, 90, 32),
|
||||
L_SPLIT(0, 122, 32),
|
||||
L_ARROWS(32, 122, 32),
|
||||
L_BOX(64, 122, 32),
|
||||
L_CIRCUMFLEX(96, 122, 32),
|
||||
L_RAD(0, 154, 32);
|
||||
|
||||
public int x;
|
||||
public int y;
|
||||
public int size;
|
||||
|
||||
private Crosshair(int x, int y, int size) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
@ -6,79 +6,100 @@ import java.util.function.BiFunction;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Despite how complicated the GunConfig looks, it actually only exists to hold together a bunch of fields. Everything else is infrastructure for getting and setting.
|
||||
* The gun config determines general gun specific stats like durability, crosshair, animations, receivers, click handling and the decider.
|
||||
*
|
||||
* @author hbm
|
||||
* */
|
||||
public class GunConfig {
|
||||
|
||||
public static final String O_RECEIVERS = "O_RECEIVERS";
|
||||
public static final String F_DURABILITY = "F_DURABILITY";
|
||||
public static final String I_DRAWDURATION = "I_DRAWDURATION";
|
||||
public static final String O_CROSSHAIR = "O_CROSSHAIR";
|
||||
public static final String B_RELOADANIMATIONSEQUENTIAL = "B_RELOADANIMATIONSEQUENTIAL";
|
||||
public static final String CON_ONPRESSPRIMARY = "CON_ONPRESSPRIMARY";
|
||||
public static final String CON_ONPRESSSECONDARY = "CON_ONPRESSSECONDARY";
|
||||
public static final String CON_ONPRESSTERTIARY = "CON_ONPRESSTERTIARY";
|
||||
public static final String CON_ONPRESSRELOAD = "CON_ONPRESSRELOAD";
|
||||
public static final String CON_ONRELEASEPRIMARY = "CON_ONRELEASEPRIMARY";
|
||||
public static final String CON_ONRELEASESECONDARY = "CON_ONRELEASESECONDARY";
|
||||
public static final String CON_ONRELEASETERTIARY = "CON_ONRELEASETERTIARY";
|
||||
public static final String CON_ONRELEASERELOAD = "CON_ONRELEASERELOAD";
|
||||
public static final String CON_DECIDER = "CON_DECIDER";
|
||||
public static final String FUN_ANIMNATIONS = "FUN_ANIMNATIONS";
|
||||
|
||||
/* FIELDS */
|
||||
|
||||
/** List of receivers used by the gun, primary and secondary are usually indices 0 and 1 respectively, if applicable */
|
||||
protected Receiver[] receivers;
|
||||
protected float durability;
|
||||
protected int drawDuration = 0;
|
||||
protected Crosshair crosshair;
|
||||
protected boolean reloadAnimationsSequential;
|
||||
protected Receiver[] receivers_DNA;
|
||||
protected float durability_DNA;
|
||||
protected int drawDuration_DNA = 0;
|
||||
protected Crosshair crosshair_DNA;
|
||||
protected boolean reloadAnimationsSequential_DNA;
|
||||
/** Lambda functions for clicking shit */
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressPrimary;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressSecondary;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressTertiary;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressReload;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressPrimary_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressSecondary_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressTertiary_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onPressReload_DNA;
|
||||
/** Lambda functions for releasing the aforementioned shit */
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleasePrimary;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleaseSecondary;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleaseTertiary;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleaseReload;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleasePrimary_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleaseSecondary_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleaseTertiary_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onReleaseReload_DNA;
|
||||
/** The engine for the state machine that determines the gun's overall behavior */
|
||||
protected BiConsumer<ItemStack, LambdaContext> decider;
|
||||
protected BiConsumer<ItemStack, LambdaContext> decider_DNA;
|
||||
/** Lambda that returns the relevant animation for the given params */
|
||||
protected BiFunction<ItemStack, AnimType, BusAnimation> animations;
|
||||
protected BiFunction<ItemStack, AnimType, BusAnimation> animations_DNA;
|
||||
|
||||
/* GETTERS */
|
||||
|
||||
public Receiver[] getReceivers(ItemStack stack) { return receivers; }
|
||||
public float getDurability(ItemStack stack) { return durability; }
|
||||
public int getDrawDuration(ItemStack stack) { return drawDuration; }
|
||||
public Crosshair getCrosshair(ItemStack stack) { return crosshair; }
|
||||
public boolean getReloadAnimSequential(ItemStack stack) { return reloadAnimationsSequential; }
|
||||
public Receiver[] getReceivers(ItemStack stack) { return WeaponUpgradeManager.eval(receivers_DNA, stack, O_RECEIVERS, this); }
|
||||
public float getDurability(ItemStack stack) { return WeaponUpgradeManager.eval(durability_DNA, stack, F_DURABILITY, this); }
|
||||
public int getDrawDuration(ItemStack stack) { return WeaponUpgradeManager.eval(drawDuration_DNA, stack, I_DRAWDURATION, this); }
|
||||
public Crosshair getCrosshair(ItemStack stack) { return WeaponUpgradeManager.eval(crosshair_DNA, stack, O_CROSSHAIR, this); }
|
||||
public boolean getReloadAnimSequential(ItemStack stack) { return WeaponUpgradeManager.eval(reloadAnimationsSequential_DNA, stack, B_RELOADANIMATIONSEQUENTIAL, this); }
|
||||
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressPrimary(ItemStack stack) { return this.onPressPrimary; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressSecondary(ItemStack stack) { return this.onPressSecondary; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressTertiary(ItemStack stack) { return this.onPressTertiary; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressReload(ItemStack stack) { return this.onPressReload; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressPrimary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onPressPrimary_DNA, stack, CON_ONPRESSPRIMARY, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressSecondary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onPressSecondary_DNA, stack, CON_ONPRESSSECONDARY, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressTertiary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onPressTertiary_DNA, stack, CON_ONPRESSTERTIARY, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getPressReload(ItemStack stack) { return WeaponUpgradeManager.eval(this.onPressReload_DNA, stack, CON_ONPRESSRELOAD, this); }
|
||||
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleasePrimary(ItemStack stack) { return this.onReleasePrimary; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleaseSecondary(ItemStack stack) { return this.onReleaseSecondary; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleaseTertiary(ItemStack stack) { return this.onReleaseTertiary; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleaseReload(ItemStack stack) { return this.onReleaseReload; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleasePrimary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onReleasePrimary_DNA, stack, CON_ONRELEASEPRIMARY, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleaseSecondary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onReleaseSecondary_DNA, stack, CON_ONRELEASESECONDARY, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleaseTertiary(ItemStack stack) { return WeaponUpgradeManager.eval(this.onReleaseTertiary_DNA, stack, CON_ONRELEASETERTIARY, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getReleaseReload(ItemStack stack) { return WeaponUpgradeManager.eval(this.onReleaseReload_DNA, stack, CON_ONRELEASERELOAD, this); }
|
||||
|
||||
public BiConsumer<ItemStack, LambdaContext> getDecider(ItemStack stack) { return this.decider; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getDecider(ItemStack stack) { return WeaponUpgradeManager.eval(this.decider_DNA, stack, CON_DECIDER, this); }
|
||||
|
||||
public BiFunction<ItemStack, AnimType, BusAnimation> getAnims(ItemStack stack) { return this.animations; }
|
||||
public BiFunction<ItemStack, AnimType, BusAnimation> getAnims(ItemStack stack) { return WeaponUpgradeManager.eval(this.animations_DNA, stack, FUN_ANIMNATIONS, this); }
|
||||
|
||||
/* SETTERS */
|
||||
|
||||
public GunConfig rec(Receiver... receivers) { this.receivers = receivers; return this; }
|
||||
public GunConfig dura(float dura) { this.durability = dura; return this; }
|
||||
public GunConfig draw(int draw) { this.drawDuration = draw; return this; }
|
||||
public GunConfig crosshair(Crosshair crosshair) { this.crosshair = crosshair; return this; }
|
||||
public GunConfig rec(Receiver... receivers) { this.receivers_DNA = receivers; return this; }
|
||||
public GunConfig dura(float dura) { this.durability_DNA = dura; return this; }
|
||||
public GunConfig draw(int draw) { this.drawDuration_DNA = draw; return this; }
|
||||
public GunConfig crosshair(Crosshair crosshair) { this.crosshair_DNA = crosshair; return this; }
|
||||
|
||||
//press
|
||||
public GunConfig pp(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressPrimary = lambda; return this; }
|
||||
public GunConfig ps(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressSecondary = lambda; return this; }
|
||||
public GunConfig pt(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressTertiary = lambda; return this; }
|
||||
public GunConfig pr(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressReload = lambda; return this; }
|
||||
public GunConfig pp(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressPrimary_DNA = lambda; return this; }
|
||||
public GunConfig ps(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressSecondary_DNA = lambda; return this; }
|
||||
public GunConfig pt(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressTertiary_DNA = lambda; return this; }
|
||||
public GunConfig pr(BiConsumer<ItemStack, LambdaContext> lambda) { this.onPressReload_DNA = lambda; return this; }
|
||||
|
||||
//release
|
||||
public GunConfig rp(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleasePrimary = lambda; return this; }
|
||||
public GunConfig rs(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleaseSecondary = lambda; return this; }
|
||||
public GunConfig rt(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleaseTertiary = lambda; return this; }
|
||||
public GunConfig rr(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleaseReload = lambda; return this; }
|
||||
public GunConfig rp(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleasePrimary_DNA = lambda; return this; }
|
||||
public GunConfig rs(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleaseSecondary_DNA = lambda; return this; }
|
||||
public GunConfig rt(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleaseTertiary_DNA = lambda; return this; }
|
||||
public GunConfig rr(BiConsumer<ItemStack, LambdaContext> lambda) { this.onReleaseReload_DNA = lambda; return this; }
|
||||
|
||||
//decider
|
||||
public GunConfig decider(BiConsumer<ItemStack, LambdaContext> lambda) { this.decider = lambda; return this; }
|
||||
public GunConfig decider(BiConsumer<ItemStack, LambdaContext> lambda) { this.decider_DNA = lambda; return this; }
|
||||
|
||||
//anims
|
||||
public GunConfig anim(BiFunction<ItemStack, AnimType, BusAnimation> lambda) { this.animations = lambda; return this; }
|
||||
public GunConfig anim(BiFunction<ItemStack, AnimType, BusAnimation> lambda) { this.animations_DNA = lambda; return this; }
|
||||
}
|
||||
|
||||
14
src/main/java/com/hbm/items/weapon/sedna/IWeaponUpgrade.java
Normal file
14
src/main/java/com/hbm/items/weapon/sedna/IWeaponUpgrade.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.hbm.items.weapon.sedna;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IWeaponUpgrade {
|
||||
|
||||
/** Lower numbers get installed and therefore evaluated first. Important when multiplicative and additive bonuses are supposed to stack */
|
||||
public int getModPriority(ItemStack stack);
|
||||
/** Which "slots" this upgrade occupies, can be any value, upgrades that have at least one matching slot are incompatible */
|
||||
public String[] getSlots(ItemStack stack);
|
||||
/** The meat and bones of the upgrade eval. Requires the base value, the held gun, the value's
|
||||
* identifier and the yet unmodified parent (i.e. if the value is part of the receiver, that receiver) */
|
||||
public default <T> T eval(T base, ItemStack stack, String key, Object parent) { return base; }
|
||||
}
|
||||
@ -11,6 +11,8 @@ import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -25,6 +27,8 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipReceiver, IItemHUD {
|
||||
|
||||
public static final String O_GUNCONFIG = "O_GUNCONFIG";
|
||||
|
||||
public static final String KEY_DRAWN = "drawn";
|
||||
public static final String KEY_AIMING = "aiming";
|
||||
public static final String KEY_TIMER = "timer";
|
||||
@ -41,7 +45,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
|
||||
private GunConfig config_DNA;
|
||||
|
||||
public GunConfig getConfig(ItemStack stack) {
|
||||
return config_DNA;
|
||||
return WeaponUpgradeManager.eval(config_DNA, stack, O_GUNCONFIG, this);
|
||||
}
|
||||
|
||||
public ItemGunBaseNT(GunConfig cfg) {
|
||||
@ -53,7 +57,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
|
||||
DRAWING, //initial delay after selecting
|
||||
IDLE, //gun can be fired or reloaded
|
||||
WINDUP, //fire button is down, added delay before fire
|
||||
JUST_FIRED, //gun has been fired, cooldown
|
||||
COOLDOWN, //gun has been fired, cooldown
|
||||
RELOADING //gun is currently reloading
|
||||
}
|
||||
|
||||
@ -90,7 +94,15 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
|
||||
if(world.isRemote) {
|
||||
|
||||
if(isHeld && player == MainRegistry.proxy.me()) {
|
||||
|
||||
/// DEBUG ///
|
||||
/*Vec3 offset = Vec3.createVectorHelper(-0.2, -0.1, 0.75);
|
||||
offset.rotateAroundX(-entity.rotationPitch / 180F * (float) Math.PI);
|
||||
offset.rotateAroundY(-entity.rotationYaw / 180F * (float) Math.PI);
|
||||
world.spawnParticle("flame", entity.posX + offset.xCoord, entity.posY + entity.getEyeHeight() + offset.yCoord, entity.posZ + offset.zCoord, 0, 0, 0);*/
|
||||
|
||||
prevAimingProgress = aimingProgress;
|
||||
boolean aiming = this.getIsAiming(stack);
|
||||
float aimSpeed = 0.25F;
|
||||
@ -169,6 +181,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHUD(Pre event, ElementType type, EntityPlayer player, ItemStack stack) {
|
||||
if(type == ElementType.CROSSHAIRS) {
|
||||
event.setCanceled(true);
|
||||
|
||||
@ -9,39 +9,64 @@ import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Receivers are the gun's "moving parts", i.e. they determine things like base damage, spread, the ejector and the magazine. Think of this class like the
|
||||
* barrel, receiver and chamber of the gun, an underbarrel grenade launcher for example would be a separate receiver instance compared to the regular gun it is attached to.
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
public class Receiver {
|
||||
|
||||
protected float baseDamage;
|
||||
protected int delayAfterFire;
|
||||
protected int roundsPerCycle = 1;
|
||||
protected boolean refireOnHold = false;
|
||||
protected CasingEjector ejector = null;
|
||||
protected int reloadDuration;
|
||||
protected IMagazine magazine;
|
||||
protected BiFunction<ItemStack, LambdaContext, Boolean> canFire;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onFire;
|
||||
public static final String F_BASEDAMAGE = "F_BASEDAMAGE";
|
||||
public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE";
|
||||
public static final String I_ROUNDSPERCYCLE = "I_ROUNDSPERCYCLE";
|
||||
public static final String F_SPREADMOD = "F_SPREADMOD";
|
||||
public static final String B_REFIREONHOLD = "B_REFIREONHOLD";
|
||||
public static final String O_EJECTOR = "O_EJECTOR";
|
||||
public static final String I_RELOADDURATION = "I_RELOADDURATION";
|
||||
public static final String O_MAGAZINE = "O_MAGAZINE";
|
||||
public static final String FUN_CANFIRE = "FUN_CANFIRE";
|
||||
public static final String CON_ONFIRE = "CON_ONFIRE";
|
||||
|
||||
public Receiver(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
protected int index;
|
||||
protected float baseDamage_DNA;
|
||||
protected int delayAfterFire_DNA;
|
||||
protected int roundsPerCycle_DNA = 1;
|
||||
protected float spreadMod_DNA = 1F;
|
||||
protected boolean refireOnHold_DNA = false;
|
||||
protected CasingEjector ejector_DNA = null;
|
||||
protected int reloadDuration_DNA;
|
||||
protected IMagazine magazine_DNA;
|
||||
protected BiFunction<ItemStack, LambdaContext, Boolean> canFire_DNA;
|
||||
protected BiConsumer<ItemStack, LambdaContext> onFire_DNA;
|
||||
|
||||
/* GETTERS */
|
||||
public float getBaseDamage(ItemStack stack) { return this.baseDamage; }
|
||||
public int getDelayAfterFire(ItemStack stack) { return this.delayAfterFire; }
|
||||
public int getRoundsPerCycle(ItemStack stack) { return this.roundsPerCycle; }
|
||||
public boolean getRefireOnHold(ItemStack stack) { return this.refireOnHold; }
|
||||
public CasingEjector getEjector(ItemStack stack) { return this.ejector; }
|
||||
public int getReloadDuration(ItemStack stack) { return this.reloadDuration; }
|
||||
public IMagazine getMagazine(ItemStack stack) { return this.magazine; }
|
||||
public float getBaseDamage(ItemStack stack) { return WeaponUpgradeManager.eval(this.baseDamage_DNA, stack, F_BASEDAMAGE, this); }
|
||||
public int getDelayAfterFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.delayAfterFire_DNA, stack, I_DELAYAFTERFIRE, this); }
|
||||
public int getRoundsPerCycle(ItemStack stack) { return WeaponUpgradeManager.eval(this.roundsPerCycle_DNA, stack, I_ROUNDSPERCYCLE, this); }
|
||||
public float getSpreadMod(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadMod_DNA, stack, F_SPREADMOD, this); }
|
||||
public boolean getRefireOnHold(ItemStack stack) { return WeaponUpgradeManager.eval(this.refireOnHold_DNA, stack, B_REFIREONHOLD, this); }
|
||||
public CasingEjector getEjector(ItemStack stack) { return WeaponUpgradeManager.eval(this.ejector_DNA, stack, O_EJECTOR, this); }
|
||||
public int getReloadDuration(ItemStack stack) { return WeaponUpgradeManager.eval(this.reloadDuration_DNA, stack, I_RELOADDURATION, this); }
|
||||
public IMagazine getMagazine(ItemStack stack) { return WeaponUpgradeManager.eval(this.magazine_DNA, stack, O_MAGAZINE, this); }
|
||||
|
||||
public BiFunction<ItemStack, LambdaContext, Boolean> getCanFire(ItemStack stack) { return this.canFire; }
|
||||
public BiConsumer<ItemStack, LambdaContext> getOnFire(ItemStack stack) { return this.onFire; }
|
||||
public BiFunction<ItemStack, LambdaContext, Boolean> getCanFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.canFire_DNA, stack, FUN_CANFIRE, this); }
|
||||
public BiConsumer<ItemStack, LambdaContext> getOnFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.onFire_DNA, stack, CON_ONFIRE, this); }
|
||||
|
||||
/* SETTERS */
|
||||
public Receiver dmg(float dmg) { this.baseDamage = dmg; return this; }
|
||||
public Receiver delay(int delay) { this.delayAfterFire = delay; return this; }
|
||||
public Receiver rounds(int rounds) { this.roundsPerCycle = rounds; return this; }
|
||||
public Receiver auto(boolean auto) { this.refireOnHold = auto; return this; }
|
||||
public Receiver burst(CasingEjector ejector) { this.ejector = ejector; return this; }
|
||||
public Receiver reload(int delay) { this.reloadDuration = delay; return this; }
|
||||
public Receiver mag(IMagazine magazine) { this.magazine = magazine; return this; }
|
||||
public Receiver dmg(float dmg) { this.baseDamage_DNA = dmg; return this; }
|
||||
public Receiver delay(int delay) { this.delayAfterFire_DNA = delay; return this; }
|
||||
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; return this; }
|
||||
public Receiver spread(int spread) { this.spreadMod_DNA = spread; return this; }
|
||||
public Receiver auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
|
||||
public Receiver burst(CasingEjector ejector) { this.ejector_DNA = ejector; return this; }
|
||||
public Receiver reload(int delay) { this.reloadDuration_DNA = delay; return this; }
|
||||
public Receiver mag(IMagazine magazine) { this.magazine_DNA = magazine; return this; }
|
||||
|
||||
public Receiver canFire(BiFunction<ItemStack, LambdaContext, Boolean> lambda) { this.canFire = lambda; return this; }
|
||||
public Receiver fire(BiConsumer<ItemStack, LambdaContext> lambda) { this.onFire = lambda; return this; }
|
||||
public Receiver canFire(BiFunction<ItemStack, LambdaContext, Boolean> lambda) { this.canFire_DNA = lambda; return this; }
|
||||
public Receiver fire(BiConsumer<ItemStack, LambdaContext> lambda) { this.onFire_DNA = lambda; return this; }
|
||||
}
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package com.hbm.items.weapon.sedna;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* The upgrade manager operates by scraping upgrades from a gun, then iterating over them and evaluating the given value, passing the modified value to successive mods.
|
||||
* The way that mods stack (additive vs multiplicative) depends on the order the mod is installed in
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
public class WeaponUpgradeManager {
|
||||
|
||||
public static ItemStack[] getUpgrades(ItemStack stack) {
|
||||
return null; // TBI
|
||||
}
|
||||
|
||||
/** Scrapes all upgrades, iterates over them and evaluates the given value. The parent (i.e. holder of the base value)
|
||||
* is passed for context (so upgrades can differentiate primary and secondary receivers for example) */
|
||||
public static <T> T eval(T base, ItemStack stack, String key, Object parent) {
|
||||
|
||||
ItemStack[] upgrades = getUpgrades(stack);
|
||||
if(upgrades != null) for(ItemStack upgradeStack : upgrades) {
|
||||
if(upgradeStack.getItem() instanceof IWeaponUpgrade) {
|
||||
IWeaponUpgrade upgrade = (IWeaponUpgrade) upgradeStack.getItem();
|
||||
base = upgrade.eval(base, upgradeStack, key, parent);
|
||||
}
|
||||
}
|
||||
|
||||
return base;
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@ package com.hbm.items.weapon.sedna.factory;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.weapon.sedna.GunConfig;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.Receiver;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineRevolverDrum;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@ -18,12 +18,12 @@ public class GunFactory {
|
||||
|
||||
ModItems.ammo_debug = new Item().setUnlocalizedName("ammo_debug").setTextureName(RefStrings.MODID + ":ammo_45");
|
||||
|
||||
BulletConfig ammo_debug = new BulletConfig().setItem(ModItems.ammo_debug);
|
||||
BulletConfig ammo_debug = new BulletConfig().setItem(ModItems.ammo_debug).setSpread(0.01F);
|
||||
|
||||
ModItems.gun_debug = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(600).draw(15).crosshair(Crosshair.L_CLASSIC)
|
||||
.rec(new Receiver()
|
||||
.dmg(10F).delay(10).mag(new MagazineRevolverDrum(0, 6).addConfigs(ammo_debug))
|
||||
.rec(new Receiver(0)
|
||||
.dmg(10F).delay(12).mag(new MagazineRevolverDrum(0, 6).addConfigs(ammo_debug))
|
||||
.canFire(Lego.LAMBDA_DEBUG_CAN_FIRE).fire(Lego.LAMBDA_DEBUG_FIRE))
|
||||
.pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.pp(Lego.LAMBDA_STANDARD_FIRE)
|
||||
|
||||
@ -62,7 +62,7 @@ public class GunStateDecider {
|
||||
/** Triggers a re-fire of the primary if the fire delay has expired, the left mouse button is down and re-firing is enabled, otherwise switches to IDLE */
|
||||
public static void deciderAutoRefire(ItemStack stack, LambdaContext ctx, GunState lastState, int recIndex, BooleanSupplier refireCondition) {
|
||||
|
||||
if(lastState == GunState.JUST_FIRED) {
|
||||
if(lastState == GunState.COOLDOWN) {
|
||||
|
||||
GunConfig cfg = ctx.config;
|
||||
Receiver rec = cfg.getReceivers(stack)[recIndex];
|
||||
@ -72,7 +72,7 @@ public class GunStateDecider {
|
||||
//if there's a bullet loaded, fire again
|
||||
if(rec.getCanFire(stack).apply(stack, ctx)) {
|
||||
rec.getOnFire(stack).accept(stack, ctx);
|
||||
ItemGunBaseNT.setState(stack, GunState.JUST_FIRED);
|
||||
ItemGunBaseNT.setState(stack, GunState.COOLDOWN);
|
||||
ItemGunBaseNT.setTimer(stack, rec.getDelayAfterFire(stack));
|
||||
//if not, revert to idle
|
||||
} else {
|
||||
|
||||
@ -3,9 +3,12 @@ package com.hbm.items.weapon.sedna.factory;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||
import com.hbm.items.weapon.sedna.Receiver;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.GunAnimationPacket;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
@ -38,7 +41,7 @@ public class Lego {
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_FIRE = (stack, ctx) -> {
|
||||
|
||||
if(ItemGunBaseNT.getState(stack) == GunState.IDLE && ctx.config.getReceivers(stack)[0].getCanFire(stack).apply(stack, ctx)) {
|
||||
ItemGunBaseNT.setState(stack, GunState.JUST_FIRED);
|
||||
ItemGunBaseNT.setState(stack, GunState.COOLDOWN);
|
||||
ItemGunBaseNT.setTimer(stack, ctx.config.getReceivers(stack)[0].getDelayAfterFire(stack));
|
||||
ctx.config.getReceivers(stack)[0].getOnFire(stack).accept(stack, ctx);
|
||||
}
|
||||
@ -55,19 +58,35 @@ public class Lego {
|
||||
|
||||
/** JUMPER - bypasses mag testing and just allows constant fire */
|
||||
public static BiFunction<ItemStack, LambdaContext, Boolean> LAMBDA_DEBUG_CAN_FIRE = (stack, ctx) -> { return true; };
|
||||
|
||||
/** simply plays a sound to indicate that the keybind has triggered */
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_DEBUG_FIRE = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.shotgunShoot", 1F, 1F);
|
||||
if(player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
|
||||
|
||||
double sideOffset = ItemGunBaseNT.getIsAiming(stack) ? 0 : -0.2D;
|
||||
float aim = ItemGunBaseNT.getIsAiming(stack) ? 0.25F : 1F;
|
||||
Receiver primary = ctx.config.getReceivers(stack)[0];
|
||||
|
||||
EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(player, (BulletConfig) primary.getMagazine(stack).getType(stack), primary.getBaseDamage(stack), primary.getSpreadMod(stack) * aim, sideOffset, -0.1, 0.75);
|
||||
player.worldObj.spawnEntityInWorld(mk4);
|
||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.shotgunShoot", 1F, 1F);
|
||||
};
|
||||
|
||||
/** No reload, simply play inspect animation */
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_DEBUG_RELOAD = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
if(player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.INSPECT.ordinal()), (EntityPlayerMP) player);
|
||||
};
|
||||
|
||||
/** anims for the DEBUG revolver, mostly a copy of the li'lpip but with some fixes regarding the cylinder movement */
|
||||
public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DEBUG_ANIMS = (stack, type) -> {
|
||||
switch(type) {
|
||||
case CYCLE:
|
||||
return new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence().addKeyframePosition(0, 0, 0, 50).addKeyframePosition(0, 0, -3, 50).addKeyframePosition(0, 0, 0, 250))
|
||||
.addBus("HAMMER", new BusAnimationSequence().addKeyframePosition(0, 0, 1, 50).addKeyframePosition(0, 0, 1, 300).addKeyframePosition(0, 0, 0, 200))
|
||||
.addBus("DRUM", new BusAnimationSequence().addKeyframePosition(0, 0, 1, 50));
|
||||
.addBus("HAMMER", new BusAnimationSequence().addKeyframePosition(0, 0, 1, 50).addKeyframePosition(0, 0, 1, 300 + 100).addKeyframePosition(0, 0, 0, 200))
|
||||
.addBus("DRUM", new BusAnimationSequence().addKeyframePosition(0, 0, 0, 350 + 100).addKeyframePosition(0, 0, 1, 200));
|
||||
case CYCLE_EMPTY: break;
|
||||
case ALT_CYCLE: break;
|
||||
case EQUIP: return new BusAnimation().addBus("ROTATE", new BusAnimationSequence().addKeyframePosition(-360, 0, 0, 350));
|
||||
@ -77,6 +96,7 @@ public class Lego {
|
||||
case RELOAD_END: break;
|
||||
case SPINDOWN: break;
|
||||
case SPINUP: break;
|
||||
case INSPECT: break;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -3,6 +3,12 @@ package com.hbm.items.weapon.sedna.mags;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* The magazine simply provides the receiver it's attached to with ammo, the receiver does not care where it comes from.
|
||||
* Therefore it is the mag's responsibility to handle reloading, any type restrictions as well as belt-like action from "magless" guns.
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
public interface IMagazine {
|
||||
|
||||
/** What ammo is loaded currently */
|
||||
|
||||
@ -31,8 +31,8 @@ public abstract class MagazineStandardBase implements IMagazine {
|
||||
@Override
|
||||
public Object getType(ItemStack stack) {
|
||||
int type = getMagType(stack, index);
|
||||
if(type >= 0 && type < acceptedBullets.size()) {
|
||||
return acceptedBullets.get(type);
|
||||
if(type >= 0 && type < BulletConfig.configs.size()) {
|
||||
return BulletConfig.configs.get(type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -40,7 +40,7 @@ public abstract class MagazineStandardBase implements IMagazine {
|
||||
@Override
|
||||
public void setType(ItemStack stack, Object type) {
|
||||
if(!(type instanceof BulletConfig)) return;
|
||||
int i = acceptedBullets.indexOf(type);
|
||||
int i = BulletConfig.configs.indexOf(type);
|
||||
if(i >= 0) setMagType(stack, index, i);
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ public abstract class MagazineStandardBase implements IMagazine {
|
||||
@Override public void setAmount(ItemStack stack, int amount) { setMagCount(stack, index, amount); }
|
||||
|
||||
// MAG TYPE //
|
||||
public static int getMagType(ItemStack stack, int index) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_TYPE + index); }
|
||||
public static int getMagType(ItemStack stack, int index) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_TYPE + index); } //TODO: replace with named tags to avoid ID shifting
|
||||
public static void setMagType(ItemStack stack, int index, int value) { ItemGunBaseNT.setValueInt(stack, KEY_MAG_TYPE + index, value); }
|
||||
|
||||
// MAG COUNT //
|
||||
|
||||
@ -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 (5082)";
|
||||
public static final String VERSION = "1.0.27 BETA (5091)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -317,6 +317,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCatalyticReformer.class, new RenderCatalyticReformer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineHydrotreater.class, new RenderHydrotreater());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCoker.class, new RenderCoker());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePyroOven.class, new RenderPyroOven());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFan.class, new RenderFan());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPistonInserter.class, new RenderPistonInserter());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConveyorPress.class, new RenderConveyorPress());
|
||||
@ -615,8 +616,6 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_joule, new ItemRenderMultitool());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_decon, new ItemRenderMultitool());
|
||||
//blocks
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_wall), new ItemRenderDecoBlock());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_corner), new ItemRenderDecoBlock());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.steel_roof), new ItemRenderDecoBlock());
|
||||
}
|
||||
|
||||
@ -835,6 +834,9 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderScaffoldBlock());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTapeBlock());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSteelBeam());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSteelWall());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSteelCorner());
|
||||
RenderingRegistry.registerBlockHandler(new RenderScaffoldDynamic());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBarrel());
|
||||
RenderingRegistry.registerBlockHandler(new RenderFence());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBarbedWire());
|
||||
@ -2111,6 +2113,8 @@ public class ClientProxy extends ServerProxy {
|
||||
case CRANE_LEFT: return HbmKeybinds.craneLeftKey.getIsKeyPressed();
|
||||
case CRANE_RIGHT: return HbmKeybinds.craneRightKey.getIsKeyPressed();
|
||||
case CRANE_LOAD: return HbmKeybinds.craneLoadKey.getIsKeyPressed();
|
||||
case TOOL_ALT: return HbmKeybinds.copyToolAlt.getIsKeyPressed();
|
||||
case TOOL_CTRL: return HbmKeybinds.copyToolCtrl.getIsKeyPressed();
|
||||
case GUN_PRIMARY: return HbmKeybinds.gunPrimaryKey.getIsKeyPressed();
|
||||
case GUN_SECONDARY: return HbmKeybinds.gunSecondaryKey.getIsKeyPressed();
|
||||
case GUN_TERTIARY: return HbmKeybinds.gunTertiaryKey.getIsKeyPressed();
|
||||
|
||||
@ -678,7 +678,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.absorber_green, 1), new Object[] { "ICI", "CPC", "ICI", 'I', ANY_PLASTIC.ingot(), 'C', ModItems.powder_desh_mix, 'P', ModBlocks.absorber_red });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.absorber_pink, 1), new Object[] { "ICI", "CPC", "ICI", 'I', BIGMT.ingot(), 'C', ModItems.powder_nitan_mix, 'P', ModBlocks.absorber_green });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.decon, 1), new Object[] { "BGB", "SAS", "BSB", 'B', BE.ingot(), 'G', Blocks.iron_bars, 'S', STEEL.ingot(), 'A', ModBlocks.absorber });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_amgen, 1), new Object[] { "ITI", "TAT", "ITI", 'I', ALLOY.ingot(), 'T', ModItems.thermo_element, 'A', ModBlocks.absorber });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_geo, 1), new Object[] { "ITI", "PCP", "ITI", 'I', DURA.ingot(), 'T', ModItems.thermo_element, 'P', CU.plateCast(), 'C', ModBlocks.red_wire_coated });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_minirtg, 1), new Object[] { "LLL", "PPP", "TRT", 'L', PB.plate(), 'P', PU238.billet(), 'T', ModItems.thermo_element, 'R', ModItems.rtg_unit });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_powerrtg, 1), new Object[] { "SRS", "PTP", "SRS", 'S', STAR.ingot(), 'R', ModItems.rtg_unit, 'P', PO210.billet(), 'T', TS.dust() });
|
||||
|
||||
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