Merge branch 'HbmMods:master' into RayzerHan-patch-21

This commit is contained in:
Raaaaaaaaaay 2026-02-13 06:32:23 +02:00 committed by GitHub
commit bcfff3f860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 6693 additions and 398 deletions

View File

@ -1,4 +1,20 @@
## Added
* Target pistol
* Weapon steel tier pistol that holds 15 rounds and shoots .22 LR
* Accepts silencers
## Changed
* Reworked the industrial turbine
* New model and texture
* Removed the GUI, it now uses the same in-world compressor toggle as the leviathan turbine
* No longer has a volatile power buffer, power isn't buffered at all anymore, similar to steam engines and MHD turbines
* Steam capacity changes based on compression level, the ratio for turbine cascades is now 1:1:1:1
* Comes with a flywheel, energy output slowly ramps up as steam is supplied and slowly goes down as steam cuts out
* Leviathan turbines no longer have a power buffer
* Updated russian and chinese localization
* The PWR can now be controlled via RoR
* The RoR value reader can read core and hull heat as well as fuel depletion in percent
* The RoR controller can set the control rod level in percent as well as jetison all loaded fuel
* The RoR controller can set the control rod level in percent as well as jetison all loaded fuel
# Fixed
* Fixed proxy tiles that do not use electricity at all visually connecting to cables

View File

@ -968,7 +968,14 @@ public class ModBlocks {
public static Block machine_steam_engine;
public static Block machine_turbine;
public static Block machine_large_turbine;
@Deprecated public static Block machine_large_turbine;
public static Block machine_industrial_turbine;
public static Block machine_chungus;
public static Block machine_condenser;
public static Block machine_tower_small;
public static Block machine_tower_large;
public static Block machine_condenser_powered;
public static Block machine_deuterium_extractor;
public static Block machine_deuterium_tower;
@ -979,12 +986,6 @@ public class ModBlocks {
public static Block machine_compressor;
public static Block machine_compressor_compact;
public static Block machine_chungus;
public static Block machine_condenser;
public static Block machine_tower_small;
public static Block machine_tower_large;
public static Block machine_condenser_powered;
public static Block machine_electrolyser;
public static Block machine_excavator;
@ -2244,7 +2245,8 @@ public class ModBlocks {
machine_steam_engine = new MachineSteamEngine().setBlockName("machine_steam_engine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_turbine = new MachineTurbine(Material.iron).setBlockName("machine_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbine");
machine_large_turbine = new MachineLargeTurbine(Material.iron).setBlockName("machine_large_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_large_turbine");
machine_chungus = new MachineChungus(Material.iron).setBlockName("machine_chungus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chungus");
machine_industrial_turbine = new MachineIndustrialTurbine().setBlockName("machine_industrial_turbine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_chungus = new MachineChungus().setBlockName("machine_chungus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_condenser = new MachineCondenser(Material.iron).setBlockName("machine_condenser").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":condenser");
machine_tower_small = new MachineTowerSmall(Material.iron).setBlockName("machine_tower_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
machine_tower_large = new MachineTowerLarge(Material.iron).setBlockName("machine_tower_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
@ -3282,6 +3284,7 @@ public class ModBlocks {
register(machine_steam_engine);
register(machine_turbine);
register(machine_large_turbine);
register(machine_industrial_turbine);
register(machine_chungus);
GameRegistry.registerBlock(machine_condenser, machine_condenser.getUnlocalizedName());
GameRegistry.registerBlock(machine_tower_small, machine_tower_small.getUnlocalizedName());
@ -3289,8 +3292,8 @@ public class ModBlocks {
register(machine_condenser_powered);
GameRegistry.registerBlock(machine_deuterium_extractor, machine_deuterium_extractor.getUnlocalizedName());
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName());
register(machine_liquefactor);
register(machine_solidifier);
register(machine_intake);
register(machine_compressor);
register(machine_compressor_compact);

View File

@ -20,8 +20,7 @@ public class FurnaceCombination extends BlockDummyable implements ITooltipProvid
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityFurnaceCombination();
if(meta >= 12) return new TileEntityFurnaceCombination();
return new TileEntityProxyCombo().inventory().fluid();
}

View File

@ -21,6 +21,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
@ -28,19 +29,14 @@ import net.minecraftforge.common.util.ForgeDirection;
public class MachineChungus extends BlockDummyable implements ITooltipProvider, ILookOverlay {
public MachineChungus(Material mat) {
super(mat);
public MachineChungus() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityChungus();
if(meta >= 6)
return new TileEntityProxyCombo(false, true, true);
if(meta >= 12) return new TileEntityChungus();
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
return null;
}
@ -66,34 +62,14 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
int iZ2 = entity.zCoord + dir.offsetZ * 2 + turn.offsetZ * 2;
if((x == iX || x == iX2) && (z == iZ || z == iZ2) && y < entity.yCoord + 2) {
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
if(!world.isRemote) {
FluidType type = entity.tanks[0].getTankType();
entity.onLeverPull(type);
if(type == Fluids.STEAM) {
entity.tanks[0].setTankType(Fluids.HOTSTEAM);
entity.tanks[1].setTankType(Fluids.STEAM);
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
entity.tanks[1].setFill(0);
} else if(type == Fluids.HOTSTEAM) {
entity.tanks[0].setTankType(Fluids.SUPERHOTSTEAM);
entity.tanks[1].setTankType(Fluids.HOTSTEAM);
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
entity.tanks[1].setFill(0);
} else if(type == Fluids.SUPERHOTSTEAM) {
entity.tanks[0].setTankType(Fluids.ULTRAHOTSTEAM);
entity.tanks[1].setTankType(Fluids.SUPERHOTSTEAM);
entity.tanks[0].setFill(entity.tanks[0].getFill() / 10);
entity.tanks[1].setFill(0);
if(!entity.operational) {
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
entity.onLeverPull();
} else {
entity.tanks[0].setTankType(Fluids.STEAM);
entity.tanks[1].setTankType(Fluids.SPENTSTEAM);
entity.tanks[0].setFill(Math.min(entity.tanks[0].getFill() * 1000, entity.tanks[0].getMaxFill()));
entity.tanks[1].setFill(0);
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Cannot change compressor setting while operational!"));
}
entity.markDirty();
}
return true;
@ -168,7 +144,7 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankInput.getFill()) + "/" + String.format(Locale.US, "%,d", tankInput.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + outputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankOutput.getFill()) + "/" + String.format(Locale.US, "%,d", tankOutput.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.power) + "/" + BobMathUtil.getShortNumber(chungus.getMaxPower()) + "HE");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(chungus.powerBuffer) + "HE");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);

View File

@ -0,0 +1,133 @@
package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Coolable;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityMachineIndustrialTurbine;
import com.hbm.tileentity.machine.TileEntityTurbineBase;
import com.hbm.util.BobMathUtil;
import com.hbm.util.i18n.I18nUtil;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineIndustrialTurbine extends BlockDummyable implements ITooltipProvider, ILookOverlay {
public MachineIndustrialTurbine() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityMachineIndustrialTurbine();
if(meta >= 6) return new TileEntityProxyCombo().fluid().power();
return null;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking()) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null) return true;
TileEntityTurbineBase entity = (TileEntityTurbineBase) world.getTileEntity(pos[0], pos[1], pos[2]);
if(entity != null) {
ForgeDirection dir = ForgeDirection.getOrientation(entity.getBlockMetadata() - this.offset);
if(x == entity.xCoord + dir.offsetX * 3 && z == entity.zCoord + dir.offsetZ * 3 && y == entity.yCoord + 1) {
if(!world.isRemote) {
if(!entity.operational) {
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:block.chungusLever", 1.5F, 1.0F);
entity.onLeverPull();
} else {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Cannot change compressor setting while operational!"));
}
}
return true;
}
}
}
return false;
}
@Override public int[] getDimensions() { return new int[] { 2, 0, 3, 3, 1, 1 }; }
@Override public int getOffset() { return 3; }
@Override
public 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.UP);
this.makeExtra(world, x + dir.offsetX * 3 + rot.offsetX, y, z + dir.offsetZ * 3 + rot.offsetZ);
this.makeExtra(world, x + dir.offsetX * 3 - rot.offsetX, y, z + dir.offsetZ * 3 - rot.offsetZ);
this.makeExtra(world, x - dir.offsetX * 1 + rot.offsetX, y, z - dir.offsetZ * 1 + rot.offsetZ);
this.makeExtra(world, x - dir.offsetX * 1 - rot.offsetX, y, z - dir.offsetZ * 1 - rot.offsetZ);
this.makeExtra(world, x + dir.offsetX * 3, y + 2, z + dir.offsetZ * 3);
this.makeExtra(world, x - dir.offsetX * 1, y + 2, z - dir.offsetZ * 1);
this.makeExtra(world, x - dir.offsetX * 3, y + 1, z - dir.offsetZ * 3);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
this.addStandardInfo(stack, player, list, ext);
}
private static String[] blocks = new String[] {"", "", "", ""}; // right hand side quarter blocks break the renderer so we cheat a little
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null) return;
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(te instanceof TileEntityMachineIndustrialTurbine)) return;
TileEntityMachineIndustrialTurbine chungus = (TileEntityMachineIndustrialTurbine) te;
List<String> text = new ArrayList();
FluidTank tankInput = chungus.tanks[0];
FluidTank tankOutput = chungus.tanks[1];
FluidType inputType = tankInput.getTankType();
FluidType outputType = Fluids.NONE;
if(inputType.hasTrait(FT_Coolable.class)) {
outputType = inputType.getTrait(FT_Coolable.class).coolsTo;
}
int color = ((int) (0xFF - 0xFF * chungus.spin)) << 16 | ((int)(0xFF * chungus.spin) << 8);
int time = (int) ((world.getTotalWorldTime() / 4) % 4);
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankInput.getFill()) + "/" + String.format(Locale.US, "%,d", tankInput.getMaxFill()) + "mB");
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + outputType.getLocalizedName() + ": " + String.format(Locale.US, "%,d", tankOutput.getFill()) + "/" + String.format(Locale.US, "%,d", tankOutput.getMaxFill()) + "mB");
text.add("&[" + color + "&]" + EnumChatFormatting.RED + "<- " + EnumChatFormatting.WHITE + BobMathUtil.getShortNumber(chungus.powerBuffer) + "HE (" +
EnumChatFormatting.RESET + blocks[chungus.powerBuffer <= 0 ? 0 : time] + (int) Math.round(chungus.spin * 100) + "%" + EnumChatFormatting.WHITE + ")");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
}

View File

@ -17,6 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.List;
@Deprecated
public class MachineLargeTurbine extends BlockDummyable implements ITooltipProvider {
public MachineLargeTurbine(Material mat) {

View File

@ -77,6 +77,8 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_uzi, 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "BRM", "BGS", 'B', DESH.lightBarrel(), 'R', DESH.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', ANY_PLASTIC.grip(), 'S', DESH.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_panzerschreck, 1), new Object[] { "BBB", "PGM", 'B', DESH.heavyBarrel(), 'P', STEEL.plateCast(), 'G', DESH.grip(), 'M', GUNMETAL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_star_f, 1), new Object[] { "BRM", " G", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_star_f_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_star_f, 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3, 1), new Object[] { "BRM", "WGS", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'W', WOOD.grip(), 'G', RUBBER.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3_zebra, 1), new Object[] { " M ", "MPM", " M ", 'M', BIGMT.mechanism(), 'P', ModItems.gun_g3 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "BBB", "PGM", 'B', WEAPONSTEEL.heavyBarrel(), 'P', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'G', WEAPONSTEEL.grip(), 'M', WEAPONSTEEL.mechanism() });

View File

@ -150,10 +150,13 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
canDestroy.add(Blocks.trapdoor);
canDestroy.add(ModBlocks.machine_press);
canDestroy.add(ModBlocks.machine_epress);
canDestroy.add(ModBlocks.machine_chemplant);
canDestroy.add(ModBlocks.machine_chemical_plant);
canDestroy.add(ModBlocks.machine_chemical_factory);
canDestroy.add(ModBlocks.machine_crystallizer);
canDestroy.add(ModBlocks.machine_turbine);
canDestroy.add(ModBlocks.machine_large_turbine);
canDestroy.add(ModBlocks.machine_industrial_turbine);
canDestroy.add(ModBlocks.machine_chungus);
canDestroy.add(ModBlocks.machine_purex);
canDestroy.add(ModBlocks.crate_iron);
canDestroy.add(ModBlocks.crate_steel);
canDestroy.add(ModBlocks.machine_diesel);

View File

@ -386,8 +386,8 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
this.register(new GenericRecipe("ass.hephaestus").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_hephaestus, 1))
.inputItems(new OreDictStack(STEEL.pipe(), 12), new OreDictStack(STEEL.ingot(), 24), new OreDictStack(CU.plate(), 24), new OreDictStack(NB.ingot(), 4), new OreDictStack(RUBBER.ingot(), 12), new ComparableStack(ModBlocks.glass_quartz, 16))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 8, EnumExpensiveType.HEAVY_FRAME), new OreDictStack(NB.ingot(), 16), new OreDictStack(RUBBER.ingot(), 16), new ComparableStack(ModBlocks.glass_quartz, 16)));
this.register(new GenericRecipe("ass.iturbine").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_large_turbine, 1))
.inputItems(new OreDictStack(STEEL.plate(), 12), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 6), new OreDictStack(DURA.pipe(), 3), new OreDictStack(STEEL.pipe(), 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
this.register(new GenericRecipe("ass.iturbine").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_industrial_turbine, 1))
.inputItems(new OreDictStack(STEEL.plate(), 12), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 6), new OreDictStack(DURA.pipe(), 4), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BASIC))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.HEAVY_FRAME), new ComparableStack(ModItems.turbine_titanium, 3), new OreDictStack(GOLD.wireDense(), 16), new OreDictStack(DURA.pipe(), 16), new ComparableStack(ModItems.item_expensive, 3, EnumExpensiveType.CIRCUIT)));
this.register(new GenericRecipe("ass.leviturbine").setup(600, 100).outputItems(new ItemStack(ModBlocks.machine_chungus, 1))
.inputItems(new OreDictStack(STEEL.shell(), 6), new OreDictStack(STEEL.plateWelded(), 16), new OreDictStack(TI.plate(), 12), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 16), new ComparableStack(ModItems.turbine_tungsten, 5), new ComparableStack(ModItems.turbine_titanium, 3), new ComparableStack(ModItems.flywheel_beryllium, 1), new OreDictStack(GOLD.wireDense(), 48), new OreDictStack(DURA.pipe(), 16), new OreDictStack(STEEL.pipe(), 16))

View File

@ -1406,6 +1406,8 @@ public class ModItems {
public static Item gun_uzi_akimbo;
public static Item gun_spas12;
public static Item gun_panzerschreck;
public static Item gun_star_f;
public static Item gun_star_f_akimbo;
public static Item gun_g3;
public static Item gun_g3_zebra;
public static Item gun_stinger;
@ -6283,6 +6285,8 @@ public class ModItems {
GameRegistry.registerItem(gun_uzi_akimbo, gun_uzi_akimbo.getUnlocalizedName());
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
GameRegistry.registerItem(gun_star_f, gun_star_f.getUnlocalizedName());
GameRegistry.registerItem(gun_star_f_akimbo, gun_star_f_akimbo.getUnlocalizedName());
GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName());
GameRegistry.registerItem(gun_g3_zebra, gun_g3_zebra.getUnlocalizedName());
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());

View File

@ -66,6 +66,8 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_akimbo, new ItemRenderUziAkimbo());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f, new ItemRenderStarF());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_star_f_akimbo, new ItemRenderStarFAkimbo());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3, new ItemRenderG3(ResourceManager.g3_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3_zebra, new ItemRenderG3(ResourceManager.g3_zebra_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
@ -263,6 +265,7 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_uzi) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_spas12) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_panzerschreck) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_star_f) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_g3) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_g3_zebra) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_stinger) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
@ -305,6 +308,8 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_star_f_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_star_f_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_minigun_dual) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO_MIRROR);

View File

@ -765,6 +765,81 @@ public class Orchestras {
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STAR_F = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.1875D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 12.5F + (float)entity.getRNG().nextFloat() * 5F, casing.getName());
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
}
if(type == GunAnimation.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1.1F);
}
if(type == GunAnimation.RELOAD) {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
if(type == GunAnimation.JAMMED) {
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 19) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
if(timer == 23) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 27) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
if(type == GunAnimation.INSPECT) {
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STAR_F_AKIMBO = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
GunAnimation type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == GunAnimation.CYCLE) {
if(timer == 0) {
int side = ctx.configIndex == 0 ? -1 : 1;
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.1875D * side, 0, 0.18, -0.12 * side, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 12.5F + (float)entity.getRNG().nextFloat() * 5F, casing.getName());
PacketDispatcher.wrapper.sendToAllAround(new MuzzleFlashPacket(entity), new TargetPoint(entity.worldObj.provider.dimensionId, entity.posX, entity.posY, entity.posZ, 100));
}
}
if(type == GunAnimation.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1.1F);
}
if(type == GunAnimation.RELOAD) {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
if(type == GunAnimation.JAMMED) {
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 19) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
if(timer == 23) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 27) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
if(type == GunAnimation.INSPECT) {
if(timer == 7) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1.1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_G3 = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;

View File

@ -17,6 +17,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
import com.hbm.main.MainRegistry;
import com.hbm.main.ResourceManager;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
@ -54,23 +55,60 @@ public class XFactory22lr {
.setupStandardFire().recoil(LAMBDA_RECOIL_AM180))
.setupStandardConfiguration()
.anim(LAMBDA_AM180_ANIMS).orchestra(Orchestras.ORCHESTRA_AM180)
).setDefaultAmmo(EnumAmmo.P22_SP, 35).setNameMutator(LAMBDA_NAME_AM180)
).setDefaultAmmo(EnumAmmo.P22_SP, 35).setNameMutator(LAMBDA_NAME_SILENCED)
.setUnlocalizedName("gun_am180");
ModItems.gun_star_f = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
.setupStandardConfiguration()
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F)
).setDefaultAmmo(EnumAmmo.P22_SP, 15).setNameMutator(LAMBDA_NAME_SILENCED)
.setUnlocalizedName("gun_star_f");
ModItems.gun_star_f_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
new GunConfig().dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
.offset(1, -0.0625 * 1.5, 0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F_AKIMBO),
new GunConfig().dura(15 * 25).draw(15).inspect(38).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(12.5F).delay(5).dry(17).spread(0.01F).reload(40).jam(32).sound("hbm:weapon.fire.pistolLight", 1.0F, 1.0F)
.mag(new MagazineFullReload(1, 15).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
.offset(1, -0.0625 * 1.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_STAR_F))
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_STAR_F_ANIMS).orchestra(Orchestras.ORCHESTRA_STAR_F_AKIMBO)
).setDefaultAmmo(EnumAmmo.P9_SP, 30).setUnlocalizedName("gun_star_f_akimbo");
}
public static Function<ItemStack, String> LAMBDA_NAME_AM180 = (stack) -> {
public static Function<ItemStack, String> LAMBDA_NAME_SILENCED = (stack) -> {
if(XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER)) return stack.getUnlocalizedName() + "_silenced";
return null;
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SMOKE = (stack, ctx) -> {
Lego.handleStandardSmoke(ctx.entity, stack, 3000, 0.05D, 1.1D, 0);
Lego.handleStandardSmoke(ctx.entity, stack, 3000, 0.05D, 1.1D, ctx.configIndex);
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_AM180 = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_STAR_F = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil(2.5F, (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_AM180_ANIMS = (stack, type) -> {
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
switch(type) {
@ -109,4 +147,42 @@ public class XFactory22lr {
return null;
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, GunAnimation, BusAnimation> LAMBDA_STAR_F_ANIMS = (stack, type) -> {
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.125 : -0.5, 15, IType.SIN_DOWN).addPos(0, 0, 0, 35, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 25, IType.SIN_DOWN).addPos(0, 0, 0, 75, IType.SIN_UP))
.addBus("HAMMER", new BusAnimationSequence().addPos(1, 0, 0, 50, IType.SIN_UP).addPos(0, 0, 0, 50, IType.SIN_DOWN))
.addBus("BULLET", ammo <= 1 ? new BusAnimationSequence().setPos(100, 0, 0) : new BusAnimationSequence().addPos(0, 0, 0, 90).addPos(0, 0.5, 2.25, 50));
case CYCLE_DRY: return new BusAnimation()
.addBus("HAMMER", new BusAnimationSequence().addPos(1, 0, 0, 50, IType.SIN_UP).hold(450).addPos(0, 0, 0, 50, IType.SIN_DOWN))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.5 : -1, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 75, IType.SIN_UP))
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(-3, 0, 0, 175, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("BULLET", new BusAnimationSequence().setPos(100, 0, 0));
case RELOAD:
return new BusAnimation()
.addBus("TILT", new BusAnimationSequence().addPos(-30, 0, 0, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -1, 100, IType.SIN_FULL).hold(1125).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("MAG", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, -7, -1.5, 300, IType.SIN_UP).hold(400).addPos(0, 0, 0, 300, IType.SIN_UP))
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(3, 0, 0, 750, IType.SIN_FULL).addPos(-3, 0, 0, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 200).addPos(0, 0, 15, 300, IType.SIN_FULL).hold(900).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("BULLET", new BusAnimationSequence().setPos(ammo <= 1 ? 100 : 0, 0, 0).hold(750).setPos(0, 0, 0).hold(750).addPos(0, 0.5, 2.25, 50));
case JAMMED: return new BusAnimation()
.addBus("TILT", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-30, 0, 0, 150, IType.SIN_FULL).hold(800).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, 25, 150, IType.SIN_FULL).hold(800).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 750).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 100, IType.SIN_UP).hold(100).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(100).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("BULLET", new BusAnimationSequence().setPos(0, 0.5, 2.25).hold(750).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(100).addPos(0, 0.5, 2.25, 100, IType.SIN_UP).hold(100).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(100).addPos(0, 0.5, 2.25, 100, IType.SIN_UP));
case INSPECT: return new BusAnimation()
.addBus("TILT", new BusAnimationSequence().addPos(-30, 0, 0, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("TURN", new BusAnimationSequence().addPos(0, 0, 25, 250, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 250, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 350).addPos(0, 0, -0.5, 100, IType.SIN_FULL).hold(1125).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus("BULLET", ammo <= 1 ? new BusAnimationSequence().setPos(100, 0, 0) : new BusAnimationSequence().setPos(0, 0.5, 2.25).hold(350).addPos(0, 0.5, 1.25, 100, IType.SIN_FULL).hold(1125).addPos(0, 0.5, 2.25, 100, IType.SIN_UP));
}
return null;
};
}

View File

@ -41,7 +41,7 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
@Override
public int getComponentHeight(EntityPlayer player, ItemStack stack){
return 19;
return 17;
}
@Override

View File

@ -91,6 +91,7 @@ public class XWeaponModManager {
ModItems.gun_spas12,
ModItems.gun_panzerschreck };
Item[] wsteelGuns = new Item[] {
ModItems.gun_star_f, ModItems.gun_star_f_akimbo,
ModItems.gun_g3, ModItems.gun_g3_zebra,
ModItems.gun_stinger,
ModItems.gun_chemthrower };
@ -130,7 +131,7 @@ public class XWeaponModManager {
new WeaponModDefinition(EnumModGeneric.BRONZE_DURA).addMod(bronzeGuns, new WeaponModGenericDurability(117));
new WeaponModDefinition(EnumModSpecial.SPEEDLOADER).addMod(ModItems.gun_liberator, new WeaponModLiberatorSpeedloader(200));
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_g3, ModItems.gun_amat}, new WeaponModSilencer(ID_SILENCER));
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_star_f, ModItems.gun_star_f_akimbo, ModItems.gun_g3, ModItems.gun_amat}, new WeaponModSilencer(ID_SILENCER));
new WeaponModDefinition(EnumModSpecial.SCOPE).addMod(new Item[] {ModItems.gun_heavy_revolver, ModItems.gun_g3, ModItems.gun_mas36, ModItems.gun_charge_thrower}, new WeaponModScope(ID_SCOPE));
new WeaponModDefinition(EnumModSpecial.SAW)
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))
@ -176,7 +177,9 @@ public class XWeaponModManager {
BulletConfig[] r762 = new BulletConfig[] {XFactory762mm.r762_sp, XFactory762mm.r762_fmj, XFactory762mm.r762_jhp, XFactory762mm.r762_ap, XFactory762mm.r762_du, XFactory762mm.r762_he};
BulletConfig[] bmg50 = new BulletConfig[] {XFactory50.bmg50_sp, XFactory50.bmg50_fmj, XFactory50.bmg50_jhp, XFactory50.bmg50_ap, XFactory50.bmg50_du, XFactory50.bmg50_he};
new WeaponModDefinition(EnumModCaliber.P9)
.addMod(ModItems.gun_henry, new WeaponModCaliber(300, 28, 10F, p9));
.addMod(ModItems.gun_henry, new WeaponModCaliber(300, 28, 10F, p9))
.addMod(ModItems.gun_star_f, new WeaponModCaliber(301, 12, 15F, p9))
.addMod(ModItems.gun_star_f_akimbo, new WeaponModCaliber(302, 12, 15F, p9));
new WeaponModDefinition(EnumModCaliber.P45)
.addMod(ModItems.gun_henry, new WeaponModCaliber(310, 28, 10F, p45))
.addMod(ModItems.gun_greasegun, new WeaponModCaliber(311, 24, 3F, p45))

View File

@ -312,6 +312,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatterySocket.class, new RenderBatterySocket());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatteryREDD.class, new RenderBatteryREDD());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLargeTurbine.class, new RenderBigTurbine());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineIndustrialTurbine.class, new RenderIndustrialTurbine());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactorBreeding.class, new RenderBreeder());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarBoiler.class, new RenderSolarBoiler());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStorageDrum.class, new RenderStorageDrum());

View File

@ -105,9 +105,10 @@ public class ResourceManager {
public static final IModelCustom pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/pump.obj")).asVBO();
//Large Turbine
public static final IModelCustom steam_engine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/steam_engine.obj")).asVBO();
public static final IModelCustom turbine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/turbine.obj"));
public static final IModelCustom chungus = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/chungus.obj")).asVBO();
public static final IModelCustom steam_engine = new HFRWavefrontObject("models/machines/steam_engine.obj").asVBO();
public static final IModelCustom turbine = new HFRWavefrontObject("models/machines/turbine.obj").asVBO();
public static final IModelCustom industrial_turbine = new HFRWavefrontObject("models/machines/industrial_turbine.obj").asVBO();
public static final IModelCustom chungus = new HFRWavefrontObject("models/machines/chungus.obj").asVBO();
//Cooling Tower
public static final IModelCustom tower_small = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/tower_small.obj")).asVBO();
@ -118,13 +119,13 @@ public class ResourceManager {
public static final IModelCustom condenser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/condenser.obj")).asVBO();
//Wood burner
public static final IModelCustom wood_burner = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/wood_burner.obj"));
public static final IModelCustom wood_burner = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/wood_burner.obj")).asVBO();
//IGen
public static final IModelCustom igen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/igen.obj"));
//Combustion Engine
public static final IModelCustom dieselgen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/dieselgen.obj"));
public static final IModelCustom dieselgen = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/dieselgen.obj")).asVBO();
public static final IModelCustom combustion_engine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/combustion_engine.obj")).asVBO();
//Press
@ -159,7 +160,7 @@ public class ResourceManager {
public static final IModelCustom purex = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/purex.obj")).asVBO();
//Mixer
public static final IModelCustom mixer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mixer.obj"));
public static final IModelCustom mixer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mixer.obj")).asVBO();
//Arc Welder
public static final IModelCustom arc_welder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/arc_welder.obj"), false).asVBO();
@ -183,7 +184,7 @@ public class ResourceManager {
public static final IModelCustom microwave = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/microwave.obj"));
//Big Man Johnson
public static final IModelCustom autosaw = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/autosaw.obj"));
public static final IModelCustom autosaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/autosaw.obj"), false).asVBO();
//Mining Drill
public static final IModelCustom mining_drill = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mining_drill.obj")).asVBO();
@ -546,6 +547,7 @@ public class ResourceManager {
//Large Turbine
public static final ResourceLocation steam_engine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/steam_engine.png");
public static final ResourceLocation turbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/turbine.png");
public static final ResourceLocation industrial_turbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/industrial_turbine.png");
public static final ResourceLocation chungus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chungus.png");
//Cooling Tower
@ -913,6 +915,7 @@ public class ResourceManager {
public static final IModelCustom uzi = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/uzi.obj")).asVBO();
public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj")).asVBO();
public static final IModelCustom panzerschreck = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/panzerschreck.obj")).asVBO();
public static final IModelCustom star_f = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/star_f.obj")).asVBO();
public static final IModelCustom g3 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/g3.obj")).asVBO();
public static final IModelCustom stinger = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/stinger.obj")).asVBO();
public static final IModelCustom chemthrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chemthrower.obj")).asVBO();
@ -1037,6 +1040,8 @@ public class ResourceManager {
public static final ResourceLocation uzi_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi.png");
public static final ResourceLocation uzi_saturnite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi_saturnite.png");
public static final ResourceLocation panzerschreck_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/panzerschreck.png");
public static final ResourceLocation star_f_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f.png");
public static final ResourceLocation star_f_elite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/star_f_elite.png");
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png");
public static final ResourceLocation g3_zebra_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_zebra.png");
public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");

View File

@ -0,0 +1,204 @@
package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderStarF extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
public float getViewFOV(ItemStack stack, float fov) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
return fov * (1 - aimingProgress * 0.33F);
}
@Override
public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
float offset = 0.8F;
standardAimingTransform(stack,
-1.75F * offset, -1.75F * offset, 2.5F * offset,
0, -7.625 / 8D, 1);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER");
double[] tilt = HbmAnimations.getRelevantTransformation("TILT");
double[] turn = HbmAnimations.getRelevantTransformation("TURN");
double[] mag = HbmAnimations.getRelevantTransformation("MAG");
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET");
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE");
GL11.glTranslated(0, -2, -8);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 2, 8);
GL11.glTranslated(0, 1, -3);
GL11.glRotated(turn[2], 0, 0, 1);
GL11.glRotated(tilt[0], 1, 0, 0);
GL11.glTranslated(0, -1, 3);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.star_f.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.75, -4.25);
GL11.glRotated(60 * (hammer[0] - 1), 1, 0, 0);
GL11.glTranslated(0, -1.75, 4.25);
ResourceManager.star_f.renderPart("Hammer");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, slide[2] * 2.3125);
ResourceManager.star_f.renderPart("Slide");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]);
ResourceManager.star_f.renderPart("Mag");
GL11.glTranslated(bullet[0], bullet[1], bullet[2]);
ResourceManager.star_f.renderPart("Bullet");
GL11.glPopMatrix();
if(hasSilencer(stack)) {
GL11.glPushMatrix();
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
GL11.glPopMatrix();
} else {
double smokeScale = 0.5;
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.125);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.75D);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.125);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
this.renderMuzzleFlash(gun.lastShot[0], 75, 7.5);
GL11.glPopMatrix();
}
}
@Override
public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glTranslated(0, -0.25, 1.75);
double scale = 0.75D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 1.5D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(-1, -0.5, 0);
}
@Override
public void setupModTable(ItemStack stack) {
double scale = -6.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(0, -0.25, -5);
}
@Override
public void renderModTable(ItemStack stack, int index) {
GL11.glEnable(GL11.GL_LIGHTING);
renderStandardGun(stack);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
boolean silenced = hasSilencer(stack);
if(silenced && type == ItemRenderType.INVENTORY) {
double scale = 0.625D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -6);
}
renderStandardGun(stack);
if(type == ItemRenderType.EQUIPPED && !silenced) {
EntityLivingBase ent = (EntityLivingBase) data[1];
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[0];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.25);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}
public boolean hasSilencer(ItemStack stack) {
return XWeaponModManager.hasUpgrade(stack, 0, XWeaponModManager.ID_SILENCER);
}
public void renderStandardGun(ItemStack stack) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_tex);
ResourceManager.star_f.renderPart("Gun");
ResourceManager.star_f.renderPart("Slide");
ResourceManager.star_f.renderPart("Mag");
ResourceManager.star_f.renderPart("Hammer");
boolean silenced = hasSilencer(stack);
if(silenced) {
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
}
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -0,0 +1,293 @@
package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mods.XWeaponModManager;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class ItemRenderStarFAkimbo extends ItemRenderWeaponBase {
@Override public boolean isAkimbo() { return true; }
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
public float getViewFOV(ItemStack stack, float fov) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
return fov * (1 - aimingProgress * 0.33F);
}
@Override
public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 0.875);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
float offset = 0.8F;
for(int i = -1; i <= 1; i += 2) {
int index = i == -1 ? 0 : 1;
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
GL11.glPushMatrix();
standardAimingTransform(stack, -2F * offset * i, -1.75F * offset, 2.5F * offset, 0, -7.625 / 8D, 1);
double scale = 0.25D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP", index);
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL", index);
double[] hammer = HbmAnimations.getRelevantTransformation("HAMMER", index);
double[] tilt = HbmAnimations.getRelevantTransformation("TILT", index);
double[] turn = HbmAnimations.getRelevantTransformation("TURN", index);
double[] mag = HbmAnimations.getRelevantTransformation("MAG", index);
double[] bullet = HbmAnimations.getRelevantTransformation("BULLET", index);
double[] slide = HbmAnimations.getRelevantTransformation("SLIDE", index);
GL11.glTranslated(0, -2, -8);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 2, 8);
GL11.glTranslated(0, 1, -3);
GL11.glRotated(turn[2] * i, 0, 0, 1);
GL11.glRotated(tilt[0], 1, 0, 0);
GL11.glTranslated(0, -1, 3);
GL11.glTranslated(0, 0, recoil[2]);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.star_f.renderPart("Gun");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.75, -4.25);
GL11.glRotated(60 * (hammer[0] - 1), 1, 0, 0);
GL11.glTranslated(0, -1.75, 4.25);
ResourceManager.star_f.renderPart("Hammer");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, slide[2] * 2.3125);
ResourceManager.star_f.renderPart("Slide");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(mag[0], mag[1], mag[2]);
ResourceManager.star_f.renderPart("Mag");
GL11.glTranslated(bullet[0], bullet[1], bullet[2]);
ResourceManager.star_f.renderPart("Bullet");
GL11.glPopMatrix();
if(hasSilencer(stack, index)) {
GL11.glPushMatrix();
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
GL11.glPopMatrix();
} else {
double smokeScale = 0.5;
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.125);
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(smokeScale, smokeScale, smokeScale);
this.renderSmokeNodes(gun.getConfig(stack, index).smokeNodes, 0.75D);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
renderMuzzleFlash(gun.shotRand, gun.lastShot[index]);
}
GL11.glPopMatrix();
}
}
@Override
public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glTranslated(0, -0.25, 1.75);
double scale = 0.75D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupThirdPersonAkimbo(ItemStack stack) {
super.setupThirdPersonAkimbo(stack);
GL11.glTranslated(0, -0.25, 1.75);
double scale = 0.75D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupInv(ItemStack stack) {
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glScaled(1, 1, -1);
GL11.glTranslated(8, 8, 0);
double scale = 1.5D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupModTable(ItemStack stack) {
double scale = -6.25D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(0, -0.25, -5);
}
@Override
public void renderEquipped(ItemStack stack, Object... data) {
renderStandardGun(stack, 1);
if(!hasSilencer(stack, 1)) renderThirdPersonFlash((EntityLivingBase) data[1], stack, 1);
}
@Override
public void renderEquippedAkimbo(ItemStack stack, EntityLivingBase ent) {
renderStandardGun(stack, 0);
if(!hasSilencer(stack, 0)) renderThirdPersonFlash(ent, stack, 0);
}
@Override
public void renderModTable(ItemStack stack, int index) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
ResourceManager.star_f.renderPart("Gun");
ResourceManager.star_f.renderPart("Slide");
ResourceManager.star_f.renderPart("Mag");
ResourceManager.star_f.renderPart("Hammer");
if(hasSilencer(stack, index)) {
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
}
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderEntity(ItemStack stack) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
boolean anySilenced = hasSilencer(stack, 0) || hasSilencer(stack, 1);
if(anySilenced) {
GL11.glScaled(0.75, 0.75, 0.75);
}
GL11.glPushMatrix();
GL11.glTranslated(-1, 1, 0);
renderStandardGun(stack, 1);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(1, 1, 0);
renderStandardGun(stack, 0);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type, Object... data) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
boolean anySilenced = hasSilencer(stack, 0) || hasSilencer(stack, 1);
GL11.glPushMatrix();
GL11.glRotated(225, 0, 0, 1);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(0.5, 0, 0);
if(anySilenced) {
double scale = 0.625D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -4);
}
renderStandardGun(stack, 1);
GL11.glPopMatrix();
GL11.glTranslated(0, 0, 5);
GL11.glPushMatrix();
GL11.glRotated(225, 0, 0, 1);
GL11.glRotated(-90, 0, 1, 0);
GL11.glRotated(-90, 1, 0, 0);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(-45, 0, 1, 0);
GL11.glTranslated(-0.5, 0, 0);
if(anySilenced) {
double scale = 0.625D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, -4);
}
renderStandardGun(stack, 0);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
}
public boolean hasSilencer(ItemStack stack, int cfg) {
return XWeaponModManager.hasUpgrade(stack, cfg, XWeaponModManager.ID_SILENCER);
}
public void renderStandardGun(ItemStack stack, int index) {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.star_f_elite_tex);
ResourceManager.star_f.renderPart("Gun");
ResourceManager.star_f.renderPart("Slide");
ResourceManager.star_f.renderPart("Mag");
ResourceManager.star_f.renderPart("Hammer");
boolean silenced = hasSilencer(stack, index);
if(silenced) {
GL11.glTranslated(0, 2.375, -0.25);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.uzi_tex);
ResourceManager.uzi.renderPart("Silencer");
}
GL11.glShadeModel(GL11.GL_FLAT);
}
public void renderThirdPersonFlash(Entity ent, ItemStack stack, int config) {
long shot;
double shotRand = 0;
if(ent == Minecraft.getMinecraft().thePlayer) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
shot = gun.lastShot[config];
shotRand = gun.shotRand;
} else {
shot = ItemRenderWeaponBase.flashMap.getOrDefault(ent, (long) -1);
if(shot < 0) return;
}
renderMuzzleFlash(shotRand, shot);
}
public void renderMuzzleFlash(double shotRand, long shot) {
GL11.glPushMatrix();
GL11.glTranslated(0, 3, 6.125);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * shotRand, 1, 0, 0);
this.renderMuzzleFlash(shot, 75, 7.5);
GL11.glPopMatrix();
}
}

View File

@ -13,6 +13,8 @@ import java.util.regex.Pattern;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
@ -51,6 +53,15 @@ public class HFRWavefrontObject implements IModelCustomNamed {
private String fileName;
private boolean smoothing = true;
public HFRWavefrontObject(String name) throws ModelFormatException {
this(new ResourceLocation(RefStrings.MODID, name));
}
public HFRWavefrontObject noSmooth() {
this.smoothing = false;
return this;
}
public HFRWavefrontObject(ResourceLocation resource) throws ModelFormatException {
this.resource = resource;
this.fileName = resource.toString();

View File

@ -0,0 +1,92 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.main.ResourceManager;
import com.hbm.render.item.ItemRenderBase;
import com.hbm.tileentity.machine.TileEntityMachineIndustrialTurbine;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderIndustrialTurbine extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
switch(tile.getBlockMetadata() - 10) {
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
}
TileEntityMachineIndustrialTurbine turbine = (TileEntityMachineIndustrialTurbine) tile;
bindTexture(ResourceManager.industrial_turbine_tex);
ResourceManager.industrial_turbine.renderPart("Turbine");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 0);
GL11.glRotated(135 - (turbine.tanks[0].getTankType().getID() - Fluids.STEAM.getID()) * 90, 0, 0, 1);
GL11.glTranslated(0, -1.5, 0);
ResourceManager.industrial_turbine.renderPart("Gauge");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 1.5, 0);
GL11.glRotated(turbine.lastRotor + (turbine.rotor - turbine.lastRotor) * interp, 0, 0, -1);
GL11.glTranslated(0, -1.5, 0);
ResourceManager.industrial_turbine.renderPart("Flywheel");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.machine_industrial_turbine);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase( ) {
public void renderInventory() {
GL11.glTranslated(1, 0, 0);
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
GL11.glRotatef(90, 0F, 1F, 0F);
GL11.glScaled(0.75, 0.75, 0.75);
GL11.glTranslated(0.5, 0, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.industrial_turbine_tex);
ResourceManager.industrial_turbine.renderPart("Turbine");
GL11.glTranslated(0, 1.5, 0);
GL11.glRotated(135, 0, 0, 1);
GL11.glTranslated(0, -1.5, 0);
ResourceManager.industrial_turbine.renderPart("Gauge");
double rot = (System.currentTimeMillis() / 5) % 336D;
GL11.glTranslated(0, 1.5, 0);
GL11.glRotated(rot, 0, 0, -1);
GL11.glTranslated(0, -1.5, 0);
ResourceManager.industrial_turbine.renderPart("Flywheel");
GL11.glShadeModel(GL11.GL_FLAT);
}
};
}
}

View File

@ -172,13 +172,18 @@ public abstract class DoorDecl {
return null;
}
public final ResourceLocation[] skins = new ResourceLocation[] {
ResourceManager.pheo_fire_door_tex,
ResourceManager.pheo_fire_door_black_tex,
ResourceManager.pheo_fire_door_orange_tex,
};
public ResourceLocation[] skins;
@Override public ResourceLocation[] getSEDNASkins() { return skins; }
@SideOnly(Side.CLIENT) @Override public ResourceLocation[] getSEDNASkins() {
if(skins == null) skins = new ResourceLocation[] {
ResourceManager.pheo_fire_door_tex,
ResourceManager.pheo_fire_door_black_tex,
ResourceManager.pheo_fire_door_orange_tex,
};
return skins;
}
public int getSkinCount() { return 3; }
@Override public int timeToOpen() { return 160; }
@Override public int[][] getDoorOpenRanges() { return new int[][] { { -1, 0, 0, 3, 4, 1 } }; }
@ -301,12 +306,17 @@ public abstract class DoorDecl {
else return super.getBlockBound(x, y, z, open, forCollision);
}
public final ResourceLocation[] skins = new ResourceLocation[] {
ResourceManager.pheo_secure_door_tex,
ResourceManager.pheo_secure_door_grey_tex
};
public ResourceLocation[] skins;
@Override public ResourceLocation[] getSEDNASkins() { return skins; }
@Override public ResourceLocation[] getSEDNASkins() {
if(skins == null) skins = new ResourceLocation[] {
ResourceManager.pheo_secure_door_tex,
ResourceManager.pheo_secure_door_grey_tex
};
return skins;
}
public int getSkinCount() { return 2; }
};
public static final DoorDecl ROUND_AIRLOCK_DOOR = new DoorDecl() {
@ -327,13 +337,18 @@ public abstract class DoorDecl {
return null;
}
public final ResourceLocation[] skins = new ResourceLocation[] {
ResourceManager.pheo_airlock_door_tex,
ResourceManager.pheo_airlock_door_clean_tex,
ResourceManager.pheo_airlock_door_green_tex
};
public ResourceLocation[] skins;
@Override public ResourceLocation[] getSEDNASkins() { return skins; }
@SideOnly(Side.CLIENT) @Override public ResourceLocation[] getSEDNASkins() {
if(skins == null) skins = new ResourceLocation[] {
ResourceManager.pheo_airlock_door_tex,
ResourceManager.pheo_airlock_door_clean_tex,
ResourceManager.pheo_airlock_door_green_tex
};
return skins;
}
public int getSkinCount() { return 3; }
@Override
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open, boolean forCollision) {
@ -670,11 +685,7 @@ public abstract class DoorDecl {
public ResourceLocation[] getSEDNASkins() { return null; }
public boolean hasSkins() { return getSkinCount() > 0; }
public int getSkinCount() {
ResourceLocation[] skins = this.getSEDNASkins();
if(skins == null || skins.length <= 1) return 0;
return skins.length;
}
public int getSkinCount() { return 0; }
public ResourceLocation getCyclingSkins() {
ResourceLocation[] skins = this.getSEDNASkins();

View File

@ -7,6 +7,7 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.tank.FluidTank;
import api.hbm.energymk2.IEnergyConductorMK2;
import api.hbm.energymk2.IEnergyConnectorMK2;
import api.hbm.energymk2.IEnergyReceiverMK2;
import api.hbm.fluidmk2.IFluidConnectorMK2;
import api.hbm.fluidmk2.IFluidReceiverMK2;
@ -148,15 +149,15 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
@Override
public boolean canConnect(ForgeDirection dir) {
if(power && getCoreObject() instanceof IEnergyReceiverMK2) {
return ((IEnergyReceiverMK2)getCoreObject()).canConnect(dir);
if(power && getCoreObject() instanceof IEnergyConnectorMK2) {
return ((IEnergyConnectorMK2)getCoreObject()).canConnect(dir);
}
if(conductor && getCoreObject() instanceof IEnergyConductorMK2) {
return ((IEnergyConductorMK2)getCoreObject()).canConnect(dir);
}
return true;
return false;
}
@Override

View File

@ -347,6 +347,7 @@ public class TileMappings {
put(TileEntitySteamEngine.class, "tileentity_steam_engine");
put(TileEntityMachineTurbine.class, "tileentity_turbine");
put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
put(TileEntityMachineIndustrialTurbine.class, "tileentity_ind_turbine");
put(TileEntityChungus.class, "tileentity_chungus");
put(TileEntityMachineCombustionEngine.class, "tileentity_combustion_engine");

View File

@ -7,54 +7,35 @@ import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.CompatHandler;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Coolable;
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IBufPacketReceiver;
import com.hbm.tileentity.IFluidCopiable;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.CompatEnergyControl;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energymk2.IEnergyProviderMK2;
import api.hbm.fluid.IFluidStandardTransceiver;
import api.hbm.tile.IInfoProviderEC;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IBufPacketReceiver, IFluidCopiable{
public class TileEntityChungus extends TileEntityTurbineBase implements SimpleComponent, CompatHandler.OCComponent, IConfigurableMachine {
public long power;
private int turnTimer;
public float rotor;
public float lastRotor;
public float fanAcceleration = 0F;
public FluidTank[] tanks;
protected double[] info = new double[3];
private AudioWrapper audio;
private float audioDesync;
//Configurable values
public static long maxPower = 100000000000L;
public static int inputTankSize = 1_000_000_000;
public static int outputTankSize = 1_000_000_000;
public static double efficiency = 0.85D;
@ -75,7 +56,6 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
@Override
public void readIfPresent(JsonObject obj) {
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
@ -83,123 +63,16 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:maxPower").value(maxPower);
writer.name("INFO").value("leviathan steam turbine consumes all availible steam per tick");
writer.name("I:inputTankSize").value(inputTankSize);
writer.name("I:outputTankSize").value(outputTankSize);
writer.name("D:efficiency").value(efficiency);
}
@Override public double consumptionPercent() { return 1D; }
@Override public double getEfficiency() { return efficiency; }
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
this.power *= 0.95;
this.info = new double[3];
boolean operational = false;
FluidType in = tanks[0].getTankType();
boolean valid = false;
if(in.hasTrait(FT_Coolable.class)) {
FT_Coolable trait = in.getTrait(FT_Coolable.class);
double eff = trait.getEfficiency(CoolingType.TURBINE) * efficiency; //85% efficiency by default
if(eff > 0) {
tanks[1].setTankType(trait.coolsTo);
int inputOps = tanks[0].getFill() / trait.amountReq;
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
int ops = Math.min(inputOps, outputOps);
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
this.power += (ops * trait.heatEnergy * eff);
info[0] = ops * trait.amountReq;
info[1] = ops * trait.amountProduced;
info[2] = ops * trait.heatEnergy * eff;
valid = true;
operational = ops > 0;
}
}
if(!valid) tanks[1].setTankType(Fluids.NONE);
if(power > maxPower) power = maxPower;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
this.tryProvide(worldObj, xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite());
for(DirPos pos : this.getConPos()) {
this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
if(power > maxPower)
power = maxPower;
turnTimer--;
if(operational) turnTimer = 25;
networkPackNT(150);
} else {
this.lastRotor = this.rotor;
this.rotor += this.fanAcceleration;
if(this.rotor >= 360) {
this.rotor -= 360;
this.lastRotor -= 360;
}
if(turnTimer > 0) {
// Fan accelerates with a random offset to ensure the audio doesn't perfectly align, makes for a more pleasant hum
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration += 0.075F + audioDesync));
Random rand = worldObj.rand;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection side = dir.getRotation(ForgeDirection.UP);
for(int i = 0; i < 10; i++) {
worldObj.spawnParticle("cloud",
xCoord + 0.5 + dir.offsetX * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetX * 0.65,
yCoord + 2.5 + rand.nextGaussian() * 0.65,
zCoord + 0.5 + dir.offsetZ * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetZ * 0.65,
-dir.offsetX * 0.2, 0, -dir.offsetZ * 0.2);
}
if(audio == null) {
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chungusTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 20F, 1.0F);
audio.startSound();
}
float turbineSpeed = this.fanAcceleration / 25F;
audio.updateVolume(getVolume(0.5f * turbineSpeed));
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
} else {
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration -= 0.1F));
if(audio != null) {
if(this.fanAcceleration > 0) {
float turbineSpeed = this.fanAcceleration / 25F;
audio.updateVolume(getVolume(0.5f * turbineSpeed));
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
} else {
audio.stopSound();
audio = null;
}
}
}
}
}
public void onLeverPull(FluidType previous) {
for(BlockPos pos : getConPos()) {
this.tryUnsubscribe(previous, worldObj, pos.getX(), pos.getY(), pos.getZ());
}
}
public DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
@ -209,37 +82,82 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, rot.getOpposite())
};
}
@Override
public DirPos[] getPowerPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
return new DirPos[] { new DirPos(xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, dir.getOpposite()) };
}
@Override
public void onServerTick() {
turnTimer--;
if(operational) turnTimer = 25;
}
@Override
public void onClientTick() {
this.lastRotor = this.rotor;
this.rotor += this.fanAcceleration;
if(this.rotor >= 360) {
this.rotor -= 360;
this.lastRotor -= 360;
}
if(turnTimer > 0) {
// Fan accelerates with a random offset to ensure the audio doesn't perfectly align, makes for a more pleasant hum
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration += 0.075F + audioDesync));
Random rand = worldObj.rand;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection side = dir.getRotation(ForgeDirection.UP);
for(int i = 0; i < 10; i++) {
worldObj.spawnParticle("cloud",
xCoord + 0.5 + dir.offsetX * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetX * 0.65,
yCoord + 2.5 + rand.nextGaussian() * 0.65,
zCoord + 0.5 + dir.offsetZ * (rand.nextDouble() + 1.25) + rand.nextGaussian() * side.offsetZ * 0.65,
-dir.offsetX * 0.2, 0, -dir.offsetZ * 0.2);
}
if(audio == null) {
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chungusTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 20F, 1.0F, 20);
audio.startSound();
}
float turbineSpeed = this.fanAcceleration / 25F;
audio.updateVolume(getVolume(0.5f * turbineSpeed));
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
audio.keepAlive();
} else {
this.fanAcceleration = Math.max(0F, Math.min(25F, this.fanAcceleration -= 0.1F));
if(audio != null) {
if(this.fanAcceleration > 0) {
float turbineSpeed = this.fanAcceleration / 25F;
audio.updateVolume(getVolume(0.5f * turbineSpeed));
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
} else {
audio.stopSound();
audio = null;
}
}
}
}
@Override
public void serialize(ByteBuf buf) {
buf.writeLong(this.power);
super.serialize(buf);
buf.writeInt(this.turnTimer);
this.tanks[0].serialize(buf);
this.tanks[1].serialize(buf);
}
@Override
public void deserialize(ByteBuf buf) {
this.power = buf.readLong();
super.deserialize(buf);
this.turnTimer = buf.readInt();
this.tanks[0].deserialize(buf);
this.tanks[1].deserialize(buf);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
tanks[0].readFromNBT(nbt, "water");
tanks[1].readFromNBT(nbt, "steam");
power = nbt.getLong("power");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
tanks[0].writeToNBT(nbt, "water");
tanks[1].writeToNBT(nbt, "steam");
nbt.setLong("power", power);
}
@Override
@ -247,32 +165,11 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UP && dir != ForgeDirection.DOWN && dir != ForgeDirection.UNKNOWN;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
@Override
public void setPower(long power) {
this.power = power;
}
@Override
@Optional.Method(modid = "OpenComputers")
public String getComponentName() {
@ -321,13 +218,13 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
@Callback(direct = true, doc = "function():number -- Gets the power buffer of the turbine.")
@Optional.Method(modid = "OpenComputers")
public Object[] getPower(Context context, Arguments args) {
return new Object[] {power};
return new Object[] {powerBuffer};
}
@Callback(direct = true, doc = "function():table -- Gets information about this turbine. The format is the following: <input tank amount>, <input tank capacity>, <output tank amount>, <output tank capacity>, <input tank fluid type>, <power>")
@Optional.Method(modid = "OpenComputers")
public Object[] getInfo(Context context, Arguments args) {
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], power};
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], powerBuffer};
}
@Override
@ -357,34 +254,6 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr
case ("getInfo"):
return getInfo(context, args);
}
throw new NoSuchMethodException();
}
@Override
public FluidTank[] getSendingTanks() {
return new FluidTank[] {tanks[1]};
}
@Override
public FluidTank[] getReceivingTanks() {
return new FluidTank[] {tanks[0]};
}
@Override
public FluidTank[] getAllTanks() {
return tanks;
}
@Override
public void provideExtraInfo(NBTTagCompound data) {
data.setBoolean(CompatEnergyControl.B_ACTIVE, info[1] > 0);
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, info[0]);
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, info[1]);
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, info[2]);
}
@Override
public FluidTank getTankToPaste() {
return null;
throw new NoSuchMethodException();
}
}

View File

@ -0,0 +1,237 @@
package com.hbm.tileentity.machine;
import java.io.IOException;
import java.util.Random;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.BlockDummyable;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Coolable;
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.util.fauxpointtwelve.DirPos;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase implements IConfigurableMachine {
public static int inputTankSize = 512_000;
public static int outputTankSize = 2_048_000;
public static double efficiency = 1D;
public float rotor;
public float lastRotor;
public double spin = 0;
public static double ACCELERATION = 1D / 400D;
public long lastPowerTarget = 0;
private AudioWrapper audio;
private float audioDesync;
@Override
public String getConfigName() {
return "steamturbineIndustrial";
}
@Override
public void readIfPresent(JsonObject obj) {
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
writer.name("I:inputTankSize").value(inputTankSize);
writer.name("I:outputTankSize").value(outputTankSize);
writer.name("D:efficiency").value(efficiency);
}
public TileEntityMachineIndustrialTurbine() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(Fluids.STEAM, inputTankSize);
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, outputTankSize);
Random rand = new Random();
audioDesync = rand.nextFloat() * 0.05F;
}
// sets the power target so we know how much this steam type can theoretically make, and increments the spin based on actual throughput
@Override
public void generatePower(long power, int steamConsumed) {
FT_Coolable trait = tanks[0].getTankType().getTrait(FT_Coolable.class);
double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency();
int maxOps = (int) Math.ceil((tanks[0].getMaxFill() * consumptionPercent()) / trait.amountReq);
this.lastPowerTarget = (long) (maxOps * trait.heatEnergy * eff); // theoretical max output at full blast with this type
double fraction = (double) steamConsumed / (double) (trait.amountReq * maxOps); // % of max steam throughput currently achieved
if(Math.abs(spin - fraction) <= ACCELERATION) {
this.spin = fraction;
} else if(spin < fraction) {
this.spin += ACCELERATION;
} else if(spin > fraction) {
this.spin -= ACCELERATION;
}
}
@Override
public void onServerTick() {
if(!operational) {
this.spin -= ACCELERATION;
}
if(this.spin <= 0) {
this.spin = 0;
} else {
this.powerBuffer = (long) (this.lastPowerTarget * this.spin);
}
}
@Override
public void onClientTick() {
this.lastRotor = this.rotor;
this.rotor += this.spin * 30;
if(this.rotor >= 360) {
this.lastRotor -= 360;
this.rotor -= 360;
}
if(this.spin > 0 && MainRegistry.proxy.me().getDistance(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) <= 35) {
float spinNum = (float) Math.min(1F, spin * 2);
float volume = this.getVolume(0.25F + spinNum * 0.75F);
float pitch = 0.5F + spinNum * 0.5F + this.audioDesync;
if(audio == null) {
audio = MainRegistry.proxy.getLoopedSound("hbm:block.largeTurbineRunning", xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, volume, 20F, pitch, 20);
audio.startSound();
}
audio.keepAlive();
audio.updatePitch(pitch);
audio.updateVolume(volume);
} else {
if(audio != null) {
audio.stopSound();
audio = null;
}
}
}
@Override
public boolean canConnect(ForgeDirection dir) {
ForgeDirection myDir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
return dir == myDir.getOpposite();
}
@Override
public boolean canConnect(FluidType type, ForgeDirection dir) {
if(!type.hasTrait(FT_Coolable.class)) return false;
ForgeDirection myDir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
return dir != myDir && dir != myDir.getOpposite();
}
@Override public double consumptionPercent() { return 0.2D; }
@Override public double getEfficiency() { return efficiency; }
@Override public boolean doesResizeCompressor() { return true; }
@Override
public void onChunkUnload() {
super.onChunkUnload();
if(audio != null) {
audio.stopSound();
audio = null;
}
}
@Override
public void invalidate() {
super.invalidate();
if(audio != null) {
audio.stopSound();
audio = null;
}
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeDouble(this.spin);
}
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
this.spin = buf.readDouble();
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
lastPowerTarget = nbt.getLong("lastPowerTarget");
spin = nbt.getDouble("spin");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("lastPowerTarget", lastPowerTarget);
nbt.setDouble("spin", spin);
}
@Override
public DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
return new DirPos[] {
new DirPos(xCoord + dir.offsetX * 3 + rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 3 + rot.offsetZ * 2, rot),
new DirPos(xCoord + dir.offsetX * 3 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 3 - rot.offsetZ * 2, rot.getOpposite()),
new DirPos(xCoord - dir.offsetX * 1 + rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 1 + rot.offsetZ * 2, rot),
new DirPos(xCoord - dir.offsetX * 1 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 1 - rot.offsetZ * 2, rot.getOpposite()),
new DirPos(xCoord + dir.offsetX * 3, yCoord + 3, zCoord + dir.offsetZ * 3, ForgeDirection.UP),
new DirPos(xCoord - dir.offsetX * 1, yCoord + 3, zCoord - dir.offsetZ * 1, ForgeDirection.UP),
};
}
@Override
public DirPos[] getPowerPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
return new DirPos[] {
new DirPos(xCoord - dir.offsetX * 4, yCoord + 1, zCoord - dir.offsetZ * 4, dir.getOpposite())
};
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 3,
yCoord,
zCoord - 3,
xCoord + 4,
yCoord + 3,
zCoord + 4
);
}
return bb;
}
}

View File

@ -1,10 +1,7 @@
package com.hbm.tileentity.machine;
import java.util.Random;
import java.io.IOException;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.CompatHandler;
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
@ -18,7 +15,6 @@ import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IFluidCopiable;
import com.hbm.tileentity.IConfigurableMachine;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.CompatEnergyControl;
@ -44,7 +40,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IConfigurableMachine, IFluidCopiable {
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent, IFluidCopiable {
public long power;
public FluidTank[] tanks;
@ -76,28 +72,6 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
audioDesync = rand.nextFloat() * 0.05F;
}
@Override
public String getConfigName() {
return "steamturbineIndustrial";
}
@Override
public void readIfPresent(JsonObject obj) {
maxPower = IConfigurableMachine.grab(obj, "L:maxPower", maxPower);
inputTankSize = IConfigurableMachine.grab(obj, "I:inputTankSize", inputTankSize);
outputTankSize = IConfigurableMachine.grab(obj, "I:outputTankSize", outputTankSize);
efficiency = IConfigurableMachine.grab(obj, "D:efficiency", efficiency);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:maxPower").value(maxPower);
writer.name("INFO").value("industrial steam turbine consumes 20% of availible steam per tick");
writer.name("I:inputTankSize").value(inputTankSize);
writer.name("I:outputTankSize").value(outputTankSize);
writer.name("D:efficiency").value(efficiency);
}
@Override
public String getName() {
return "container.machineLargeTurbine";

View File

@ -70,7 +70,7 @@ public class TileEntitySteamEngine extends TileEntityLoadedBase implements IEner
writer.name("D:efficiency").value(efficiency);
}
ByteBuf buf;
protected ByteBuf buf;
@Override
public void updateEntity() {

View File

@ -0,0 +1,184 @@
package com.hbm.tileentity.machine;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Coolable;
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
import com.hbm.tileentity.IBufPacketReceiver;
import com.hbm.tileentity.IFluidCopiable;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.CompatEnergyControl;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energymk2.IEnergyProviderMK2;
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
import api.hbm.tile.IInfoProviderEC;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.nbt.NBTTagCompound;
public abstract class TileEntityTurbineBase extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IInfoProviderEC, IBufPacketReceiver, IFluidCopiable {
protected ByteBuf buf;
public long powerBuffer;
public FluidTank[] tanks;
protected double[] info = new double[3];
public boolean operational = false;
public abstract double getEfficiency();
public abstract DirPos[] getConPos();
public abstract DirPos[] getPowerPos();
public abstract double consumptionPercent();
public void generatePower(long power, int steamConsumed) {
this.powerBuffer += power;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
this.powerBuffer = 0;
this.info = new double[3];
if(this.buf != null) this.buf.release();
this.buf = Unpooled.buffer();
this.tanks[0].serialize(buf);
operational = false;
FluidType in = tanks[0].getTankType();
boolean valid = false;
if(in.hasTrait(FT_Coolable.class)) {
FT_Coolable trait = in.getTrait(FT_Coolable.class);
double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency();
if(eff > 0) {
tanks[1].setTankType(trait.coolsTo);
int inputOps = (int) Math.ceil((tanks[0].getFill() * consumptionPercent()) / trait.amountReq);
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
int ops = Math.min(inputOps, outputOps);
if(ops > 0) {
tanks[0].setFill(tanks[0].getFill() - ops * trait.amountReq);
tanks[1].setFill(tanks[1].getFill() + ops * trait.amountProduced);
this.generatePower((long) (ops * trait.heatEnergy * eff), ops * trait.amountReq);
}
info[0] = ops * trait.amountReq;
info[1] = ops * trait.amountProduced;
info[2] = ops * trait.heatEnergy * eff;
valid = true;
operational = ops > 0;
}
}
onServerTick();
this.tanks[1].serialize(buf);
this.buf.writeLong(this.powerBuffer);
if(!valid) tanks[1].setTankType(Fluids.NONE);
for(DirPos pos : this.getPowerPos()) {
this.tryProvide(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
for(DirPos pos : this.getConPos()) {
this.tryProvide(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
networkPackNT(150);
} else {
onClientTick();
}
}
public void onServerTick() { }
public void onClientTick() { }
public void onLeverPull() {
FluidType type = tanks[0].getTankType();
boolean resize = this.doesResizeCompressor();
if(type == Fluids.STEAM) {
tanks[0].setTankType(Fluids.HOTSTEAM); tanks[1].setTankType(Fluids.STEAM);
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() / 10); tanks[1].changeTankSize(tanks[1].getMaxFill() / 10); }
} else if(type == Fluids.HOTSTEAM) {
tanks[0].setTankType(Fluids.SUPERHOTSTEAM); tanks[1].setTankType(Fluids.HOTSTEAM);
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() / 10); tanks[1].changeTankSize(tanks[1].getMaxFill() / 10); }
} else if(type == Fluids.SUPERHOTSTEAM) {
tanks[0].setTankType(Fluids.ULTRAHOTSTEAM); tanks[1].setTankType(Fluids.SUPERHOTSTEAM);
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() / 10); tanks[1].changeTankSize(tanks[1].getMaxFill() / 10); }
} else if(type == Fluids.ULTRAHOTSTEAM) {
tanks[0].setTankType(Fluids.STEAM); tanks[1].setTankType(Fluids.SPENTSTEAM);
if(resize) { tanks[0].changeTankSize(tanks[0].getMaxFill() * 1000); tanks[1].changeTankSize(tanks[1].getMaxFill() * 1000); }
} else {
tanks[0].setTankType(Fluids.STEAM); tanks[1].setTankType(Fluids.SPENTSTEAM);
}
markDirty();
}
public boolean doesResizeCompressor() {
return false;
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeBytes(this.buf);
}
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
this.tanks[0].deserialize(buf);
this.tanks[1].deserialize(buf);
this.powerBuffer = buf.readLong();
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
tanks[0].readFromNBT(nbt, "water");
tanks[1].readFromNBT(nbt, "steam");
powerBuffer = nbt.getLong("power");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
tanks[0].writeToNBT(nbt, "water");
tanks[1].writeToNBT(nbt, "steam");
nbt.setLong("power", powerBuffer);
}
@Override public long getPower() { return powerBuffer; }
@Override public long getMaxPower() { return powerBuffer; }
@Override public void setPower(long power) { this.powerBuffer = power; }
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; }
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; }
@Override public FluidTank[] getAllTanks() { return tanks; }
@Override
public void provideExtraInfo(NBTTagCompound data) {
data.setBoolean(CompatEnergyControl.B_ACTIVE, info[1] > 0);
data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, info[0]);
data.setDouble(CompatEnergyControl.D_OUTPUT_MB, info[1]);
data.setDouble(CompatEnergyControl.D_OUTPUT_HE, info[2]);
}
@Override public FluidTank getTankToPaste() { return null; }
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.rbmk;
import api.hbm.fluidmk2.FluidNetMK2;
import api.hbm.fluidmk2.FluidNode;
import api.hbm.fluidmk2.IFluidReceiverMK2;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.rbmk.RBMKBase;
import com.hbm.entity.effect.EntitySpear;
@ -41,12 +43,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
import java.util.*;
/**
* Base class for all RBMK components, active or passive. Handles heat and the explosion sequence
@ -502,8 +499,8 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
/* Hanlde overpressure event */
if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) {
HashSet pipeBlocks = new HashSet<>();
HashSet pipeReceivers = new HashSet<>();
HashSet<FluidNode> pipeBlocks = new HashSet<>();
HashSet<Map.Entry<IFluidReceiverMK2, Long>> pipeReceivers = new HashSet<>();
//unify all parts into single sets to prevent redundancy
pipes.forEach(x -> {
@ -513,20 +510,23 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
int count = 0;
int max = Math.min(pipeBlocks.size() / 5, 100);
Iterator itPipes = pipeBlocks.iterator();
Iterator itReceivers = pipeReceivers.iterator();
Iterator<FluidNode> itPipes = pipeBlocks.iterator();
Iterator<Map.Entry<IFluidReceiverMK2, Long>> itReceivers = pipeReceivers.iterator();
while(itPipes.hasNext() && count < max) {
Object pipe = itPipes.next();
if(pipe instanceof TileEntity) {
TileEntity tile = (TileEntity) pipe;
worldObj.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, Blocks.air);
FluidNode node = itPipes.next();
for (BlockPos pos : node.positions) {
int x = pos.getX(), y = pos.getY(), z = pos.getZ();
if (worldObj.getTileEntity(x, y ,z) != null) {
worldObj.setBlock(x, y, z, Blocks.air);
}
}
count++;
}
while(itReceivers.hasNext()) {
Object con = itReceivers.next();
Map.Entry<IFluidReceiverMK2, Long> e = itReceivers.next();
IFluidReceiverMK2 con = e.getKey();
if(con instanceof TileEntity) {
TileEntity tile = (TileEntity) con;
if(con instanceof IOverpressurable) {
@ -568,6 +568,9 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
RBMKBase.dropLids = true;
RBMKBase.digamma = false;
columns.clear();
pipes.clear();
}
private void getFF(int x, int y, int z) {

View File

@ -2224,6 +2224,9 @@ item.gun_pepperbox.name=Bündelrevolver
item.gun_panzerschreck.name=Panzerschreck
item.gun_quadro.name=Vierfachraketenwerfer
item.gun_spas12.name=SPAS-12
item.gun_star_f.name=Sportpistole
item.gun_star_f_akimbo.name=Sportpistolen
item.gun_star_f_silenced.name=Schallgedämpfte Pistole
item.gun_stg77.name=StG 77
item.gun_stinger.name=FIM-92 Stinger
item.gun_tau.name=Taukanone
@ -4559,9 +4562,11 @@ tile.machine_icf_press.name=ICF-Brennstoffpellet-Fabrikant
tile.machine_industrial_boiler.name=Industrieller Boiler
tile.machine_industrial_boiler.desc=Großer Boiler zum Verdampfen von Wasser oder$Erhitzen von Öl. Benötigt externe Hitzequelle.$Wärmestransferrate: ΔT*0.1 TU/t$Überdrucksicher
tile.machine_industrial_generator.name=Industrieller Generator
tile.machine_industrial_turbine.name=Industrielle Dampfturbine
tile.machine_industrial_turbine.desc=Effizienz: 100%%
tile.machine_intake.name=Lufteinlass
tile.machine_keyforge.name=Schlossertisch
tile.machine_large_turbine.name=Industrielle Dampfturbine
tile.machine_large_turbine.name=Industrielle Dampfturbine (LEGACY)
tile.machine_large_turbine.desc=Effizienz: 100%%
tile.machine_lithium_battery.name=Li-Ion-Energiespeicherblock (LEGACY)
tile.machine_microwave.name=Mikrowelle

View File

@ -3067,6 +3067,9 @@ item.gun_pepperbox.name=Pepperbox
item.gun_panzerschreck.name=Panzerschreck
item.gun_quadro.name=Quad Rocket Launcher
item.gun_spas12.name=SPAS-12
item.gun_star_f.name=Target Pistol
item.gun_star_f_akimbo.name=Target Pistols
item.gun_star_f_silenced.name=Silenced Pistol
item.gun_stg77.name=StG 77
item.gun_stinger.name=FIM-92 Stinger
item.gun_tau.name=Tau Cannon
@ -5824,9 +5827,11 @@ tile.machine_icf_press.desc=Fills ICF Fuel pellets$Left fuel slot is accepted by
tile.machine_industrial_boiler.name=Industrial Boiler
tile.machine_industrial_boiler.desc=Large boiler that can boil water or heat up oil.$Requires external heat source.$Heat transfer rate: ΔT*0.1 TU/t$Cannot explode
tile.machine_industrial_generator.name=Industrial Generator
tile.machine_industrial_turbine.name=Industrial Steam Turbine
tile.machine_industrial_turbine.desc=Efficiency: 100%%
tile.machine_intake.name=Air Intake
tile.machine_keyforge.name=Locksmith Table
tile.machine_large_turbine.name=Industrial Steam Turbine
tile.machine_large_turbine.name=Industrial Steam Turbine (LEGACY)
tile.machine_large_turbine.desc=Efficiency: 100%%
tile.machine_liquefactor.name=Industrial Liquefaction Machine
tile.machine_liquefactor.desc=Powerful universal machine to turn items into fluids.$Comes with versatile catalytic components, heating elements$and a built-in hydrator for petrochemical liquefaction.

View File

@ -1806,44 +1806,42 @@ item.ballistite.name=混合无烟火药
item.bandaid.name=邦迪创可贴
item.bathwater.name=有毒肥皂水
item.bathwater_mk2.name=有毒肥皂水(马香味)
item.battery_advanced.name=高级电池
item.battery_advanced_cell.name=高级电池组
item.battery_advanced_cell_12.name=十二联高级电池组
item.battery_advanced_cell_4.name=四联高级电池组
item.battery_advanced.name=高级电池(遗留)
item.battery_advanced_cell.name=高级电池组(遗留)
item.battery_advanced_cell_12.name=十二联高级电池组(遗留)
item.battery_advanced_cell_4.name=四联高级电池组(遗留)
item.battery_creative.name=无限电池
item.battery_generic.name=电池
item.battery_lithium.name=锂电池
item.battery_lithium_cell.name=锂电池组
item.battery_lithium_cell_3.name=三联锂电池组
item.battery_lithium_cell_6.name=六联锂电池组
item.battery_generic.name=电池(遗留)
item.battery_lithium.name=锂电池(遗留)
item.battery_lithium_cell.name=锂电池组(遗留)
item.battery_lithium_cell_3.name=三联锂电池组(遗留)
item.battery_lithium_cell_6.name=六联锂电池组(遗留)
item.battery_potato.name=马铃薯电池
item.battery_potatos.name=马铃薯OS
item.battery_red_cell.name=红石电池组
item.battery_red_cell_24.name=二十四联红石电池组
item.battery_red_cell_6.name=六联红石电池组
item.battery_sc_americium.name=自充电 镅-241电池
item.battery_sc_gold.name=自充电 金-198电池
item.battery_sc_lead.name=自充电 铅-209电池
item.battery_sc_plutonium.name=自充电 钚-238电池
item.battery_sc_polonium.name=自充电 钋-210电池
item.battery_sc_technetium.name=自充电 锝-98电池
item.battery_sc_uranium.name=自充电 铀-238电池
item.battery_schrabidium.name=Sa326电池
item.battery_schrabidium_cell.name=Sa326电池组
item.battery_schrabidium_cell_2.name=双联Sa326电池组
item.battery_schrabidium_cell_4.name=四联Sa326电池组
item.battery_red_cell.name=红石电池组(遗留)
item.battery_red_cell_24.name=二十四联红石电池组(遗留)
item.battery_red_cell_6.name=六联红石电池组(遗留)
item.battery_sc_americium.name=自充电 镅-241电池(遗留)
item.battery_sc_gold.name=自充电 金-198电池(遗留)
item.battery_sc_lead.name=自充电 铅-209电池(遗留)
item.battery_sc_plutonium.name=自充电 钚-238电池(遗留)
item.battery_sc_polonium.name=自充电 钋-210电池(遗留)
item.battery_sc_technetium.name=自充电 锝-99电池遗留
item.battery_sc_uranium.name=自充电 铀-238电池(遗留)
item.battery_schrabidium.name=Sa326电池(遗留)
item.battery_schrabidium_cell.name=Sa326电池组(遗留)
item.battery_schrabidium_cell_2.name=双联Sa326电池组(遗留)
item.battery_schrabidium_cell_4.name=四联Sa326电池组(遗留)
item.battery_spark.name=Spark电池
item.battery_spark_cell_100.name=Spark神秘储能电池组
item.battery_spark_cell_1000.name=Spark神秘物质能量空间
item.battery_spark_cell_10000.name=Spark时空晶体
item.battery_spark_cell_25.name=Spark神秘汽车电池
item.battery_spark_cell_2500.name=Spark神秘迪拉克之海
item.battery_spark_cell_6.name=Spark电池组
item.battery_spark_cell_power.name=Spark反物理储能装置
item.battery_steam.name=蒸汽动力储能罐
item.battery_steam_large.name=大型蒸汽动力储能罐
item.battery_su.name=SU-电池
item.battery_su_l.name=大型SU-电池
item.battery_spark_cell_100.name=Spark神秘储能电池组遗留
item.battery_spark_cell_1000.name=Spark神秘物质能量空间遗留
item.battery_spark_cell_10000.name=Spark时空晶体遗留
item.battery_spark_cell_25.name=Spark神秘汽车电池遗留
item.battery_spark_cell_2500.name=Spark神秘迪拉克之海遗留
item.battery_spark_cell_6.name=Spark电池组遗留
item.battery_spark_cell_power.name=Spark反物理储能装置遗留
item.battery_steam.name=蒸汽动力储能罐(遗留)
item.battery_steam_large.name=大型蒸汽动力储能罐(遗留)
item.battery_trixite.name=杂牌Spark电池
item.bdcl.name=BDCL
item.bedrock_ore.grade.base.name=%s基岩矿石
@ -2073,8 +2071,6 @@ item.canned_fried.name=炸鸡罐头
item.canned_fried.desc=甚至罐头都是油炸的!
item.canned_hotdogs.name=热狗罐头
item.canned_hotdogs.desc=不要与冷猫混淆。
item.canned_jizz.name=FlimFlam工业牌?马奶罐头
item.canned_jizz.desc=等等什么——
item.canned_kerosene.name=煤油罐头
item.canned_kerosene.desc=想象一下这句俏皮的台词。
item.canned_leftovers.name=剩菜罐头
@ -4516,16 +4512,10 @@ shape.wireFine=线
shape.wireDense=致密线
shape.wiresDense=致密线
soundCategory.ntmMachines=NTM机器
tile.absorber.name=辐射吸收器 OLD
tile.absorber_green.name=高级辐射吸收器 OLD
tile.absorber_pink.name=精英辐射吸收器 OLD
tile.absorber_red.name=增强型辐射吸收器 OLD
tile.rad_absorber.base.name=辐射吸收器
tile.rad_absorber.red.name=高级辐射吸收器
tile.rad_absorber.green.name=精英辐射吸收器
tile.rad_absorber.pink.name=增强型辐射吸收器
tile.absorber.name=辐射吸收器(遗留)
tile.absorber_green.name=高级辐射吸收器(遗留)
tile.absorber_pink.name=精英辐射吸收器(遗留)
tile.absorber_red.name=增强型辐射吸收器(遗留)
tile.acid_block.name=酸
tile.ams_base.name=AMS基座 [开发中]
tile.ams_emitter.name=AMS发射极 [开发中]
@ -5155,7 +5145,7 @@ tile.machine_bat9000.name=巨尻-9000 储罐
tile.machine_battery.name=蓄电池(遗留)
tile.machine_battery_potato.name=马铃薯电池组(遗留)
tile.machine_boiler.name=大型锅炉
tile.machine_boiler.desc=可以烧水或加热油的大型锅炉$需要外部热源$传热速率ΔT*0.01 TU/T
tile.machine_boiler.desc=可以烧水或加热油的大型锅炉$需要外部热源$传热速率ΔT*0.1 TU/T
tile.machine_boiler_electric_off.name=电锅炉
tile.machine_boiler_electric_on.name=电锅炉
tile.machine_boiler_off.name=锅炉
@ -5169,7 +5159,7 @@ tile.machine_chungus.desc=效率: 85%%
tile.machine_coal_off.name=火力发电机
tile.machine_coal_on.name=火力发电机
tile.machine_coker.name=焦化装置
tile.machine_coker.desc=炼焦,并产生各类流体副产品$需要外部热源$传热速率ΔT*0.025 TU/T
tile.machine_coker.desc=炼焦,并产生各类流体副产品$需要外部热源$传热速率ΔT*0.25 TU/T
tile.machine_combine_factory.name=CMB炼钢炉
tile.machine_combustion_engine.name=工业内燃机
tile.machine_compressor.name=压缩机
@ -5217,7 +5207,7 @@ tile.machine_hephaestus.name=地热换热器
tile.machine_icf_press.name=ICF燃料靶丸制造器
tile.machine_icf_press.desc=用于装填ICF靶丸$左侧燃料槽接收顶面/底面输入,右侧燃料槽接收侧面输入$μ子胶囊和空靶丸可从任意面输入
tile.machine_industrial_boiler.name=工业锅炉
tile.machine_industrial_boiler.desc=可以烧水或加热油的大型锅炉$需要外部热源$传热率ΔT*0.01 TU/T$不会爆炸
tile.machine_industrial_boiler.desc=可以烧水或加热油的大型锅炉$需要外部热源$传热率ΔT*0.1 TU/T$不会爆炸
tile.machine_industrial_generator.name=工业发电机
tile.machine_keyforge.name=锁匠桌
tile.machine_large_turbine.name=工业汽轮机
@ -5522,16 +5512,15 @@ tile.rbmk_control_auto.name=RBMK反应堆自动控制棒
tile.rbmk_control_mod.name=RBMK反应堆慢化控制棒
tile.rbmk_crane_console.name=RBMK起重机控制台
tile.rbmk_heater.name=RBMK流体加热器
tile.rbmk_heatex.name=RBMK换热器
tile.rbmk_loader.name=RBMK反应堆蒸汽导出器
tile.rbmk_loader.desc=让RBMK反应堆在底部同时拥有水接口和蒸汽接口$在RBMK蒸汽管道下方放置水管道再在下面放置蒸汽导出器$最后将管道连接至蒸汽导出器即可
tile.rbmk_moderator.name=RBMK反应堆石墨慢化剂
tile.rbmk_outgasser.name=RBMK反应堆辐照通道
tile.rbmk_reflector.name=RBMK反应堆碳化钨中子反射器
tile.rbmk_rod.name=RBMK反应堆燃料
tile.rbmk_rod_mod.name=RBMK反应堆慢化燃料
tile.rbmk_rod_reasim.name=RBMK反应堆燃料(ReaSim)
tile.rbmk_rod_reasim_mod.name=RBMK反应堆慢化燃料(ReaSim)
tile.rbmk_rod.name=RBMK反应堆燃料通道
tile.rbmk_rod_mod.name=RBMK反应堆慢化燃料通道
tile.rbmk_rod_reasim.name=RBMK反应堆燃料通道(ReaSim)
tile.rbmk_rod_reasim_mod.name=RBMK反应堆慢化燃料通道(ReaSim)
tile.rbmk_steam_inlet.name=RBMK ReaSim进水口
tile.rbmk_steam_inlet.desc=当启用ReaSim锅炉时向反应堆内输入水$从侧面连接至反应堆结构
tile.rbmk_steam_outlet.name=RBMK ReaSim蒸汽出口
@ -5905,8 +5894,8 @@ item.conveyor_wand.vertical.desc=能放置垂直输送带或者滑槽来垂直
item.gun_g3_a3.name=G3A3
item.gun_g3_infiltrator.name=渗透者
item.gun_greasegun_m3.name=M3
item.gun_heavy_revolver_scoped.name=带准镜的.44马格南转轮手枪
item.gun_henry_lincoln.name=林肯的中继器
item.gun_heavy_revolver_scoped.name=带准镜的.44马格南转轮手枪
item.gun_henry_lincoln.name=林肯拉杆枪
item.gun_maresleg_short.name=马腿
item.gun_mas36.name=南方之星
item.gun_uzi_richter.name=里氏
@ -5918,9 +5907,9 @@ item.weapon_mod_caliber.m357.name=.357马格南改装套件
item.weapon_mod_caliber.m44.name=.44马格南改装套件
item.weapon_mod_caliber.p22.name=.22LR改装套件
item.weapon_mod_caliber.p45.name=.45口径改装套件
item.weapon_mod_caliber.p9.name=9毫米口径改装套件
item.weapon_mod_caliber.p9.name=9mm改装套件
item.weapon_mod_caliber.r556.name=5.56mm改装套件
item.weapon_mod_caliber.r762.name=7.62改装套件
item.weapon_mod_caliber.r762.name=7.62mm改装套件
item.weapon_mod_generic.bigmt_damage.name=土星弹道优化器
item.weapon_mod_generic.bigmt_dura.name=高耐用性土星部件
item.weapon_mod_generic.bronze_damage.name=青铜弹道优化器
@ -5935,7 +5924,7 @@ item.weapon_mod_generic.iron_damage.name=铁制弹道优化器
item.weapon_mod_generic.iron_dura.name=高耐用性铁制部件
item.weapon_mod_generic.steel_damage.name=钢制弹道优化器
item.weapon_mod_generic.steel_dura.name=高耐用性钢制部件
item.weapon_mod_generic.tcalloy_damage.name=耐高温合金弹道优化
item.weapon_mod_generic.tcalloy_damage.name=耐高温合金弹道优化
item.weapon_mod_generic.tcalloy_dura.name=高耐用性耐高温合金部件
item.weapon_mod_generic.wsteel_damage.name=武器级钢弹道优化器
item.weapon_mod_generic.wsteel_dura.name=高耐用性武器级钢部件
@ -6407,3 +6396,23 @@ hbm.key.qmaw=打开QMAW
tile.fluid_counter_valve.name=带计数器的流体阀门
tile.fluid_counter_valve.desc=注意流体网络中的回流
tile.machine_battery_redd.name=FEnSU
item.battery_sc.am241.name=镅-241自充电电池
item.battery_sc.au198.name=金-198自充电电池
item.battery_sc.co60.name=钴-60自充电电池
item.battery_sc.empty.name=空自充电电池
item.battery_sc.pb209.name=铅-209自充电电池
item.battery_sc.po210.name=钋-210自充电电池
item.battery_sc.pu238.name=钚-238自充电电池
item.battery_sc.ra226.name=镭-226自充电电池
item.battery_sc.tc99.name=锝-99自充电电池
item.battery_sc.waste.name=核废料自充电电池
item.canned_slime.name=凝结马黏液
item.canned_slime.desc=现添加更多骨髓!
tile.rad_absorber.base.name=辐射吸收器
tile.rad_absorber.green.name=高级辐射吸收器
tile.rad_absorber.pink.name=精英辐射吸收器
tile.rad_absorber.red.name=增强型辐射吸收器
tile.fusion_klystron_creative.name=创造速调管
tile.fusion_klystron_creative.desc=提供无限的速调管能量。
tile.machine_battery_socket.desc=让电池物品能够直接接入电网。$同时也具有导线的功能,所有接口都连接至同一个能量网络。
tile.machine_crucible.desc=传热速率ΔT*0.25 TU/T

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -263,6 +263,7 @@
"weapon.fire.stab": {"category": "player", "sounds": ["weapon/fire/stab1", "weapon/fire/stab2"]},
"weapon.fire.grenade": {"category": "player", "sounds": ["weapon/fire/grenade"]},
"weapon.fire.amat": {"category": "player", "sounds": ["weapon/fire/amat"]},
"weapon.fire.pistolLight": {"category": "player", "sounds": ["weapon/fire/pistolLight"]},
"weapon.reload.boltClose": {"category": "player", "sounds": ["weapon/reload/boltClose"]},
"weapon.reload.boltOpen": {"category": "player", "sounds": ["weapon/reload/boltOpen"]},

View File

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB