the part i forgot to push

This commit is contained in:
Bob 2025-04-11 19:26:33 +02:00
parent 16f9c4ad16
commit 1f6d4bf55b
23 changed files with 2592 additions and 432 deletions

View File

@ -40,6 +40,7 @@
* Changed the optimized receiver generic gun mod to +15% damage
* The xenon chemical plant recipes as well as biogas now require compressed air instead of no fluid at all
* Removed old unused radar configs
* The .22 SMG no longer comes with a silencer, instead a silencer can be attached as a weapon mod
## Fixed
* Fixed taint destroying bedrock
@ -54,3 +55,5 @@
* Fixed infested glyphids spawning maggots also on the clientside, creating unkillable ghosts
* Fixed top left column not being selectable in the RBMK console
* Fixed CIWS hitrate config being read wrong
* Fixed DANI having broken equip animations
* Fixed break-action revolver cockking sound not syncing up with the animation

View File

@ -1,8 +1,5 @@
package com.hbm.blocks.bomb;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.BombConfig;
import com.hbm.entity.logic.EntityBalefire;
import com.hbm.handler.threading.PacketThreading;
@ -14,78 +11,37 @@ import com.hbm.tileentity.bomb.TileEntityCrashedBomb;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockCrashedBomb extends BlockContainer implements IBomb {
public BlockCrashedBomb(Material p_i45386_1_) {
super(p_i45386_1_);
public BlockCrashedBomb(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityCrashedBomb();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return Item.getItemFromBlock(ModBlocks.crashed_balefire);
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0) {
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
}
if(i == 1) {
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
}
if(i == 2) {
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
if(i == 3) {
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
}
@Override public int getRenderType() { return -1; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float fx, float fy, float fz) {
if(world.isRemote)
return true;
if(world.isRemote) return true;
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.defuser) {
world.func_147480_a(x, y, z, false);
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.egg_balefire_shard)));
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.plate_steel, 10 + world.rand.nextInt(15))));
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.plate_titanium, 2 + world.rand.nextInt(7))));
return true;
}

View File

@ -64,7 +64,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_maresleg, 1), new Object[] { "BRM", "BGS", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', STEEL.bolt(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_maresleg_akimbo, 1), new Object[] { "SMS", 'S', ModItems.gun_maresleg, 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flaregun, 1), new Object[] { "BRM", " G", 'B', STEEL.heavyBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', STEEL.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_am180, 1), new Object[] { "BBR", "GMS", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_am180, 1), new Object[] { "BRS", "GMG", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_liberator, 1), new Object[] { "BB ", "BBM", "G G", 'B', DURA.lightBarrel(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_congolake, 1), new Object[] { "BM ", "BRS", "G ", 'B', DURA.heavyBarrel(), 'M', GUNMETAL.mechanism(), 'R', DURA.lightReceiver(), 'S', WOOD.stock(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flamer, 1), new Object[] { " MG", "BBR", " GM", 'M', GUNMETAL.mechanism(), 'G', DURA.grip(), 'B', DURA.heavyBarrel(), 'R', DURA.heavyReceiver() });

View File

@ -2,9 +2,6 @@ package com.hbm.inventory;
import com.hbm.interfaces.NotableComments;
import com.hbm.inventory.container.ContainerCrateBase;
import com.hbm.items.block.ItemBlockStorageCrate;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@ -36,17 +33,4 @@ public class SlotNonRetarded extends Slot {
public int getSlotStackLimit() {
return Math.max(this.inventory.getInventoryStackLimit(), this.getHasStack() ? this.getStack().stackSize : 1);
}
/**
* This prevents the player from moving containers that are being held *at all*, fixing a decently big dupe.
* I hate that this has to be here but... It is what it is.
*/
@Override
public boolean canTakeStack(EntityPlayer player) {
if(player.inventory.currentItem == this.getSlotIndex() && // If this slot is the current held slot.
this.getStack() != null && this.getStack().getItem() instanceof ItemBlockStorageCrate && // If the slot contains a storage crate.
player.openContainer instanceof ContainerCrateBase) // If the player is currently inside a crate container.
return false;
return super.canTakeStack(player);
}
}

View File

@ -1,10 +1,12 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotNonRetarded;
import com.hbm.items.block.ItemBlockStorageCrate;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class ContainerCrateBase extends ContainerBase {
@ -15,12 +17,25 @@ public class ContainerCrateBase extends ContainerBase {
super(invPlayer, tedf);
tile.openInventory();
}
@Override
public void playerInv(InventoryPlayer invPlayer, int playerInvX, int playerInvY, int playerHotbarY) {
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new SlotNonRetarded(invPlayer, j + i * 9 + 9, playerInvX + j * 18, playerInvY + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new SlotNonRetarded(invPlayer, i, playerInvX + i * 18, playerHotbarY));
}
}
@Override
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
// prevents the player from moving around the currently open box
if(player.inventory.getStackInSlot(player.inventory.currentItem) != null &&
player.inventory.getStackInSlot(player.inventory.currentItem).getItem() instanceof ItemBlockStorageCrate) {
player.inventory.getStackInSlot(player.inventory.currentItem).getItem() instanceof ItemBlockStorageCrate && !(this.crate instanceof TileEntity)) {
if (mode == 2 && button == player.inventory.currentItem) {
return null;
}
@ -36,4 +51,24 @@ public class ContainerCrateBase extends ContainerBase {
super.onContainerClosed(p_75134_1_);
tile.closeInventory();
}
public class SlotPlayerCrate extends SlotNonRetarded {
public SlotPlayerCrate(IInventory inventory, int id, int x, int y) {
super(inventory, id, x, y);
}
/**
* This prevents the player from moving containers that are being held *at all*, fixing a decently big dupe.
* I hate that this has to be here but... It is what it is.
*/
@Override
public boolean canTakeStack(EntityPlayer player) {
if(player.inventory.currentItem == this.getSlotIndex() && // If this slot is the current held slot.
this.getStack() != null && this.getStack().getItem() instanceof ItemBlockStorageCrate && // If the slot contains a storage crate.
player.openContainer instanceof ContainerCrateBase && !(ContainerCrateBase.this.crate instanceof TileEntity)) // If the player is currently inside a crate container.
return false;
return super.canTakeStack(player);
}
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.items.machine;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.CompatExternal;
import net.minecraft.entity.player.EntityPlayer;
@ -15,8 +15,8 @@ public class ItemMuffler extends Item {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f0, float f1, float f2) {
TileEntity te = CompatExternal.getCoreFromPos(world, x, y, z);
if(te != null && te instanceof TileEntityMachineBase) {
TileEntityMachineBase tile = (TileEntityMachineBase) te;
if(te != null && te instanceof TileEntityLoadedBase) {
TileEntityLoadedBase tile = (TileEntityLoadedBase) te;
if(!tile.muffled) {
tile.muffled = true;
world.playSoundAtEntity(player, "hbm:item.upgradePlug", 1.0F, 1.0F);

View File

@ -103,11 +103,11 @@ public class Orchestras {
if(timer == 44) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.CYCLE) {
if(timer == 14) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 14) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
}
if(type == AnimType.INSPECT) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
@ -131,11 +131,11 @@ public class Orchestras {
if(timer == 44) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.CYCLE) {
if(timer == 9) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 9) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.9F);
}
if(type == AnimType.INSPECT) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);

View File

@ -2,6 +2,7 @@ package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import com.hbm.config.ClientConfig;
import com.hbm.items.ModItems;
@ -15,6 +16,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
import com.hbm.main.ResourceManager;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
@ -46,15 +48,21 @@ public class XFactory22lr {
ModItems.gun_am180 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(177 * 25).draw(15).inspect(38).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE)
.rec(new Receiver(0)
.dmg(2F).delay(1).dry(10).auto(true).spread(0.02F).reload(66).jam(30).sound("hbm:weapon.fire.silenced", 1.0F, 1.0F)
.dmg(2F).delay(1).dry(10).auto(true).spread(0.02F).reload(66).jam(30).sound("hbm:weapon.fire.greaseGun", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 177).addConfigs(p22_sp, p22_fmj, p22_jhp, p22_ap))
.offset(1, -0.0625 * 1.5, -0.1875D)
.setupStandardFire().recoil(LAMBDA_RECOIL_AM180))
.setupStandardConfiguration()
.anim(LAMBDA_AM180_ANIMS).orchestra(Orchestras.ORCHESTRA_AM180)
).setUnlocalizedName("gun_am180");
).setNameMutator(LAMBDA_NAME_AM180)
.setUnlocalizedName("gun_am180");
}
public static Function<ItemStack, String> LAMBDA_NAME_AM180 = (stack) -> {
if(WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.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);
};

View File

@ -67,7 +67,7 @@ public class XFactory357 {
.setupStandardFire().recoil(LAMBDA_RECOIL_DANI))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_ATLAS_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI),
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI),
new GunConfig().dura(30_000).draw(20).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(15F).spreadHipfire(0F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.pistol", 1.0F, 0.9F)
@ -76,7 +76,7 @@ public class XFactory357 {
.setupStandardFire().recoil(LAMBDA_RECOIL_DANI))
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_ATLAS_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI)
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI)
).setUnlocalizedName("gun_light_revolver_dani");
}
@ -119,4 +119,12 @@ public class XFactory357 {
return null;
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_DANI_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation().addBus("EQUIP", new BusAnimationSequence().addPos(360 * 3, 0, 0, 1000, IType.SIN_DOWN));
}
return LAMBDA_ATLAS_ANIMS.apply(stack, type);
};
}

View File

@ -125,7 +125,7 @@ public class WeaponModManager {
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_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_g3}, new WeaponModSilencer(ID_SILENCER));
new WeaponModDefinition(EnumModSpecial.SILENCER).addMod(new Item[] {ModItems.gun_am180, ModItems.gun_uzi, ModItems.gun_uzi_akimbo, ModItems.gun_g3}, new WeaponModSilencer(ID_SILENCER));
new WeaponModDefinition(EnumModSpecial.SCOPE).addMod(new Item[] {ModItems.gun_heavy_revolver, ModItems.gun_g3, ModItems.gun_mas36}, new WeaponModScope(ID_SCOPE));
new WeaponModDefinition(EnumModSpecial.SAW)
.addMod(new Item[] {ModItems.gun_maresleg, ModItems.gun_double_barrel}, new WeaponModSawedOff(ID_SAWED_OFF))

View File

@ -278,6 +278,7 @@ public class ResourceManager {
public static final IModelCustom bomb_multi = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/BombGeneric.obj"));
public static final IModelCustom fstbmb = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/bombs/fstbmb.obj")).asVBO();
public static final IModelCustom dud = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/BalefireCrashed.obj")).asVBO();
public static final IModelCustom dud_balefire = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/bombs/dud_balefire.obj")).asVBO();
//Satellites
public static final IModelCustom sat_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/sat_base.obj"));
@ -728,6 +729,7 @@ public class ResourceManager {
public static final ResourceLocation n45_chain_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/n45_chain.png");
public static final ResourceLocation fstbmb_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/fstbmb.png");
public static final ResourceLocation dud_tex = new ResourceLocation(RefStrings.MODID, "textures/models/BalefireCrashed.png");
public static final ResourceLocation dud_balefire_tex = new ResourceLocation(RefStrings.MODID, "textures/models/bombs/dud_balefire.png");
//Satellites
public static final ResourceLocation sat_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/sat_base.png");

View File

@ -3,6 +3,7 @@ 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.WeaponModManager;
import com.hbm.main.MainRegistry;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
@ -38,6 +39,8 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.am180_tex);
double scale = 0.1875D;
GL11.glScaled(scale, scale, scale);
boolean silenced = this.hasSilencer(stack);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
@ -59,7 +62,7 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
HbmAnimations.applyRelevantTransformation("Gun");
ResourceManager.am180.renderPart("Gun");
ResourceManager.am180.renderPart("Silencer");
if(silenced) ResourceManager.am180.renderPart("Silencer");
GL11.glPushMatrix();
HbmAnimations.applyRelevantTransformation("Trigger");
@ -98,7 +101,7 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 1.875, 17);
GL11.glTranslated(0, 1.875, silenced ? 17 : 13);
GL11.glRotated(turn[2], 0, 0, -1);
GL11.glRotated(90, 0, 1, 0);
this.renderSmokeNodes(gun.getConfig(stack, 0).smokeNodes, 0.25D);
@ -107,11 +110,12 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 1.875, 16.75);
GL11.glTranslated(0, 1.875, silenced ? 16.75 : 12);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
GL11.glScaled(0.5, 0.5, 0.5);
this.renderMuzzleFlash(gun.lastShot[0], 75, 5);
double flashScale = silenced ? 0.5 : 0.75;
GL11.glScaled(flashScale, flashScale, flashScale);
this.renderMuzzleFlash(gun.lastShot[0], silenced ? 75 : 50, silenced ? 5 : 7.5);
GL11.glPopMatrix();
}
@ -148,7 +152,16 @@ public class ItemRenderAm180 extends ItemRenderWeaponBase {
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.am180_tex);
ResourceManager.am180.renderAll();
ResourceManager.am180.renderPart("Gun");
if(this.hasSilencer(stack)) ResourceManager.am180.renderPart("Silencer");
ResourceManager.am180.renderPart("Trigger");
ResourceManager.am180.renderPart("Bolt");
ResourceManager.am180.renderPart("Mag");
ResourceManager.am180.renderPart("MagPlate");
GL11.glShadeModel(GL11.GL_FLAT);
}
public boolean hasSilencer(ItemStack stack) {
return WeaponModManager.hasUpgrade(stack, 0, WeaponModManager.ID_SILENCER);
}
}

View File

@ -1,38 +1,42 @@
package com.hbm.render.tileentity;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.util.fauxpointtwelve.BlockPos;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderCrashedBomb extends TileEntitySpecialRenderer {
public static Random rand = new Random();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
switch(tileEntity.getBlockMetadata())
{
case 5:
GL11.glRotatef(90, 0F, 1F, 0F); break;
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;
}
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
rand.setSeed(BlockPos.getIdentity(tile.xCoord, tile.yCoord, tile.zCoord));
double yaw = rand.nextDouble() * 360;
double pitch = rand.nextDouble() * 45 + 45;
double roll = rand.nextDouble() * 360;
double offset = rand.nextDouble() * 2 - 1;
bindTexture(ResourceManager.dud_tex);
ResourceManager.dud.renderAll();
GL11.glRotated(yaw, 0, 1, 0);
GL11.glRotated(pitch, 1, 0, 0);
GL11.glRotated(roll, 0, 0, 1);
GL11.glTranslated(0, 0, -offset);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.dud_balefire_tex);
ResourceManager.dud_balefire.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -3,6 +3,8 @@ 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.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.fauxpointtwelve.DirPos;
@ -21,6 +23,7 @@ public class TileEntityMachineIntake extends TileEntityLoadedBase implements IEn
public long power;
public float fan = 0;
public float prevFan = 0;
private AudioWrapper audio;
public TileEntityMachineIntake() {
this.compair = new FluidTank(Fluids.AIR, 1_000);
@ -54,6 +57,23 @@ public class TileEntityMachineIntake extends TileEntityLoadedBase implements IEn
this.fan -= 360;
this.prevFan -= 360;
}
if(audio == null) {
audio = createAudioLoop();
audio.startSound();
} else if(!audio.isPlaying()) {
audio = rebootAudio(audio);
}
audio.keepAlive();
audio.updateVolume(this.getVolume(0.25F));
} else {
if(audio != null) {
audio.stopSound();
audio = null;
}
}
}
}
@ -76,6 +96,19 @@ public class TileEntityMachineIntake extends TileEntityLoadedBase implements IEn
};
}
@Override public AudioWrapper createAudioLoop() {
return MainRegistry.proxy.getLoopedSound("hbm:block.motor", xCoord, yCoord, zCoord, 0.25F, 10F, 1.0F, 20);
}
@Override public void 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);

View File

@ -143,7 +143,7 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
speed = (float)(13 * Math.log10(speed) + 1);
tanks[1].setFill((int) (tanks[1].getFill() - recipe.steam * speed));
tanks[2].setFill((int) (tanks[2].getFill() + recipe.steam * speed / 100));
steamUsed += recipe.steam * speed;
this.isProgressing = true;
if(this.progress >= 1F) {
@ -309,8 +309,10 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
if(this.tanks[0].getFill() < recipe.fluid.fill) return false;
}
if(tanks[1].getFill() < recipe.steam) return false;
if(tanks[2].getMaxFill() - tanks[2].getFill() < recipe.steam / 100) return false;
float speed = Math.max((float) burnHeat, 1);
if(tanks[1].getFill() < recipe.steam * speed) return false;
if(tanks[2].getMaxFill() - tanks[2].getFill() < recipe.steam * speed / 100) return false;
if(this.steamUsed > 100) return false;
if(this.output != null) {

View File

@ -85,7 +85,11 @@ public class BlockPos implements Cloneable {
/** modified 1.12 vanilla implementation */
@Override
public int hashCode() {
return (this.getY() + this.getZ() * 27644437) * 27644437 + this.getX();
return getIdentity(this.getX(), this.getY(), this.getZ());
}
public static int getIdentity(int x, int y, int z) {
return (y + z * 27644437) * 27644437 + x;
}
@Override

View File

@ -2217,7 +2217,8 @@ item.grenade_tau.name=Taugranate
item.grenade_zomg.name=Negativenergie-Paarvernichtungsgranate
item.gun_aberrator.name=Aberrator
item.gun_aberrator_eott.name=Eyes Of The Tempest
item.gun_am180.name=Schallgedämpfte Maschinenpistole
item.gun_am180.name=.22er Maschinenpistole
item.gun_am180_silenced.name=Schallgedämpfte .22er Maschinenpistole
item.gun_autoshotgun.name=Auto-Flinte
item.gun_autoshotgun_sexy.name=Sexy
item.gun_autoshotgun_shredder.name=Shredder

View File

@ -3027,7 +3027,8 @@ item.glyphid_gland.name= Gland
item.glyphid_gland_empty.name= Glyphid's Fluid Gland
item.gun_aberrator.name=Aberrator
item.gun_aberrator_eott.name=Eyes Of The Tempest
item.gun_am180.name=Silenced Submachine Gun
item.gun_am180.name=.22 Submachine Gun
item.gun_am180_silenced.name=Silenced .22 Submachine Gun
item.gun_autoshotgun.name=Auto Shotgun
item.gun_autoshotgun_sexy.name=Sexy
item.gun_autoshotgun_shredder.name=Shredder

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -65,6 +65,7 @@
"block.hephaestusRunning": {"category": "block", "sounds": [{"name": "block/hephaestusRunning", "stream": false}]},
"block.squeakyToy": {"category": "block", "sounds": [{"name": "block/squeakyToy", "stream": false}]},
"block.pyroOperate": {"category": "block", "sounds": [{"name": "block/pyroOperate", "stream": false}]},
"block.motor": {"category": "block", "sounds": [{"name": "block/motor", "stream": false}]},
"door.TransitionSealOpen": {"category": "block", "sounds": [{"name": "block/door/transition_seal_open", "stream": true}]},
"door.wghStart": {"category": "block", "sounds": [{"name": "block/door/wgh_start", "stream": true}]},

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB