Centrifuge sounds, updated gas flare texture and model fix

This commit is contained in:
HbmMods 2018-10-28 17:27:54 +01:00
parent 7bc0cc426f
commit d9f549d6c8
14 changed files with 825 additions and 1032 deletions

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,7 @@
"block.lockOpen": {"category": "block", "sounds": [{"name": "block/lockOpen", "stream": false}]},
"block.lockHang": {"category": "block", "sounds": [{"name": "block/lockHang", "stream": false}]},
"block.debris": {"category": "block", "sounds": ["block/debris1", "block/debris2", "block/debris3"]},
"block.centrifugeOperate": {"category": "block", "sounds": [{"name": "block/centrifugeOperate", "stream": false}]},
"item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]},
"item.techBoop": {"category": "player", "sounds": [{"name": "tool/techBoop", "stream": false}]},

Binary file not shown.

BIN
assets/hbm/textures/models/oilFlareTexture.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -13,10 +13,8 @@ import net.minecraft.item.ItemStack;
public class ContainerCentrifuge extends Container {
private TileEntityMachineCentrifuge diFurnace;
private int dualCookTime;
public ContainerCentrifuge(InventoryPlayer invPlayer, TileEntityMachineCentrifuge tedf) {
dualCookTime = 0;
diFurnace = tedf;
@ -80,30 +78,5 @@ public class ContainerCentrifuge extends Container {
public boolean canInteractWith(EntityPlayer player) {
return diFurnace.isUseableByPlayer(player);
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for(int i = 0; i < this.crafters.size(); i++)
{
ICrafting par1 = (ICrafting)this.crafters.get(i);
if(this.dualCookTime != this.diFurnace.dualCookTime)
{
par1.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime);
}
}
this.dualCookTime = this.diFurnace.dualCookTime;
}
@Override
public void updateProgressBar(int i, int j) {
if(i == 0)
{
diFurnace.dualCookTime = j;
}
}
}

View File

@ -89,7 +89,7 @@ public class ItemStarterKit extends Item {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.template_folder, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_press, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_difurnace_off, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_centrifuge, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_gascent, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_puf6_tank, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_nuke_furnace_off, 1));
@ -160,7 +160,8 @@ public class ItemStarterKit extends Item {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ingot_lead, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ingot_polymer, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_difurnace_off, 3));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_centrifuge, 3));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_gascent, 3));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_centrifuge, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_uf6_tank, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_puf6_tank, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor, 2));
@ -231,6 +232,7 @@ public class ItemStarterKit extends Item {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.fluid_barrel_full, 8, FluidType.COOLANT.getID()));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_assembler, 1));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_chemplant, 3));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_gascent, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_nuke_furnace_off, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_furnace_off, 3));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_grey, 2));

View File

@ -539,7 +539,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 1), new Object[] { "AHA", "TCT", "TPT", 'T', "plateIron", 'A', "plateAluminum", 'S', "plateSteel", 'C', "ingotCopper", 'P', Item.getItemFromBlock(Blocks.piston), 'H', Item.getItemFromBlock(Blocks.hopper) }));
//GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_centrifuge), 1), new Object[] { " T ", "RDR", "RSR", 'S', "plateSteel", 'T', ModItems.centrifuge_tower, 'W', ModItems.coil_tungsten, 'R', ModItems.coil_copper, 'D', Item.getItemFromBlock(ModBlocks.machine_difurnace_off) }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateTitanium", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateIron", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateSteel", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
//GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_reactor), 1), new Object[] { "LSL", "SCS", "LSL", 'S', "ingotSteel", 'L', "ingotLead", 'C', ModItems.reactor_core }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 1), new Object[] { "SSS", "SFS", "CCC", 'S', "plateSteel", 'C', "plateCopper", 'F', Item.getItemFromBlock(Blocks.furnace) }));
@ -1372,10 +1372,11 @@ public class CraftingManager {
GameRegistry.addSmelting(ModItems.combine_scrap, new ItemStack(ModItems.ingot_combine_steel), 1.0F);
GameRegistry.addSmelting(ModItems.tank_waste, new ItemStack(ModItems.tank_waste), 0.0F);
GameRegistry.addSmelting(ModItems.canister_smear, new ItemStack(ModItems.canister_reoil), 1.0F);
//GameRegistry.addSmelting(ModItems.canister_smear, new ItemStack(ModItems.canister_reoil), 1.0F);
GameRegistry.addSmelting(Items.bone, new ItemStack(Items.slime_ball, 3), 0.0F);
GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 15), new ItemStack(Items.slime_ball, 1), 0.0F);
GameRegistry.addSmelting(new ItemStack(Blocks.gravel, 1), new ItemStack(Blocks.cobblestone, 1), 0.0F);
GameRegistry.addSmelting(new ItemStack(ModBlocks.gravel_obsidian), new ItemStack(Blocks.obsidian), 0.0F);
}
}

View File

@ -8,6 +8,7 @@ import com.hbm.tileentity.deco.TileEntityBomber;
import com.hbm.tileentity.machine.TileEntityAMSBase;
import com.hbm.tileentity.machine.TileEntityAMSEmitter;
import com.hbm.tileentity.machine.TileEntityAMSLimiter;
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
@ -152,9 +153,19 @@ public class AuxGaugePacket implements IMessage {
}
if (te instanceof TileEntityMachineGasCent) {
TileEntityMachineGasCent cent = (TileEntityMachineGasCent)te;
if(m.id == 0)
cent.progress = m.value;
if(m.id == 1)
cent.isProgressing = m.value == 1;
}
if (te instanceof TileEntityMachineCentrifuge) {
TileEntityMachineCentrifuge cent = (TileEntityMachineCentrifuge)te;
if(m.id == 0)
cent.dualCookTime = m.value;
if(m.id == 1)
cent.isProgressing = m.value == 1;
}
} catch (Exception x) { }

View File

@ -2,13 +2,16 @@ package com.hbm.packet;
import com.hbm.sound.SoundLoopAssembler;
import com.hbm.sound.SoundLoopBroadcaster;
import com.hbm.sound.SoundLoopCentrifuge;
import com.hbm.sound.SoundLoopChemplant;
import com.hbm.sound.SoundLoopIGen;
import com.hbm.sound.SoundLoopMiner;
import com.hbm.sound.SoundLoopTurbofan;
import com.hbm.tileentity.machine.TileEntityBroadcaster;
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
@ -136,6 +139,34 @@ public class LoopedSoundPacket implements IMessage {
if(flag && te.getWorldObj().isRemote)
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopBroadcaster(new ResourceLocation("hbm:block.broadcast" + (Math.abs(j) % 3 + 1)), te));
}
if (te != null && te instanceof TileEntityMachineCentrifuge) {
boolean flag = true;
for(int i = 0; i < SoundLoopCentrifuge.list.size(); i++) {
if(SoundLoopCentrifuge.list.get(i).getTE() == te && !SoundLoopCentrifuge.list.get(i).isDonePlaying())
flag = false;
}
int j = te.xCoord + te.zCoord + te.yCoord;
if(flag && te.getWorldObj().isRemote && ((TileEntityMachineCentrifuge)te).isProgressing)
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopCentrifuge(new ResourceLocation("hbm:block.centrifugeOperate"), te));
}
if (te != null && te instanceof TileEntityMachineGasCent) {
boolean flag = true;
for(int i = 0; i < SoundLoopCentrifuge.list.size(); i++) {
if(SoundLoopCentrifuge.list.get(i).getTE() == te && !SoundLoopCentrifuge.list.get(i).isDonePlaying())
flag = false;
}
int j = te.xCoord + te.zCoord + te.yCoord;
if(flag && te.getWorldObj().isRemote && ((TileEntityMachineGasCent)te).isProgressing)
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopCentrifuge(new ResourceLocation("hbm:block.centrifugeOperate"), te));
}
return null;
}
}

View File

@ -0,0 +1,52 @@
package com.hbm.sound;
import java.util.ArrayList;
import java.util.List;
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class SoundLoopCentrifuge extends SoundLoopMachine {
public static List<SoundLoopCentrifuge> list = new ArrayList<SoundLoopCentrifuge>();
public SoundLoopCentrifuge(ResourceLocation path, TileEntity te) {
super(path, te);
list.add(this);
}
@Override
public void update() {
super.update();
if(te instanceof TileEntityMachineCentrifuge) {
TileEntityMachineCentrifuge plant = (TileEntityMachineCentrifuge)te;
if(this.volume != 1)
volume = 1;
if(!plant.isProgressing)
this.donePlaying = true;
}
if(te instanceof TileEntityMachineGasCent) {
TileEntityMachineGasCent plant = (TileEntityMachineGasCent)te;
if(this.volume != 1)
volume = 1;
if(!plant.isProgressing)
this.donePlaying = true;
}
}
public TileEntity getTE() {
return te;
}
}

View File

@ -5,6 +5,8 @@ import com.hbm.inventory.MachineRecipes;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.LoopedSoundPacket;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
@ -26,7 +28,7 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
public int dualCookTime;
public long power;
public int soundCycle = 0;
public boolean isProgressing;
public static final int maxPower = 100000;
public static final int processingSpeed = 200;
@ -310,6 +312,13 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
}
}
if(hasPower() && canProcess())
{
isProgressing = true;
} else {
isProgressing = false;
}
boolean trigger = true;
if(hasPower() && canProcess() && this.dualCookTime == 0)
@ -323,17 +332,14 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
}
PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, dualCookTime, 0));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, isProgressing ? 1 : 0, 1));
PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord));
}
if(hasPower() && canProcess())
{
dualCookTime++;
if(soundCycle == 0)
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 1.5F);
soundCycle++;
if(soundCycle >= 25)
soundCycle = 0;
if(this.dualCookTime >= TileEntityMachineCentrifuge.processingSpeed)
{

View File

@ -14,6 +14,7 @@ import com.hbm.inventory.MachineRecipes.GasCentOutput;
import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.LoopedSoundPacket;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
@ -33,6 +34,7 @@ public class TileEntityMachineGasCent extends TileEntity implements ISidedInvent
public long power;
public int progress;
public boolean isProgressing;
public static final int maxPower = 100000;
public static final int processingSpeed = 200;
@ -154,6 +156,7 @@ public class TileEntityMachineGasCent extends TileEntity implements ISidedInvent
power = nbt.getLong("powerTime");
progress = nbt.getShort("CookTime");
tank.readFromNBT(nbt, "tank");
slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++)
@ -172,6 +175,7 @@ public class TileEntityMachineGasCent extends TileEntity implements ISidedInvent
super.writeToNBT(nbt);
nbt.setLong("powerTime", power);
nbt.setShort("cookTime", (short) progress);
tank.writeToNBT(nbt, "tank");
NBTTagList list = new NBTTagList();
for(int i = 0; i < slots.length; i++)
@ -283,6 +287,8 @@ public class TileEntityMachineGasCent extends TileEntity implements ISidedInvent
if(canProcess()) {
isProgressing = true;
this.progress++;
this.power -= 200;
@ -295,11 +301,14 @@ public class TileEntityMachineGasCent extends TileEntity implements ISidedInvent
}
} else {
isProgressing = false;
this.progress = 0;
}
PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, progress, 0));
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, isProgressing ? 1 : 0, 1));
PacketDispatcher.wrapper.sendToAll(new LoopedSoundPacket(xCoord, yCoord, zCoord));
}
}

View File

@ -208,17 +208,17 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
@Override
public void updateEntity() {
age++;
if(age >= 20)
{
age = 0;
}
if(age == 9 || age == 19)
ffgeuaInit();
if(!worldObj.isRemote)
{
age++;
if(age >= 20)
{
age = 0;
}
if(age == 9 || age == 19)
ffgeuaInit();
heat = 0;
for(int i = 0; i < slots.length; i++) {

View File

@ -185,7 +185,7 @@ public class TileEntityMachineShredder extends TileEntity implements ISidedInven
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
if(i >= 9 && i <= 28)
if(i >= 9 && i <= 26)
return true;
if(i >= 27 && i <= 29)
if(itemStack.getItemDamage() == itemStack.getMaxDamage())