nothing some booze and some paracetamol and jacking off and killing myse

lf can't fix
This commit is contained in:
Bob 2025-04-27 21:52:30 +02:00
parent 13741930ca
commit f42b4b3dd4
50 changed files with 8118 additions and 264 deletions

View File

@ -2,6 +2,11 @@
* Laser pistol * Laser pistol
* Saturnite-tier pistol using capacitors * Saturnite-tier pistol using capacitors
* Also has variants * Also has variants
* B-side for the assault rifle
* Ammo bag
* Holds up to 8 stacks of items with no NBT
* Reloading guns will access the contents of the bag directly without it having to be emptied first
* Comes with a handy little indicator to shot roughly how full it is
## Changed ## Changed
* Trenchmaster armor now has the fast reload and more ammo traits again * Trenchmaster armor now has the fast reload and more ammo traits again
@ -27,6 +32,10 @@
* The diesel generator and turbofan will both now halt operation when powered by redstone * The diesel generator and turbofan will both now halt operation when powered by redstone
* Infinite batteries will now also drain energy when put into a charging slot * Infinite batteries will now also drain energy when put into a charging slot
* TOREX effects now cause the sky to go fullbright again for 10 seconds after they spawn * TOREX effects now cause the sky to go fullbright again for 10 seconds after they spawn
* Weapon tooltips now show the weapon's condition
* Updated the catalytic cracking tower model
* Leviathan turbine and powered condenser tooltip now use thousand separaators to make the numbers actually readable
* Catalytic converters can now be crafted with `ANY_BISMOID` instead of just bismuth (that includes arsenic)
## Fixed ## Fixed
* Fixed fatal gamebreaking hard drive corrupting issue where taurun leggings were misspelled * Fixed fatal gamebreaking hard drive corrupting issue where taurun leggings were misspelled
@ -35,4 +44,6 @@
* Fixed modeled armor using weird rotation rules, causing issues with Customizable Player Models * Fixed modeled armor using weird rotation rules, causing issues with Customizable Player Models
* Fixed rotation issues for certain blocks using the new structure system * Fixed rotation issues for certain blocks using the new structure system
* Fixed ReaSim water never moving if the reactor is at 20° * Fixed ReaSim water never moving if the reactor is at 20°
* Fixed strand caster LPS gauge exceeding the limit * Fixed strand caster LPS gauge exceeding the limit
* The SPAS-12 and congo lake now change type immediately when hitting the reload key, fixing an issue where the first loaded round may have the worng color when the ammo type changes
* Fixed crash caused by `/ntmreload` when NEI is not installed

View File

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

View File

@ -83,7 +83,7 @@ public class MachineCatalyticCracker extends BlockDummyable implements ILookOver
@Override @Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) { protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) && return super.checkRequirement(world, x, y, z, dir, o) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{4, -1, 3, -1, 1, 1}, x, y, z, dir) && MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{8, -1, 3, -1, 2, 0}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{13, 0, 0, 3, 2, 1}, x, y, z, dir) && MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{13, 0, 0, 3, 2, 1}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{14, -13, -1, 2, 1, 0}, x, y, z, dir) && MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{14, -13, -1, 2, 1, 0}, x, y, z, dir) &&
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{3, -1, 2, 3, -1, 3}, x, y, z, dir); MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{3, -1, 2, 3, -1, 3}, x, y, z, dir);
@ -93,7 +93,7 @@ public class MachineCatalyticCracker extends BlockDummyable implements ILookOver
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o); super.fillSpace(world, x, y, z, dir, o);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{4, -1, 3, -1, 1, 1}, this, dir); MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{8, -1, 3, -1, 2, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{13, 0, 0, 3, 2, 1}, this, dir); MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{13, 0, 0, 3, 2, 1}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{14, -13, -1, 2, 1, 0}, this, dir); MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{14, -13, -1, 2, 1, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{3, -1, 2, 3, -1, 3}, this, dir); MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{3, -1, 2, 3, -1, 3}, this, dir);

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay; import com.hbm.blocks.ILookOverlay;
@ -165,8 +166,8 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
outputType = inputType.getTrait(FT_Coolable.class).coolsTo; outputType = inputType.getTrait(FT_Coolable.class).coolsTo;
} }
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + inputType.getLocalizedName() + ": " + tankInput.getFill() + "/" + tankInput.getMaxFill() + "mB"); 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() + ": " + tankOutput.getFill() + "/" + tankOutput.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.power) + "/" + BobMathUtil.getShortNumber(chungus.getMaxPower()) + "HE");

View File

@ -15,6 +15,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
public class MachineCondenserPowered extends BlockDummyable implements ILookOverlay { public class MachineCondenserPowered extends BlockDummyable implements ILookOverlay {
@ -73,7 +74,7 @@ public class MachineCondenserPowered extends BlockDummyable implements ILookOver
text.add(BobMathUtil.getShortNumber(tower.power) + "HE / " + BobMathUtil.getShortNumber(tower.maxPower) + "HE"); text.add(BobMathUtil.getShortNumber(tower.power) + "HE / " + BobMathUtil.getShortNumber(tower.maxPower) + "HE");
for(int i = 0; i < tower.tanks.length; i++) for(int i = 0; i < tower.tanks.length; i++)
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tower.tanks[i].getTankType().getLocalizedName() + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB"); text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tower.tanks[i].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", tower.tanks[i].getFill()) + "/" + String.format(Locale.US, "%,d", tower.tanks[i].getMaxFill()) + "mB");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text); ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
} }

View File

@ -76,6 +76,7 @@ public class WeaponRecipes {
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_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_panzerschreck, 1), new Object[] { "BBB", "PGM", 'B', DESH.heavyBarrel(), 'P', STEEL.plateCast(), 'G', DESH.grip(), 'M', GUNMETAL.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, 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() }); 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() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_chemthrower, 1), new Object[] { "MHW", "PSS", 'M', WEAPONSTEEL.mechanism(), 'H', RUBBER.pipe(), 'W', ModItems.wrench, 'P', WEAPONSTEEL.heavyBarrel(), 'S', WEAPONSTEEL.shell() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_chemthrower, 1), new Object[] { "MHW", "PSS", 'M', WEAPONSTEEL.mechanism(), 'H', RUBBER.pipe(), 'W', ModItems.wrench, 'P', WEAPONSTEEL.heavyBarrel(), 'S', WEAPONSTEEL.shell() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_m2, 1), new Object[] { " G", "BRM", " G", 'G', WOOD.grip(), 'B', FERRO.heavyBarrel(), 'R', FERRO.heavyReceiver(), 'M', WEAPONSTEEL.mechanism() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_m2, 1), new Object[] { " G", "BRM", " G", 'G', WOOD.grip(), 'B', FERRO.heavyBarrel(), 'R', FERRO.heavyReceiver(), 'M', WEAPONSTEEL.mechanism() });

View File

@ -23,14 +23,9 @@ public class BoilingHandler extends NEIUniversalHandler {
return "ntmBoiling"; return "ntmBoiling";
} }
public static HashMap<Object, Object> cache;
public static boolean isReload=false;
public static HashMap<Object, Object> generateRecipes() { public static HashMap<Object, Object> generateRecipes() {
if(cache != null && !isReload) return cache; HashMap<Object, Object> recipes = new HashMap();
cache = new HashMap();
for(FluidType type : Fluids.getInNiceOrder()) { for(FluidType type : Fluids.getInNiceOrder()) {
@ -39,11 +34,11 @@ public class BoilingHandler extends NEIUniversalHandler {
if(trait.getEfficiency(HeatingType.BOILER) > 0) { if(trait.getEfficiency(HeatingType.BOILER) > 0) {
HeatingStep step = trait.getFirstStep(); HeatingStep step = trait.getFirstStep();
cache.put(ItemFluidIcon.make(type, step.amountReq), ItemFluidIcon.make(step.typeProduced, step.amountProduced)); recipes.put(ItemFluidIcon.make(type, step.amountReq), ItemFluidIcon.make(step.typeProduced, step.amountProduced));
} }
} }
} }
isReload=false;
return cache; return recipes;
} }
} }

View File

@ -0,0 +1,85 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotNonRetarded;
import com.hbm.items.tool.ItemAmmoBag.InventoryAmmoBag;
import com.hbm.util.InventoryUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerAmmoBag extends Container {
private InventoryAmmoBag bag;
public ContainerAmmoBag(InventoryPlayer invPlayer, InventoryAmmoBag box) {
this.bag = box;
this.bag.openInventory();
for(int i = 0; i < 2; i++) {
for(int j = 0; j < 4; j++) {
this.addSlotToContainer(new SlotNonRetarded(box, j + i * 4, 53 + j * 18, 18 + i * 18));
}
}
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 82 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 140));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(par2 <= bag.getSizeInventory() - 1) {
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, bag.getSizeInventory(), this.inventorySlots.size(), true)) {
return null;
}
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, bag.getSizeInventory(), false)) {
return null;
}
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
} else {
var4.onSlotChanged();
}
var4.onPickupFromSlot(p_82846_1_, var5);
}
return var3;
}
@Override
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
// prevents the player from moving around the currently open box
if(mode == 2 && button == player.inventory.currentItem) return null;
if(index == player.inventory.currentItem + 27 + bag.getSizeInventory()) return null;
return super.slotClick(index, button, mode, player);
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return bag.isUseableByPlayer(player);
}
@Override
public void onContainerClosed(EntityPlayer player) {
super.onContainerClosed(player);
this.bag.closeInventory();
}
}

View File

@ -14,7 +14,6 @@ import com.google.gson.Gson;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import com.hbm.handler.nei.BoilingHandler;
import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.inventory.fluid.trait.*; import com.hbm.inventory.fluid.trait.*;
@ -892,7 +891,6 @@ public class Fluids {
} else { } else {
readTraits(config); readTraits(config);
} }
BoilingHandler.isReload=true;
} }
private static void registerCalculatedFuel(FluidType type, double base, double combustMult, FuelGrade grade) { private static void registerCalculatedFuel(FluidType type, double base, double combustMult, FuelGrade grade) {

View File

@ -0,0 +1,51 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerAmmoBag;
import com.hbm.items.tool.ItemAmmoBag.InventoryAmmoBag;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIAmmoBag extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_ammo_bag.png");
private final InventoryAmmoBag inventory;
public GUIAmmoBag(InventoryPlayer invPlayer, InventoryAmmoBag bag) {
super(new ContainerAmmoBag(invPlayer, bag));
this.inventory = bag;
this.xSize = 176;
this.ySize = 168;
}
@Override
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = I18n.format(this.inventory.getInventoryName());
if(inventory.hasCustomInventoryName()) {
name = inventory.box.getDisplayName();
}
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xffffff);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 98, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
}

View File

@ -1,88 +0,0 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerIGenerator;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIIGenerator extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/generators/gui_igen.png");
private TileEntityMachineIGenerator igen;
public GUIIGenerator(InventoryPlayer invPlayer, TileEntityMachineIGenerator tedf) {
super(new ContainerIGenerator(invPlayer, tedf));
igen = tedf;
this.xSize = 176;
this.ySize = 237;
}
@Override
public void drawScreen(int x, int y, float f) {
super.drawScreen(x, y, f);
this.drawElectricityInfo(this, x, y, guiLeft + 26, guiTop + 134, 142, 16, igen.power, igen.maxPower);
for(int i = 0; i < 4; i++) {
int fire = igen.burn[i];
this.drawCustomInfoStat(x, y, guiLeft + 68 + (i % 2) * 18, guiTop + 34 + (i / 2) * 36, 14, 14, x, y, new String[] {(fire / 20) + "s"});
}
this.drawCustomInfoStat(x, y, guiLeft + 113, guiTop + 4, 54, 18, x, y, new String[] {"Heat generated"});
igen.tanks[0].renderTankInfo(this, x, y, guiLeft + 80, guiTop + 112, 72, 16);
igen.tanks[1].renderTankInfo(this, x, y, guiLeft + 114, guiTop + 33, 16, 70);
igen.tanks[2].renderTankInfo(this, x, y, guiLeft + 150, guiTop + 33, 18, 70);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.igen.hasCustomInventoryName() ? this.igen.getInventoryName() : I18n.format(this.igen.getInventoryName());
GL11.glPushMatrix();
double scale = 0.75D;
GL11.glScaled(scale, scale, 1);
this.fontRendererObj.drawString(name, 22, 18, 0x303030);
GL11.glPopMatrix();
String spin = this.igen.spin + "";
this.fontRendererObj.drawString(spin, 139 - this.fontRendererObj.getStringWidth(spin) / 2, 10, 0x00ff00);
}
@Override
protected void drawGuiContainerBackgroundLayer(float iinterpolation, int x, int y) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int water = igen.tanks[0].getFill() * 72 / igen.tanks[0].getMaxFill();
drawTexturedModalRect(guiLeft + 80, guiTop + 112, 184, 14, water, 16);
int power = (int) (igen.power * 142 / igen.maxPower);
drawTexturedModalRect(guiLeft + 26, guiTop + 134, 0, 237, power, 16);
for(int i = 0; i < 4; i++) {
int fire = igen.burn[i];
if(fire > 0) {
drawTexturedModalRect(guiLeft + 68 + (i % 2) * 18, guiTop + 34 + (i / 2) * 36, 184, 0, 14, 14);
}
}
if(igen.hasRTG) {
drawTexturedModalRect(guiLeft + 9, guiTop + 34, 176, 0, 4, 89);
drawTexturedModalRect(guiLeft + 51, guiTop + 34, 180, 0, 4, 89);
}
igen.tanks[1].renderTank(guiLeft + 114, guiTop + 103, this.zLevel, 16, 70);
igen.tanks[2].renderTank(guiLeft + 150, guiTop + 103, this.zLevel, 16, 70);
}
}

View File

@ -75,7 +75,7 @@ public class PedestalRecipes extends SerializableRecipe {
register(new PedestalRecipe(new ItemStack(ModItems.gun_laser_pistol_morning_glory), register(new PedestalRecipe(new ItemStack(ModItems.gun_laser_pistol_morning_glory),
null, new ComparableStack(ModItems.morning_glory, 1), null, null, new ComparableStack(ModItems.morning_glory, 1), null,
new ComparableStack(ModItems.item_secret, 2, EnumSecretType.SELENIUM_STEEL), new ComparableStack(ModItems.gun_laser_pistol), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.SELENIUM_STEEL), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.SELENIUM_STEEL), new ComparableStack(ModItems.gun_laser_pistol), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.SELENIUM_STEEL),
null, new OreDictStack(STAR.ingot(), 4), null)); null, new OreDictStack(EMERALD.gem(), 16), null));
register(new PedestalRecipe(new ItemStack(ModItems.gun_folly), register(new PedestalRecipe(new ItemStack(ModItems.gun_folly),
new ComparableStack(ModItems.item_secret, 4, EnumSecretType.FOLLY), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.CONTROLLER), new ComparableStack(ModItems.item_secret, 4, EnumSecretType.FOLLY), new ComparableStack(ModItems.item_secret, 4, EnumSecretType.FOLLY), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.CONTROLLER), new ComparableStack(ModItems.item_secret, 4, EnumSecretType.FOLLY),

View File

@ -1149,6 +1149,7 @@ public class ModItems {
public static Item containment_box; public static Item containment_box;
public static Item plastic_bag; public static Item plastic_bag;
public static Item ammo_bag;
public static Item casing_bag; public static Item casing_bag;
public static Item test_nuke_igniter; public static Item test_nuke_igniter;
@ -1463,6 +1464,7 @@ public class ModItems {
public static Item gun_spas12; public static Item gun_spas12;
public static Item gun_panzerschreck; public static Item gun_panzerschreck;
public static Item gun_g3; public static Item gun_g3;
public static Item gun_g3_zebra;
public static Item gun_stinger; public static Item gun_stinger;
public static Item gun_chemthrower; public static Item gun_chemthrower;
public static Item gun_m2; public static Item gun_m2;
@ -3538,6 +3540,7 @@ public class ModItems {
containment_box = new ItemLeadBox().setUnlocalizedName("containment_box").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":containment_box"); containment_box = new ItemLeadBox().setUnlocalizedName("containment_box").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":containment_box");
plastic_bag = new ItemPlasticBag().setUnlocalizedName("plastic_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plastic_bag"); plastic_bag = new ItemPlasticBag().setUnlocalizedName("plastic_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plastic_bag");
ammo_bag = new ItemAmmoBag().setUnlocalizedName("ammo_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":ammo_bag");
casing_bag = new ItemCasingBag().setUnlocalizedName("casing_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":casing_bag"); casing_bag = new ItemCasingBag().setUnlocalizedName("casing_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":casing_bag");
debris_graphite = new Item().setUnlocalizedName("debris_graphite").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_graphite"); debris_graphite = new Item().setUnlocalizedName("debris_graphite").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_graphite");
@ -6170,6 +6173,7 @@ public class ModItems {
GameRegistry.registerItem(containment_box, containment_box.getUnlocalizedName()); GameRegistry.registerItem(containment_box, containment_box.getUnlocalizedName());
GameRegistry.registerItem(plastic_bag, plastic_bag.getUnlocalizedName()); GameRegistry.registerItem(plastic_bag, plastic_bag.getUnlocalizedName());
GameRegistry.registerItem(ammo_bag, ammo_bag.getUnlocalizedName());
GameRegistry.registerItem(casing_bag, casing_bag.getUnlocalizedName()); GameRegistry.registerItem(casing_bag, casing_bag.getUnlocalizedName());
//Keys and Locks //Keys and Locks
@ -6405,6 +6409,7 @@ public class ModItems {
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName()); GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName()); GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName());
GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName()); GameRegistry.registerItem(gun_g3, gun_g3.getUnlocalizedName());
GameRegistry.registerItem(gun_g3_zebra, gun_g3_zebra.getUnlocalizedName());
GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName()); GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName());
GameRegistry.registerItem(gun_chemthrower, gun_chemthrower.getUnlocalizedName()); GameRegistry.registerItem(gun_chemthrower, gun_chemthrower.getUnlocalizedName());
GameRegistry.registerItem(gun_m2, gun_m2.getUnlocalizedName()); GameRegistry.registerItem(gun_m2, gun_m2.getUnlocalizedName());

View File

@ -89,10 +89,12 @@ public class ArmorTrenchmaster extends ArmorFSB {
} }
public static boolean isTrenchMaster(EntityPlayer player) { public static boolean isTrenchMaster(EntityPlayer player) {
if(player == null) return false;
return player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == ModItems.trenchmaster_plate && ArmorFSB.hasFSBArmor(player); return player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == ModItems.trenchmaster_plate && ArmorFSB.hasFSBArmor(player);
} }
public static boolean hasAoS(EntityPlayer player) { public static boolean hasAoS(EntityPlayer player) {
if(player == null) return false;
if(player.inventory.armorInventory[3] != null) { if(player.inventory.armorInventory[3] != null) {
ItemStack[] mods = ArmorModHandler.pryMods(player.inventory.armorInventory[3]); ItemStack[] mods = ArmorModHandler.pryMods(player.inventory.armorInventory[3]);
ItemStack helmet = mods[ArmorModHandler.helmet_only]; ItemStack helmet = mods[ArmorModHandler.helmet_only];

View File

@ -0,0 +1,147 @@
package com.hbm.items.tool;
import com.hbm.inventory.container.ContainerAmmoBag;
import com.hbm.inventory.gui.GUIAmmoBag;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.util.ItemStackUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class ItemAmmoBag extends Item implements IGUIProvider {
public ItemAmmoBag() {
this.setMaxStackSize(1);
}
@Override
public int getMaxItemUseDuration(ItemStack stack) {
return 1;
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(!world.isRemote) player.openGui(MainRegistry.instance, 0, world, 0, 0, 0);
return stack;
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerAmmoBag(player.inventory, new InventoryAmmoBag(player.getHeldItem()));
}
@Override
@SideOnly(Side.CLIENT)
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUIAmmoBag(player.inventory, new InventoryAmmoBag(player.getHeldItem()));
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
return !stack.hasTagCompound() || getDurabilityForDisplay(stack) != 0;
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
if(!stack.hasTagCompound()) return 1D;
InventoryAmmoBag inv = new InventoryAmmoBag(stack);
int capacity = 0;
int bullets = 0;
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack slot = inv.getStackInSlot(i);
if(slot == null) {
capacity += 64;
} else {
capacity += slot.getMaxStackSize();
bullets += slot.stackSize;
}
}
return 1D - (double) bullets / (double) capacity;
}
public static class InventoryAmmoBag implements IInventory {
public final ItemStack box;
public ItemStack[] slots;
public InventoryAmmoBag(ItemStack bag) {
this.box = bag;
slots = new ItemStack[this.getSizeInventory()];
if(!bag.hasTagCompound())
bag.setTagCompound(new NBTTagCompound());
ItemStack[] fromNBT = ItemStackUtil.readStacksFromNBT(bag, slots.length);
if(fromNBT != null) {
for(int i = 0; i < slots.length; i++) {
slots[i] = fromNBT[i];
}
}
}
@Override public int getSizeInventory() { return 8; }
@Override public ItemStack getStackInSlot(int slot) { return slots[slot]; }
@Override
public ItemStack decrStackSize(int slot, int amount) {
ItemStack stack = getStackInSlot(slot);
if (stack != null) {
if (stack.stackSize > amount) {
stack = stack.splitStack(amount);
markDirty();
} else {
setInventorySlotContents(slot, null);
}
}
return stack;
}
@Override
public ItemStack getStackInSlotOnClosing(int slot) {
ItemStack stack = getStackInSlot(slot);
setInventorySlotContents(slot, null);
return stack;
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
if(stack != null) {
stack.stackSize = Math.min(stack.stackSize, this.getInventoryStackLimit());
}
slots[slot] = stack;
markDirty();
}
@Override public String getInventoryName() { return "container.ammoBag"; }
@Override public boolean hasCustomInventoryName() { return box.hasDisplayName(); }
@Override public int getInventoryStackLimit() { return 64; }
@Override
public void markDirty() {
for(int i = 0; i < getSizeInventory(); ++i) {
if(getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
slots[i] = null;
}
}
ItemStackUtil.addStacksToNBT(box, slots);
}
@Override public boolean isUseableByPlayer(EntityPlayer player) { return true; }
@Override public void openInventory() { }
@Override public void closeInventory() { }
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return !stack.hasTagCompound(); }
}
}

View File

@ -34,6 +34,7 @@ public class GunConfig {
public static final String I_INSPECTCANCEL = "I_INSPECTCANCEL"; public static final String I_INSPECTCANCEL = "I_INSPECTCANCEL";
public static final String O_CROSSHAIR = "O_CROSSHAIR"; public static final String O_CROSSHAIR = "O_CROSSHAIR";
public static final String B_HIDECROSSHAIR = "B_HIDECROSSHAIR"; public static final String B_HIDECROSSHAIR = "B_HIDECROSSHAIR";
public static final String B_RELOADREQUIRESTYPECHANGE = "B_RELOADREQUIRESTYPECHANGE";
public static final String B_RELOADANIMATIONSEQUENTIAL = "B_RELOADANIMATIONSEQUENTIAL"; public static final String B_RELOADANIMATIONSEQUENTIAL = "B_RELOADANIMATIONSEQUENTIAL";
public static final String O_SCOPETEXTURE = "O_SCOPETEXTURE"; public static final String O_SCOPETEXTURE = "O_SCOPETEXTURE";
public static final String CON_SMOKE = "CON_SMOKE"; public static final String CON_SMOKE = "CON_SMOKE";
@ -61,6 +62,7 @@ public class GunConfig {
protected boolean inspectCancel_DNA = true; protected boolean inspectCancel_DNA = true;
protected Crosshair crosshair_DNA; protected Crosshair crosshair_DNA;
protected boolean hideCrosshair_DNA = true; protected boolean hideCrosshair_DNA = true;
protected boolean reloadRequiresTypeChange_DNA = false;
protected boolean reloadAnimationsSequential_DNA; protected boolean reloadAnimationsSequential_DNA;
protected ResourceLocation scopeTexture_DNA; protected ResourceLocation scopeTexture_DNA;
/** Handles smoke clientside */ /** Handles smoke clientside */
@ -92,6 +94,7 @@ public class GunConfig {
public boolean getInspectCancel(ItemStack stack) { return WeaponModManager.eval(inspectCancel_DNA, stack, I_INSPECTCANCEL, this, this.index); } public boolean getInspectCancel(ItemStack stack) { return WeaponModManager.eval(inspectCancel_DNA, stack, I_INSPECTCANCEL, this, this.index); }
public Crosshair getCrosshair(ItemStack stack) { return WeaponModManager.eval(crosshair_DNA, stack, O_CROSSHAIR, this, this.index); } public Crosshair getCrosshair(ItemStack stack) { return WeaponModManager.eval(crosshair_DNA, stack, O_CROSSHAIR, this, this.index); }
public boolean getHideCrosshair(ItemStack stack) { return WeaponModManager.eval(hideCrosshair_DNA, stack, B_HIDECROSSHAIR, this, this.index); } public boolean getHideCrosshair(ItemStack stack) { return WeaponModManager.eval(hideCrosshair_DNA, stack, B_HIDECROSSHAIR, this, this.index); }
public boolean getReloadChangesType(ItemStack stack) { return WeaponModManager.eval(reloadRequiresTypeChange_DNA, stack, B_RELOADREQUIRESTYPECHANGE, this, this.index); }
public boolean getReloadAnimSequential(ItemStack stack) { return WeaponModManager.eval(reloadAnimationsSequential_DNA, stack, B_RELOADANIMATIONSEQUENTIAL, this, this.index); } public boolean getReloadAnimSequential(ItemStack stack) { return WeaponModManager.eval(reloadAnimationsSequential_DNA, stack, B_RELOADANIMATIONSEQUENTIAL, this, this.index); }
public ResourceLocation getScopeTexture(ItemStack stack) { return WeaponModManager.eval(scopeTexture_DNA, stack, O_SCOPETEXTURE, this, this.index); } public ResourceLocation getScopeTexture(ItemStack stack) { return WeaponModManager.eval(scopeTexture_DNA, stack, O_SCOPETEXTURE, this, this.index); }
public BiConsumer<ItemStack, LambdaContext> getSmokeHandler(ItemStack stack) { return WeaponModManager.eval(smokeHandler_DNA, stack, CON_SMOKE, this, this.index); } public BiConsumer<ItemStack, LambdaContext> getSmokeHandler(ItemStack stack) { return WeaponModManager.eval(smokeHandler_DNA, stack, CON_SMOKE, this, this.index); }
@ -121,6 +124,7 @@ public class GunConfig {
public GunConfig inspectCancel(boolean flag) { this.inspectCancel_DNA = flag; return this; } public GunConfig inspectCancel(boolean flag) { this.inspectCancel_DNA = flag; return this; }
public GunConfig crosshair(Crosshair crosshair) { this.crosshair_DNA = crosshair; return this; } public GunConfig crosshair(Crosshair crosshair) { this.crosshair_DNA = crosshair; return this; }
public GunConfig hideCrosshair(boolean flag) { this.hideCrosshair_DNA = flag; return this; } public GunConfig hideCrosshair(boolean flag) { this.hideCrosshair_DNA = flag; return this; }
public GunConfig reloadChangeType(boolean flag) { this.reloadRequiresTypeChange_DNA = flag; return this; }
public GunConfig reloadSequential(boolean flag) { this.reloadAnimationsSequential_DNA = flag; return this; } public GunConfig reloadSequential(boolean flag) { this.reloadAnimationsSequential_DNA = flag; return this; }
public GunConfig scopeTexture(ResourceLocation tex) { this.scopeTexture_DNA = tex; return this; } public GunConfig scopeTexture(ResourceLocation tex) { this.scopeTexture_DNA = tex; return this; }

View File

@ -182,6 +182,10 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
} }
} }
float maxDura = config.getDurability(stack);
int dura = MathHelper.clamp_int((int)((maxDura - this.getWear(stack, i)) * 100 / maxDura), 0, 100);
list.add("Condition: " + dura + "%");
for(ItemStack upgrade : WeaponModManager.getUpgradeItems(stack, i)) { for(ItemStack upgrade : WeaponModManager.getUpgradeItems(stack, i)) {
list.add(EnumChatFormatting.YELLOW + upgrade.getDisplayName()); list.add(EnumChatFormatting.YELLOW + upgrade.getDisplayName());
} }
@ -315,6 +319,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
this.setState(stack, i, GunState.DRAWING); this.setState(stack, i, GunState.DRAWING);
this.setTimer(stack, i, configs[i].getDrawDuration(stack)); this.setTimer(stack, i, configs[i].getDrawDuration(stack));
} }
this.setLastAnim(stack, i, AnimType.CYCLE); //prevents new guns from initializing with DRAWING, 0
} }
this.setIsAiming(stack, false); this.setIsAiming(stack, false);
this.setReloadCancel(stack, false); this.setReloadCancel(stack, false);

View File

@ -65,7 +65,8 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_akimbo, new ItemRenderUziAkimbo()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_akimbo, new ItemRenderUziAkimbo());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3, new ItemRenderG3()); 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()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_stinger, new ItemRenderStinger());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_chemthrower, new ItemRenderChemthrower()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_chemthrower, new ItemRenderChemthrower());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_m2, new ItemRenderM2()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_m2, new ItemRenderM2());
@ -138,6 +139,8 @@ public class GunFactoryClient {
r556_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET); r556_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
r556_ap.setRenderer(LegoClient.RENDER_AP_BULLET); r556_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
setRendererBulk(LegoClient.RENDER_AP_BULLET, r556_inc_sp, r556_inc_fmj, r556_inc_jhp, r556_inc_ap);
r762_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET); r762_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
r762_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET); r762_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
r762_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET); r762_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -238,6 +241,7 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_spas12) .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_panzerschreck) .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) .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); ((ItemGunBaseNT) ModItems.gun_stinger) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_chemthrower) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO); ((ItemGunBaseNT) ModItems.gun_chemthrower) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_m2) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO); ((ItemGunBaseNT) ModItems.gun_m2) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);

View File

@ -67,6 +67,7 @@ public class Lego {
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.RELOADING); ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.RELOADING);
ItemGunBaseNT.setTimer(stack, ctx.configIndex, rec.getReloadBeginDuration(stack) + (loaded <= 0 ? rec.getReloadCockOnEmptyPre(stack) : 0)); ItemGunBaseNT.setTimer(stack, ctx.configIndex, rec.getReloadBeginDuration(stack) + (loaded <= 0 ? rec.getReloadCockOnEmptyPre(stack) : 0));
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD, ctx.configIndex); ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD, ctx.configIndex);
if(ctx.config.getReloadChangesType(stack)) mag.initNewType(stack, ctx.inventory);
} else { } else {
ItemGunBaseNT.playAnimation(player, stack, AnimType.INSPECT, ctx.configIndex); ItemGunBaseNT.playAnimation(player, stack, AnimType.INSPECT, ctx.configIndex);
if(!ctx.config.getInspectCancel(stack)) { if(!ctx.config.getInspectCancel(stack)) {

View File

@ -740,8 +740,9 @@ public class Orchestras {
if(entity.worldObj.isRemote) return; if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex); AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex); int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack) && !WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SCOPE); boolean scoped = stack.getItem() == ModItems.gun_g3_zebra || WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SCOPE);
boolean aiming = ItemGunBaseNT.getIsAiming(stack) && !scoped;
if(type == AnimType.CYCLE) { if(type == AnimType.CYCLE) {
if(timer == 0) { if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory); SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);

View File

@ -343,7 +343,7 @@ public class XFactory12ga {
).setUnlocalizedName("gun_liberator"); ).setUnlocalizedName("gun_liberator");
ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE) .dura(600).draw(20).inspect(39).reloadSequential(true).reloadChangeType(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(32F).spreadHipfire(0F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F) .dmg(32F).spreadHipfire(0F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 8).addConfigs(all)) .mag(new MagazineSingleReload(0, 8).addConfigs(all))

View File

@ -165,7 +165,7 @@ public class XFactory40mm {
).setUnlocalizedName("gun_flaregun"); ).setUnlocalizedName("gun_flaregun");
ModItems.gun_congolake = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_congolake = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(400).draw(7).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCUMFLEX).smoke(LAMBDA_SMOKE) .dura(400).draw(7).inspect(39).reloadSequential(true).reloadChangeType(true).crosshair(Crosshair.L_CIRCUMFLEX).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(20F).delay(24).reload(16, 16, 16, 0).jam(0).sound("hbm:weapon.glShoot", 1.0F, 1.0F) .dmg(20F).delay(24).reload(16, 16, 16, 0).jam(0).sound("hbm:weapon.glShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 4).addConfigs(g40_he, g40_heat, g40_demo, g40_inc, g40_phosphorus)) .mag(new MagazineSingleReload(0, 4).addConfigs(g40_he, g40_heat, g40_demo, g40_inc, g40_phosphorus))

View File

@ -5,6 +5,8 @@ import java.util.function.BiFunction;
import java.util.function.Function; import java.util.function.Function;
import com.hbm.config.ClientConfig; import com.hbm.config.ClientConfig;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.ItemEnums.EnumCasingType; import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.BulletConfig;
@ -28,7 +30,9 @@ import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType; import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class XFactory556mm { public class XFactory556mm {
@ -39,6 +43,18 @@ public class XFactory556mm {
public static BulletConfig r556_fmj; public static BulletConfig r556_fmj;
public static BulletConfig r556_jhp; public static BulletConfig r556_jhp;
public static BulletConfig r556_ap; public static BulletConfig r556_ap;
public static BulletConfig r556_inc_sp;
public static BulletConfig r556_inc_fmj;
public static BulletConfig r556_inc_jhp;
public static BulletConfig r556_inc_ap;
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> INCENDIARY = (bullet, mop) -> {
if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase) {
HbmLivingProps data = HbmLivingProps.getData((EntityLivingBase) mop.entityHit);
if(data.phosphorus < 300) data.phosphorus = 300;
}
};
public static void init() { public static void init() {
SpentCasing casing556 = new SpentCasing(CasingType.BOTTLENECK).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(0.8F); SpentCasing casing556 = new SpentCasing(CasingType.BOTTLENECK).setColor(SpentCasing.COLOR_CASE_BRASS).setScale(0.8F);
@ -51,21 +67,36 @@ public class XFactory556mm {
r556_ap = new BulletConfig().setItem(EnumAmmo.R556_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(10F).setArmorPiercing(0.15F) r556_ap = new BulletConfig().setItem(EnumAmmo.R556_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(10F).setArmorPiercing(0.15F)
.setCasing(casing556.clone().setColor(SpentCasing.COLOR_CASE_44).register("r556ap")); .setCasing(casing556.clone().setColor(SpentCasing.COLOR_CASE_44).register("r556ap"));
r556_inc_sp = r556_sp.clone().setOnImpact(INCENDIARY);
r556_inc_fmj = r556_fmj.clone().setOnImpact(INCENDIARY);
r556_inc_jhp = r556_jhp.clone().setOnImpact(INCENDIARY);
r556_inc_ap = r556_ap.clone().setOnImpact(INCENDIARY);
ModItems.gun_g3 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_g3 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(10).inspect(33).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE) .dura(3_000).draw(10).inspect(33).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(5F).delay(2).auto(true).dry(15).spread(0.0F).reload(50).jam(47).sound("hbm:weapon.fire.assault", 1.0F, 1.0F) .dmg(5F).delay(2).auto(true).dry(15).reload(50).jam(47).sound("hbm:weapon.fire.assault", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(r556_sp, r556_fmj, r556_jhp, r556_ap)) .mag(new MagazineFullReload(0, 30).addConfigs(r556_sp, r556_fmj, r556_jhp, r556_ap))
.offset(1, -0.0625 * 2.5, -0.25D) .offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_G3)) .setupStandardFire().recoil(LAMBDA_RECOIL_G3))
.setupStandardConfiguration().ps(Lego.LAMBDA_STANDARD_CLICK_SECONDARY) .setupStandardConfiguration().ps(Lego.LAMBDA_STANDARD_CLICK_SECONDARY)
.anim(LAMBDA_G3_ANIMS).orchestra(Orchestras.ORCHESTRA_G3) .anim(LAMBDA_G3_ANIMS).orchestra(Orchestras.ORCHESTRA_G3)
).setNameMutator(LAMBDA_NAME_G3).setUnlocalizedName("gun_g3"); ).setNameMutator(LAMBDA_NAME_G3).setUnlocalizedName("gun_g3");
ModItems.gun_g3_zebra = new ItemGunBaseNT(WeaponQuality.B_SIDE, new GunConfig()
.dura(6_000).draw(10).inspect(33).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE).scopeTexture(XFactory44.scope_lilmac)
.rec(new Receiver(0)
.dmg(7.5F).delay(2).auto(true).dry(15).spreadHipfire(0.01F).reload(50).jam(47).sound("hbm:weapon.fire.silenced", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(r556_inc_sp, r556_inc_fmj, r556_inc_jhp, r556_inc_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_G3))
.setupStandardConfiguration().ps(Lego.LAMBDA_STANDARD_CLICK_SECONDARY)
.anim(LAMBDA_G3_ANIMS).orchestra(Orchestras.ORCHESTRA_G3)
).setNameMutator(LAMBDA_NAME_G3).setUnlocalizedName("gun_g3_zebra");
ModItems.gun_stg77 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_stg77 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(3_000).draw(10).inspect(125).crosshair(Crosshair.CIRCLE).scopeTexture(scope_lilmac).smoke(LAMBDA_SMOKE) .dura(3_000).draw(10).inspect(125).crosshair(Crosshair.CIRCLE).scopeTexture(scope_lilmac).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(10F).delay(2).dry(15).auto(true).spread(0.0F).reload(46).jam(0).sound("hbm:weapon.fire.assault", 1.0F, 1.0F) .dmg(10F).delay(2).dry(15).auto(true).reload(46).jam(0).sound("hbm:weapon.fire.assault", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(r556_sp, r556_fmj, r556_jhp, r556_ap)) .mag(new MagazineFullReload(0, 30).addConfigs(r556_sp, r556_fmj, r556_jhp, r556_ap))
.offset(1, -0.0625 * 2.5, -0.25D) .offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_STG)) .setupStandardFire().recoil(LAMBDA_RECOIL_STG))

View File

@ -33,6 +33,8 @@ public interface IMagazine<T> {
public void useUpAmmo(ItemStack stack, IInventory inventory, int amount); public void useUpAmmo(ItemStack stack, IInventory inventory, int amount);
/** If a reload can even be initiated, i.e. the player even has bullets to load, inventory can be null */ /** If a reload can even be initiated, i.e. the player even has bullets to load, inventory can be null */
public boolean canReload(ItemStack stack, IInventory inventory); public boolean canReload(ItemStack stack, IInventory inventory);
/** On the begin of a reload, potentially change the mag type before the reload happens for animation purposes */
public void initNewType(ItemStack stack, IInventory inventory);
/** The action done at the end of one reload cycle, either loading one shell or replacing the whole mag, inventory can be null */ /** The action done at the end of one reload cycle, either loading one shell or replacing the whole mag, inventory can be null */
public void reloadAction(ItemStack stack, IInventory inventory); public void reloadAction(ItemStack stack, IInventory inventory);
/** The stack that should be displayed for the ammo HUD */ /** The stack that should be displayed for the ammo HUD */

View File

@ -3,6 +3,8 @@ package com.hbm.items.weapon.sedna.mags;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemAmmoBag.InventoryAmmoBag;
import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT; import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.particle.SpentCasing; import com.hbm.particle.SpentCasing;
@ -44,6 +46,23 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
IMagazine.handleAmmoBag(inventory, first, toRemove); IMagazine.handleAmmoBag(inventory, first, toRemove);
if(amount <= 0) return; if(amount <= 0) return;
} }
if(slot.getItem() == ModItems.ammo_bag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
if(first.ammo.matchesRecipe(bagslot, true)) {
int toRemove = Math.min(bagslot.stackSize, amount);
amount -= toRemove;
bag.decrStackSize(j, toRemove);
IMagazine.handleAmmoBag(inventory, first, toRemove);
if(amount <= 0) return;
}
}
}
}
} }
} }
} }
@ -52,6 +71,7 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
@Override public int getCapacity(ItemStack stack) { return 0; } @Override public int getCapacity(ItemStack stack) { return 0; }
@Override public void setAmount(ItemStack stack, int amount) { } @Override public void setAmount(ItemStack stack, int amount) { }
@Override public boolean canReload(ItemStack stack, IInventory inventory) { return false; } @Override public boolean canReload(ItemStack stack, IInventory inventory) { return false; }
@Override public void initNewType(ItemStack stack, IInventory inventory) { }
@Override public void reloadAction(ItemStack stack, IInventory inventory) { } @Override public void reloadAction(ItemStack stack, IInventory inventory) { }
@Override public void setAmountBeforeReload(ItemStack stack, int amount) { } @Override public void setAmountBeforeReload(ItemStack stack, int amount) { }
@Override public int getAmountBeforeReload(ItemStack stack) { return 0; } @Override public int getAmountBeforeReload(ItemStack stack) { return 0; }
@ -68,6 +88,17 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
if(slot != null) { if(slot != null) {
if(first.ammo.matchesRecipe(slot, true)) count += slot.stackSize; if(first.ammo.matchesRecipe(slot, true)) count += slot.stackSize;
if(slot.getItem() == ModItems.ammo_bag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
if(first.ammo.matchesRecipe(bagslot, true)) count += bagslot.stackSize;
}
}
}
} }
} }
return count; return count;
@ -100,6 +131,19 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
for(BulletConfig config : this.acceptedBullets) { for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) return config; if(config.ammo.matchesRecipe(slot, true)) return config;
} }
if(slot.getItem() == ModItems.ammo_bag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(bagslot, true)) return config;
}
}
}
}
} }
} }

View File

@ -52,6 +52,7 @@ public class MagazineFluid implements IMagazine<FluidType> {
@Override public void setAmount(ItemStack stack, int amount) { setMagCount(stack, index, amount); } @Override public void setAmount(ItemStack stack, int amount) { setMagCount(stack, index, amount); }
@Override public boolean canReload(ItemStack stack, IInventory inventory) { return false; } @Override public boolean canReload(ItemStack stack, IInventory inventory) { return false; }
@Override public void initNewType(ItemStack stack, IInventory inventory) { }
@Override public void reloadAction(ItemStack stack, IInventory inventory) { } @Override public void reloadAction(ItemStack stack, IInventory inventory) { }
@Override public SpentCasing getCasing(ItemStack stack, IInventory inventory) { return null; } @Override public SpentCasing getCasing(ItemStack stack, IInventory inventory) { return null; }

View File

@ -1,7 +1,5 @@
package com.hbm.items.weapon.sedna.mags; package com.hbm.items.weapon.sedna.mags;
import com.hbm.items.weapon.sedna.BulletConfig;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -12,76 +10,9 @@ public class MagazineFullReload extends MagazineSingleTypeBase {
super(index, capacity); super(index, capacity);
} }
/** Returns true if the player has the same ammo if partially loaded, or any valid ammo if not */
@Override
public boolean canReload(ItemStack stack, IInventory inventory) {
if(this.getAmount(stack, inventory) >= this.getCapacity(stack)) return false;
if(inventory == null) return true;
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
if(this.getAmount(stack, inventory) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) return true;
}
} else {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); }
if(config.ammo.matchesRecipe(slot, true)) return true;
}
}
}
return false;
}
/** Reloads all rounds at once. If the mag is empty, the mag's type will change to the first valid ammo type */ /** Reloads all rounds at once. If the mag is empty, the mag's type will change to the first valid ammo type */
@Override @Override
public void reloadAction(ItemStack stack, IInventory inventory) { public void reloadAction(ItemStack stack, IInventory inventory) {
standardReload(stack, inventory, this.capacity);
if(inventory == null) {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
this.setAmount(stack, this.capacity);
return;
}
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
//mag is empty, assume next best type
if(this.getAmount(stack, inventory) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) {
this.setType(stack, config);
int wantsToLoad = (int) Math.ceil((double) this.getCapacity(stack) / (double) config.ammoReloadCount);
int toLoad = Math.min(wantsToLoad, slot.stackSize);
this.setAmount(stack, Math.min(toLoad * config.ammoReloadCount, this.capacity));
inventory.decrStackSize(i, toLoad);
break;
}
}
//mag has a type set, only load that
} else {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
if(config.ammo.matchesRecipe(slot, true)) {
int alreadyLoaded = this.getAmount(stack, inventory);
int wantsToLoad = (int) Math.ceil((double) (this.getCapacity(stack) - alreadyLoaded) / (double) config.ammoReloadCount);
int toLoad = Math.min(wantsToLoad, slot.stackSize);
this.setAmount(stack, Math.min((toLoad * config.ammoReloadCount) + alreadyLoaded, this.capacity));
inventory.decrStackSize(i, toLoad);
}
}
}
}
} }
} }

View File

@ -1,7 +1,5 @@
package com.hbm.items.weapon.sedna.mags; package com.hbm.items.weapon.sedna.mags;
import com.hbm.items.weapon.sedna.BulletConfig;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -12,73 +10,9 @@ public class MagazineSingleReload extends MagazineSingleTypeBase {
super(index, capacity); super(index, capacity);
} }
/** Returns true if the player has the same ammo if partially loaded, or any valid ammo if not */
@Override
public boolean canReload(ItemStack stack, IInventory inventory) {
if(this.getAmount(stack, inventory) >= this.getCapacity(stack)) return false;
if(inventory == null) return true;
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
if(this.getAmount(stack, inventory) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) return true;
}
} else {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); }
if(config.ammo.matchesRecipe(slot, true)) return true;
}
}
}
return false;
}
/** Reloads all rounds at once. If the mag is empty, the mag's type will change to the first valid ammo type */ /** Reloads all rounds at once. If the mag is empty, the mag's type will change to the first valid ammo type */
@Override @Override
public void reloadAction(ItemStack stack, IInventory inventory) { public void reloadAction(ItemStack stack, IInventory inventory) {
standardReload(stack, inventory, 1);
if(inventory == null) {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
this.setAmount(stack, this.getAmount(stack, inventory) + 1);
return;
}
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
//mag is empty, assume next best type
if(this.getAmount(stack, inventory) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) {
this.setType(stack, config);
this.setAmount(stack, 1);
inventory.decrStackSize(i, 1);
return;
}
}
//mag has a type set, only load that
} else {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
if(config.ammo.matchesRecipe(slot, true)) {
int alreadyLoaded = this.getAmount(stack, inventory);
this.setAmount(stack, alreadyLoaded + 1);
inventory.decrStackSize(i, 1);
return;
}
}
}
}
} }
} }

View File

@ -3,9 +3,12 @@ package com.hbm.items.weapon.sedna.mags;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemAmmoBag.InventoryAmmoBag;
import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT; import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.particle.SpentCasing; import com.hbm.particle.SpentCasing;
import com.hbm.util.BobMathUtil;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
@ -74,6 +77,149 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
IMagazine.handleAmmoBag(inventory, this.getType(stack, inventory), amount); IMagazine.handleAmmoBag(inventory, this.getType(stack, inventory), amount);
} }
/** Returns true if the player has the same ammo if partially loaded, or any valid ammo if not */
@Override
public boolean canReload(ItemStack stack, IInventory inventory) {
if(this.getAmount(stack, inventory) >= this.getCapacity(stack)) return false;
if(inventory == null) return true;
BulletConfig nextConfig = getFirstConfig(stack, inventory);
return nextConfig != null;
}
public void standardReload(ItemStack stack, IInventory inventory, int loadLimit) {
if(inventory == null) {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
this.setAmount(stack, this.capacity);
return;
}
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
//mag is empty, assume next best type
if(this.getAmount(stack, null) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) {
this.setType(stack, config);
int wantsToLoad = (int) Math.ceil((double) this.getCapacity(stack) / (double) config.ammoReloadCount);
int toLoad = BobMathUtil.min(wantsToLoad, slot.stackSize, loadLimit);
this.setAmount(stack, Math.min(toLoad * config.ammoReloadCount, this.capacity));
inventory.decrStackSize(i, toLoad);
break;
}
}
//mag has a type set, only load that
} else {
BulletConfig config = this.getType(stack, null);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
if(config.ammo.matchesRecipe(slot, true)) {
int alreadyLoaded = this.getAmount(stack, null);
int wantsToLoad = (int) Math.ceil((double) (this.getCapacity(stack) - alreadyLoaded) / (double) config.ammoReloadCount);
int toLoad = BobMathUtil.min(wantsToLoad, slot.stackSize, loadLimit);
this.setAmount(stack, Math.min((toLoad * config.ammoReloadCount) + alreadyLoaded, this.capacity));
inventory.decrStackSize(i, toLoad);
}
}
if(slot.getItem() == ModItems.ammo_bag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
//mag is empty, assume next best type
if(this.getAmount(stack, null) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(bagslot, true)) {
this.setType(stack, config);
int wantsToLoad = (int) Math.ceil((double) this.getCapacity(stack) / (double) config.ammoReloadCount);
int toLoad = BobMathUtil.min(wantsToLoad, bagslot.stackSize, loadLimit);
this.setAmount(stack, Math.min(toLoad * config.ammoReloadCount, this.capacity));
bag.decrStackSize(j, toLoad);
break;
}
}
//mag has a type set, only load that
} else {
BulletConfig config = this.getType(stack, null);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); } //fixing broken NBT
if(config.ammo.matchesRecipe(bagslot, true)) {
int alreadyLoaded = this.getAmount(stack, bag);
int wantsToLoad = (int) Math.ceil((double) (this.getCapacity(stack) - alreadyLoaded) / (double) config.ammoReloadCount);
int toLoad = BobMathUtil.min(wantsToLoad, bagslot.stackSize, loadLimit);
this.setAmount(stack, Math.min((toLoad * config.ammoReloadCount) + alreadyLoaded, this.capacity));
bag.decrStackSize(j, toLoad);
}
}
}
}
}
}
}
}
/** Returns the config of the first potential loadable round, either what's already chambered or the first valid one if empty */
public BulletConfig getFirstConfig(ItemStack stack, IInventory inventory) {
if(inventory == null) return null;
for(int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
if(this.getAmount(stack, inventory) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) return config;
}
} else {
BulletConfig config = this.getType(stack, inventory);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); }
if(config.ammo.matchesRecipe(slot, true)) return config;
}
if(slot.getItem() == ModItems.ammo_bag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
if(this.getAmount(stack, bag) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(bagslot, true)) return config;
}
} else {
BulletConfig config = this.getType(stack, bag);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); }
if(config.ammo.matchesRecipe(bagslot, true)) return config;
}
}
}
}
}
}
return null;
}
@Override public void initNewType(ItemStack stack, IInventory inventory) {
if(inventory == null) return;
BulletConfig nextConfig = getFirstConfig(stack, inventory);
if(nextConfig != null) {
int i = BulletConfig.configs.indexOf(nextConfig);
this.setMagType(stack, index, i);
}
}
@Override public int getCapacity(ItemStack stack) { return capacity; } @Override public int getCapacity(ItemStack stack) { return capacity; }
@Override public int getAmount(ItemStack stack, IInventory inventory) { return getMagCount(stack, index); } @Override public int getAmount(ItemStack stack, IInventory inventory) { return getMagCount(stack, index); }
@Override public void setAmount(ItemStack stack, int amount) { setMagCount(stack, index, amount); } @Override public void setAmount(ItemStack stack, int amount) { setMagCount(stack, index, amount); }
@ -84,7 +230,7 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
@Override public int getAmountAfterReload(ItemStack stack) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_AFTER + index); } @Override public int getAmountAfterReload(ItemStack stack) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_AFTER + index); }
// MAG TYPE // // MAG TYPE //
public static int getMagType(ItemStack stack, int index) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_TYPE + index); } //TODO: replace with named tags to avoid ID shifting public static int getMagType(ItemStack stack, int index) { return ItemGunBaseNT.getValueInt(stack, KEY_MAG_TYPE + index); }
public static void setMagType(ItemStack stack, int index, int value) { ItemGunBaseNT.setValueInt(stack, KEY_MAG_TYPE + index, value); } public static void setMagType(ItemStack stack, int index, int value) { ItemGunBaseNT.setValueInt(stack, KEY_MAG_TYPE + index, value); }
// MAG COUNT // // MAG COUNT //

View File

@ -88,7 +88,7 @@ public class WeaponModManager {
ModItems.gun_spas12, ModItems.gun_spas12,
ModItems.gun_panzerschreck }; ModItems.gun_panzerschreck };
Item[] wsteelGuns = new Item[] { Item[] wsteelGuns = new Item[] {
ModItems.gun_g3, ModItems.gun_g3, ModItems.gun_g3_zebra,
ModItems.gun_stinger, ModItems.gun_stinger,
ModItems.gun_chemthrower }; ModItems.gun_chemthrower };
Item[] ferroGuns = new Item[] { Item[] ferroGuns = new Item[] {
@ -101,6 +101,7 @@ public class WeaponModManager {
ModItems.gun_missile_launcher, ModItems.gun_missile_launcher,
ModItems.gun_tesla_cannon }; ModItems.gun_tesla_cannon };
Item[] bigmtGuns = new Item[] { Item[] bigmtGuns = new Item[] {
ModItems.gun_laser_pistol, ModItems.gun_laser_pistol_pew_pew,
ModItems.gun_stg77, ModItems.gun_stg77,
ModItems.gun_fatman, ModItems.gun_fatman,
ModItems.gun_tau }; ModItems.gun_tau };
@ -130,7 +131,7 @@ public class WeaponModManager {
new WeaponModDefinition(EnumModSpecial.SAW) new WeaponModDefinition(EnumModSpecial.SAW)
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF)) .addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))
.addMod(ModItems.gun_panzerschreck, new WeaponModPanzerschreckSawedOff(ID_NO_SHIELD)) .addMod(ModItems.gun_panzerschreck, new WeaponModPanzerschreckSawedOff(ID_NO_SHIELD))
.addMod(ModItems.gun_g3, new WeapnModG3SawedOff(ID_NO_STOCK)); .addMod(new Item[] {ModItems.gun_g3, ModItems.gun_g3_zebra}, new WeapnModG3SawedOff(ID_NO_STOCK));
new WeaponModDefinition(EnumModSpecial.GREASEGUN).addMod(ModItems.gun_greasegun, new WeaponModGreasegun(ID_GREASEGUN_CLEAN)); new WeaponModDefinition(EnumModSpecial.GREASEGUN).addMod(ModItems.gun_greasegun, new WeaponModGreasegun(ID_GREASEGUN_CLEAN));
new WeaponModDefinition(EnumModSpecial.SLOWDOWN).addMod(ModItems.gun_minigun, new WeaponModSlowdown(207)); new WeaponModDefinition(EnumModSpecial.SLOWDOWN).addMod(ModItems.gun_minigun, new WeaponModSlowdown(207));
new WeaponModDefinition(EnumModSpecial.SPEEDUP) new WeaponModDefinition(EnumModSpecial.SPEEDUP)

View File

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

View File

@ -650,6 +650,8 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.containment_box, 1), new Object[] { "LUL", "UCU", "LUL", 'L', PB.plate(), 'U', U238.billet(), 'C', ModBlocks.crate_steel }); addRecipeAuto(new ItemStack(ModItems.containment_box, 1), new Object[] { "LUL", "UCU", "LUL", 'L', PB.plate(), 'U', U238.billet(), 'C', ModBlocks.crate_steel });
addRecipeAuto(new ItemStack(ModItems.casing_bag, 1), new Object[] { " L ", "LGL", " L ", 'L', Items.leather, 'G', GUNMETAL.plate() }); addRecipeAuto(new ItemStack(ModItems.casing_bag, 1), new Object[] { " L ", "LGL", " L ", 'L', Items.leather, 'G', GUNMETAL.plate() });
addRecipeAuto(new ItemStack(ModItems.casing_bag, 1), new Object[] { " L ", "LGL", " L ", 'L', ANY_RUBBER.ingot(), 'G', GUNMETAL.plate() }); addRecipeAuto(new ItemStack(ModItems.casing_bag, 1), new Object[] { " L ", "LGL", " L ", 'L', ANY_RUBBER.ingot(), 'G', GUNMETAL.plate() });
addRecipeAuto(new ItemStack(ModItems.ammo_bag, 1), new Object[] { "LLL", "MGM", "LLL", 'L', Items.leather, 'G', WEAPONSTEEL.plate(), 'M', WEAPONSTEEL.mechanism() });
addRecipeAuto(new ItemStack(ModItems.ammo_bag, 1), new Object[] { "LLL", "MGM", "LLL", 'L', ANY_RUBBER.ingot(), 'G', WEAPONSTEEL.plate(), 'M', WEAPONSTEEL.mechanism() });
addRecipeAuto(new ItemStack(ModBlocks.absorber, 1), new Object[] { "ICI", "CPC", "ICI", 'I', CU.ingot(), 'C', COAL.dust(), 'P', PB.dust() }); addRecipeAuto(new ItemStack(ModBlocks.absorber, 1), new Object[] { "ICI", "CPC", "ICI", 'I', CU.ingot(), 'C', COAL.dust(), 'P', PB.dust() });
addRecipeAuto(new ItemStack(ModBlocks.absorber_red, 1), new Object[] { "ICI", "CPC", "ICI", 'I', TI.ingot(), 'C', COAL.dust(), 'P', ModBlocks.absorber }); addRecipeAuto(new ItemStack(ModBlocks.absorber_red, 1), new Object[] { "ICI", "CPC", "ICI", 'I', TI.ingot(), 'C', COAL.dust(), 'P', ModBlocks.absorber });
@ -752,7 +754,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.struct_watz_core, 1), new Object[] { "CBC", "BHB", "CBC", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'B', ANY_RESISTANTALLOY.plateCast(), 'H', ModBlocks.watz_cooler }); addRecipeAuto(new ItemStack(ModBlocks.struct_watz_core, 1), new Object[] { "CBC", "BHB", "CBC", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'B', ANY_RESISTANTALLOY.plateCast(), 'H', ModBlocks.watz_cooler });
addShapelessAuto(new ItemStack(ModBlocks.fusion_heater), new Object[] { ModBlocks.fusion_hatch }); addShapelessAuto(new ItemStack(ModBlocks.fusion_heater), new Object[] { ModBlocks.fusion_hatch });
addShapelessAuto(new ItemStack(ModItems.energy_core), new Object[] { ModItems.fusion_core, ModItems.fuse }); addShapelessAuto(new ItemStack(ModItems.energy_core), new Object[] { ModItems.fusion_core, ModItems.fuse });
addRecipeAuto(new ItemStack(ModItems.catalytic_converter, 1), new Object[] { "PCP", "PBP", "PCP", 'P', ANY_HARDPLASTIC.ingot(), 'C', CO.dust(), 'B', BI.ingot() }); addRecipeAuto(new ItemStack(ModItems.catalytic_converter, 1), new Object[] { "PCP", "PBP", "PCP", 'P', ANY_HARDPLASTIC.ingot(), 'C', CO.dust(), 'B', ANY_BISMOID.ingot() });
addRecipeAuto(new ItemStack(ModItems.upgrade_nullifier, 1), new Object[] { "SPS", "PUP", "SPS", 'S', STEEL.plate(), 'P', ModItems.powder_fire, 'U', ModItems.upgrade_template }); addRecipeAuto(new ItemStack(ModItems.upgrade_nullifier, 1), new Object[] { "SPS", "PUP", "SPS", 'S', STEEL.plate(), 'P', ModItems.powder_fire, 'U', ModItems.upgrade_template });
addRecipeAuto(new ItemStack(ModItems.upgrade_smelter, 1), new Object[] { "PHP", "CUC", "DTD", 'P', CU.plate(), 'H', Blocks.hopper, 'C', ModItems.coil_tungsten, 'U', ModItems.upgrade_template, 'D', ModItems.coil_copper, 'T', ModBlocks.machine_transformer }); addRecipeAuto(new ItemStack(ModItems.upgrade_smelter, 1), new Object[] { "PHP", "CUC", "DTD", 'P', CU.plate(), 'H', Blocks.hopper, 'C', ModItems.coil_tungsten, 'U', ModItems.upgrade_template, 'D', ModItems.coil_copper, 'T', ModBlocks.machine_transformer });

View File

@ -75,7 +75,7 @@ public class ResourceManager {
public static final IModelCustom refinery_exploded = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/refinery_exploded.obj")).asVBO(); public static final IModelCustom refinery_exploded = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/refinery_exploded.obj")).asVBO();
public static final IModelCustom fraction_tower = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_tower.obj")); public static final IModelCustom fraction_tower = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_tower.obj"));
public static final IModelCustom fraction_spacer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_spacer.obj")); public static final IModelCustom fraction_spacer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_spacer.obj"));
public static final IModelCustom cracking_tower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/cracking_tower.obj")).asVBO(); public static final IModelCustom cracking_tower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/catalytic_cracker.obj")).asVBO();
public static final IModelCustom catalytic_reformer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/catalytic_reformer.obj")).asVBO(); public static final IModelCustom catalytic_reformer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/catalytic_reformer.obj")).asVBO();
public static final IModelCustom hydrotreater = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/hydrotreater.obj")).asVBO(); public static final IModelCustom hydrotreater = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/hydrotreater.obj")).asVBO();
public static final IModelCustom liquefactor = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/liquefactor.obj")).asVBO(); public static final IModelCustom liquefactor = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/liquefactor.obj")).asVBO();
@ -492,7 +492,7 @@ public class ResourceManager {
public static final ResourceLocation vacuum_distill_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/vacuum_distill.png"); public static final ResourceLocation vacuum_distill_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/vacuum_distill.png");
public static final ResourceLocation fraction_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fraction_tower.png"); public static final ResourceLocation fraction_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fraction_tower.png");
public static final ResourceLocation fraction_spacer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fraction_spacer.png"); public static final ResourceLocation fraction_spacer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fraction_spacer.png");
public static final ResourceLocation cracking_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/cracking_tower.png"); public static final ResourceLocation cracking_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/catalytic_cracker.png");
public static final ResourceLocation catalytic_reformer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/catalytic_reformer.png"); public static final ResourceLocation catalytic_reformer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/catalytic_reformer.png");
public static final ResourceLocation hydrotreater_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/hydrotreater.png"); public static final ResourceLocation hydrotreater_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/hydrotreater.png");
public static final ResourceLocation liquefactor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/liquefactor.png"); public static final ResourceLocation liquefactor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/liquefactor.png");
@ -982,6 +982,7 @@ public class ResourceManager {
public static final ResourceLocation uzi_saturnite_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/uzi_saturnite.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 panzerschreck_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/panzerschreck.png");
public static final ResourceLocation g3_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3.png"); public static final ResourceLocation g3_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"); public static final ResourceLocation g3_green_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_green.png");
public static final ResourceLocation g3_black_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_black.png"); public static final ResourceLocation g3_black_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_polymer_black.png");
public static final ResourceLocation g3_attachments = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_attachments.png"); public static final ResourceLocation g3_attachments = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/g3_attachments.png");

View File

@ -2,6 +2,7 @@ package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.ItemGunBaseNT; import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mods.WeaponModManager; import com.hbm.items.weapon.sedna.mods.WeaponModManager;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
@ -12,6 +13,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class ItemRenderG3 extends ItemRenderWeaponBase { public class ItemRenderG3 extends ItemRenderWeaponBase {
public ResourceLocation texture;
public ItemRenderG3(ResourceLocation texture) {
this.texture = texture;
}
@Override @Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; } protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@ -209,16 +216,16 @@ public class ItemRenderG3 extends ItemRenderWeaponBase {
} }
public boolean hasSilencer(ItemStack stack) { public boolean hasSilencer(ItemStack stack) {
return WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SILENCER); return stack.getItem() == ModItems.gun_g3_zebra || WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SILENCER);
} }
public boolean isScoped(ItemStack stack) { public boolean isScoped(ItemStack stack) {
return WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SCOPE); return stack.getItem() == ModItems.gun_g3_zebra || WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SCOPE);
} }
public ResourceLocation getTexture(ItemStack stack) { public ResourceLocation getTexture(ItemStack stack) {
if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_GREEN)) return ResourceManager.g3_green_tex; if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_GREEN)) return ResourceManager.g3_green_tex;
if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_BLACK)) return ResourceManager.g3_black_tex; if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_FURNITURE_BLACK)) return ResourceManager.g3_black_tex;
return ResourceManager.g3_tex; return texture;
} }
} }

View File

@ -45,7 +45,7 @@ public class RenderPyroOven extends TileEntitySpecialRenderer implements IItemRe
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(1.5, 0, 1.5); GL11.glTranslated(1.5, 0, 1.5);
GL11.glRotated(anim * -15D % 360D, 0, 1, 0); GL11.glRotated(anim * 45D % 360D, 0, 1, 0);
GL11.glTranslated(-1.5, 0, -1.5); GL11.glTranslated(-1.5, 0, -1.5);
ResourceManager.pyrooven.renderPart("Fan"); ResourceManager.pyrooven.renderPart("Fan");
GL11.glPopMatrix(); GL11.glPopMatrix();

View File

@ -6,7 +6,6 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Flammable; import com.hbm.inventory.fluid.trait.FT_Flammable;
import com.hbm.inventory.gui.GUIIGenerator;
import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.CompatEnergyControl; import com.hbm.util.CompatEnergyControl;
@ -290,7 +289,7 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUIIGenerator(player.inventory, this); return null;
} }
@Override @Override

View File

@ -281,6 +281,7 @@ chem.XENON=Lindeverfahren (Xenon)
chem.XENON_OXY=Verbessertes Lindeverfahren (Xenon) chem.XENON_OXY=Verbessertes Lindeverfahren (Xenon)
chem.YELLOWCAKE=Yellowcakeproduktion chem.YELLOWCAKE=Yellowcakeproduktion
container.ammoBag=Mun-Tasche
container.amsBase=AMS-Basis (Deko) container.amsBase=AMS-Basis (Deko)
container.amsEmitter=AMS-Emitter (Deko) container.amsEmitter=AMS-Emitter (Deko)
container.amsLimiter=AMS-Stabilisator (Deko) container.amsLimiter=AMS-Stabilisator (Deko)
@ -1029,6 +1030,7 @@ item.ammo_arty_nuke.name=16" Atomare Artilleriegranate
item.ammo_arty_phosgene.name=16" Artilleriegranate (Phosgen) item.ammo_arty_phosgene.name=16" Artilleriegranate (Phosgen)
item.ammo_arty_phosphorus.name=16" Phosphor-Artilleriegranate item.ammo_arty_phosphorus.name=16" Phosphor-Artilleriegranate
item.ammo_arty_phosphorus_multi.name=16" Mehrfach-Phosphor-Artilleriegranate item.ammo_arty_phosphorus_multi.name=16" Mehrfach-Phosphor-Artilleriegranate
item.ammo_bag.name=Munitionstasche
item.ammo_dgk.name=Goalkeeper-Zwilling CIWS 200er Gürtel item.ammo_dgk.name=Goalkeeper-Zwilling CIWS 200er Gürtel
item.ammo_fireext.name=Feuerlöscher-Wassertank item.ammo_fireext.name=Feuerlöscher-Wassertank
item.ammo_fireext_foam.name=Feuerlöscher-Schaumtank item.ammo_fireext_foam.name=Feuerlöscher-Schaumtank
@ -2082,6 +2084,7 @@ item.gun_folly.name=Folly
item.gun_g3.name=Sturmgewehr item.gun_g3.name=Sturmgewehr
item.gun_g3_a3.name=G3A3 item.gun_g3_a3.name=G3A3
item.gun_g3_infiltrator.name=Infiltrierer item.gun_g3_infiltrator.name=Infiltrierer
item.gun_g3_zebra.name=Zebra-Gewehr
item.gun_greasegun.name=Grease Gun item.gun_greasegun.name=Grease Gun
item.gun_greasegun_m3.name=M3 item.gun_greasegun_m3.name=M3
item.gun_hangman.name=Hangman item.gun_hangman.name=Hangman

View File

@ -682,6 +682,7 @@ commands.satellite.satellite_descended=Satellite successfully descended.
commands.satellite.satellite_orbited=Satellite launched. commands.satellite.satellite_orbited=Satellite launched.
commands.satellite.should_be_run_as_player=This command should be run by a player! commands.satellite.should_be_run_as_player=This command should be run by a player!
container.ammoBag=Ammo Bag
container.amsBase=AMS Base (Deco) container.amsBase=AMS Base (Deco)
container.amsEmitter=AMS Emitter (Deco) container.amsEmitter=AMS Emitter (Deco)
container.amsLimiter=AMS Stabilizer (Deco) container.amsLimiter=AMS Stabilizer (Deco)
@ -1754,6 +1755,7 @@ item.ammo_arty_nuke.name=16" Nuclear Artillery Shell
item.ammo_arty_phosgene.name=16" Phosgene Artillery Shell item.ammo_arty_phosgene.name=16" Phosgene Artillery Shell
item.ammo_arty_phosphorus.name=16" Phosphorus Shell item.ammo_arty_phosphorus.name=16" Phosphorus Shell
item.ammo_arty_phosphorus_multi.name=16" Multi Phosphorus Shell item.ammo_arty_phosphorus_multi.name=16" Multi Phosphorus Shell
item.ammo_bag.name=Ammo Bag
item.ammo_container.name=Ammo Container item.ammo_container.name=Ammo Container
item.ammo_dgk.name=Goalkeeper Twin CIWS 200 Round Belt item.ammo_dgk.name=Goalkeeper Twin CIWS 200 Round Belt
item.ammo_fireext.name=Fire Extinguisher Water Tank item.ammo_fireext.name=Fire Extinguisher Water Tank
@ -2895,6 +2897,7 @@ item.gun_folly.name=Folly
item.gun_g3.name=Assault Rifle item.gun_g3.name=Assault Rifle
item.gun_g3_a3.name=G3A3 item.gun_g3_a3.name=G3A3
item.gun_g3_infiltrator.name=Infiltrator item.gun_g3_infiltrator.name=Infiltrator
item.gun_g3_zebra.name=Zebra Rifle
item.gun_greasegun.name=Grease Gun item.gun_greasegun.name=Grease Gun
item.gun_greasegun_m3.name=M3 item.gun_greasegun_m3.name=M3
item.gun_hangman.name=Hangman item.gun_hangman.name=Hangman

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB