mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 06:53:30 +00:00
Begin 1.11 (compiles, does not run yet)
This commit is contained in:
1 parent
5310003659
commit
424fdaaf48
164 files changed
+1396
-1312
No files matched your search
@@ -45,24 +45,22 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack getStackInSlot(final int index) {
|
||||
if (index >= 0 && index < this.indexerInventory.size()) {
|
||||
return this.indexerInventory.get(index);
|
||||
}
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack decrStackSize(final int index, final int amount) {
|
||||
ItemStack stackInSlot = this.getStackInSlot(index);
|
||||
if (stackInSlot != null) {
|
||||
if (!stackInSlot.isEmpty()) {
|
||||
final ItemStack returnStack = stackInSlot.copy();
|
||||
this.setInventorySlotContents(index, null);
|
||||
this.setInventorySlotContents(index, ItemStack.EMPTY);
|
||||
return returnStack;
|
||||
}
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,10 +70,10 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(final int index, @Nullable final ItemStack itemStack) {
|
||||
public void setInventorySlotContents(final int index, final ItemStack itemStack) {
|
||||
if (index >= 0 && index < this.indexerInventory.size()) {
|
||||
this.indexerInventory.set(index, itemStack);
|
||||
} else if (itemStack != null) {
|
||||
} else if (!itemStack.isEmpty()) {
|
||||
this.indexerInventory.add(itemStack);
|
||||
}
|
||||
this.needsSorting = true;
|
||||
@@ -98,7 +96,7 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(final EntityPlayer var1) {
|
||||
public boolean isUsableByPlayer(final EntityPlayer var1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -140,7 +138,7 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
this.indexerInventory.clear();
|
||||
for (int i = 0; i < indexerNBT.tagCount(); ++i) {
|
||||
final NBTTagCompound itemNBT = indexerNBT.getCompoundTagAt(i);
|
||||
this.setInventorySlotContents(i, ItemStack.loadItemStackFromNBT(itemNBT));
|
||||
this.setInventorySlotContents(i, new ItemStack(itemNBT));
|
||||
}
|
||||
this.needsSorting = true;
|
||||
this.markDirty();
|
||||
@@ -271,10 +269,14 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return this.sortedInventory.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeStackFromSlot(int index) {
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
@Override
|
||||
public void readFromNBT(final NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.stack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Item"));
|
||||
this.stack = new ItemStack(nbttagcompound.getCompoundTag("Item"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,15 +108,15 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
final float f = this.getMachine().getWorld().rand.nextFloat() * 0.8f + 0.1f;
|
||||
final float f2 = this.getMachine().getWorld().rand.nextFloat() * 0.8f + 0.1f;
|
||||
final float f3 = this.getMachine().getWorld().rand.nextFloat() * 0.8f + 0.1f;
|
||||
if (this.stack.stackSize == 0) {
|
||||
this.stack.stackSize = 1;
|
||||
if (this.stack.getCount() == 0) {
|
||||
this.stack.setCount(1);
|
||||
}
|
||||
final EntityItem entityitem = new EntityItem(this.getMachine().getWorld(), this.getMachine().getTileEntity().getPos().getX() + f, this.getMachine().getTileEntity().getPos().getY() + f2, this.getMachine().getTileEntity().getPos().getZ() + f3, this.stack.copy());
|
||||
final float accel = 0.05f;
|
||||
entityitem.motionX = (float) this.getMachine().getWorld().rand.nextGaussian() * accel;
|
||||
entityitem.motionY = (float) this.getMachine().getWorld().rand.nextGaussian() * accel + 0.2f;
|
||||
entityitem.motionZ = (float) this.getMachine().getWorld().rand.nextGaussian() * accel;
|
||||
this.getMachine().getWorld().spawnEntityInWorld(entityitem);
|
||||
this.getMachine().getWorld().spawnEntity(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
// final double d3 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
// final EntityItem entityitem = new EntityItem(world, x + d0, y + d2, z + d3, this.stack);
|
||||
// entityitem.delayBeforeCanPickup = 10;
|
||||
// world.spawnEntityInWorld(entityitem);
|
||||
// world.spawnEntity(entityitem);
|
||||
// this.stack = null;
|
||||
// ((IToolWrench) player.getHeldItem().getItem()).wrenchUsed(player, x, y, z);
|
||||
// this.getUtil().refreshBlock();
|
||||
@@ -161,7 +161,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
// if (this.stack == null && validSelections.contains(player.getHeldItem().getItem())) {
|
||||
// this.stack = player.getHeldItem().copy();
|
||||
// final ItemStack heldItem = player.getHeldItem();
|
||||
// --heldItem.stackSize;
|
||||
// heldItem.shrink(1);
|
||||
// world.markBlockForUpdate(x, y, z);
|
||||
// return;
|
||||
// }
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MachineRendererLab {
|
||||
private long lastTick;
|
||||
|
||||
public MachineRendererLab() {
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
World world = Minecraft.getMinecraft().world;
|
||||
this.dummyEntityItem = new EntityItem(world);
|
||||
this.itemSides = new EntityItem[]{new EntityItem(world), new EntityItem(world), new EntityItem(world), new EntityItem(world)};
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class MachineRendererLab {
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance();
|
||||
if (Minecraft.isFancyGraphicsEnabled()) {
|
||||
final ItemStack stack = holder.getStack();
|
||||
this.dummyEntityItem.worldObj = world;
|
||||
this.dummyEntityItem.world = world;
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
if (world.getTotalWorldTime() != this.lastTick) {
|
||||
this.lastTick = world.getTotalWorldTime();
|
||||
@@ -70,7 +70,7 @@ public class MachineRendererLab {
|
||||
int rot = 0;
|
||||
for (EntityItem item : this.itemSides) {
|
||||
GlStateManager.pushMatrix();
|
||||
item.worldObj = world;
|
||||
item.world = world;
|
||||
item.setEntityItemStack(stack);
|
||||
GlStateManager.rotate(rot, 0.0f, 1.0f, 0.0f);
|
||||
GlStateManager.rotate(180.0f, 1.0f, 0.0f, 0.0f);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class AnalyserFX extends MachineComponent implements IRender.DisplayTick,
|
||||
this.motionY = 0.0;
|
||||
this.particleMaxAge = 25;
|
||||
this.particleGravity = 0.05f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.6f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class AnalyserFX extends MachineComponent implements IRender.DisplayTick,
|
||||
return;
|
||||
}
|
||||
final ItemStack stack = this.getUtil().getStack(6);
|
||||
this.dummyEntityItem.worldObj = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.world = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
final EntityItem dummyEntityItem = this.dummyEntityItem;
|
||||
dummyEntityItem.setAgeToCreativeDespawnTime(); //++dummyEntityItem.age;
|
||||
@@ -102,7 +102,7 @@ public class AnalyserFX extends MachineComponent implements IRender.DisplayTick,
|
||||
@Override
|
||||
public void syncFromNBT(final NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("item")) {
|
||||
this.getUtil().setStack(6, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item")));
|
||||
this.getUtil().setStack(6, new ItemStack(nbt.getCompoundTag("item")));
|
||||
} else {
|
||||
this.getUtil().setStack(6, null);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ControlGene extends Control implements IControlValue<IGene>, IToolt
|
||||
}
|
||||
|
||||
private boolean canFill(final ItemStack stack) {
|
||||
return stack != null && stack.stackSize == 1 && Engineering.isGeneAcceptor(stack) && Engineering.canAcceptGene(stack, this.getValue());
|
||||
return stack != null && stack.getCount() == 1 && Engineering.isGeneAcceptor(stack) && Engineering.canAcceptGene(stack, this.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GenepoolFX extends MachineComponent implements IRender.DisplayTick
|
||||
this.motionY = this.rand.nextFloat() * 0.01;
|
||||
this.particleMaxAge = 25;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.4f + 0.6f * this.rand.nextFloat(), 0.6f * this.rand.nextFloat(), 0.6f + 0.4f * this.rand.nextFloat());
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 0.92, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
double angle = (int) (this.world.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -46,7 +46,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
this.motionY = 0.007 + this.rand.nextDouble() * 0.002;
|
||||
this.particleMaxAge = 240;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
return;
|
||||
}
|
||||
final ItemStack stack = this.getUtil().getStack(9);
|
||||
this.dummyEntityItem.worldObj = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.world = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
final EntityItem dummyEntityItem = this.dummyEntityItem;
|
||||
dummyEntityItem.setAgeToCreativeDespawnTime(); // ++dummyEntityItem.age;
|
||||
@@ -113,7 +113,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
@Override
|
||||
public void syncFromNBT(final NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("item")) {
|
||||
this.getUtil().setStack(9, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item")));
|
||||
this.getUtil().setStack(9, new ItemStack(nbt.getCompoundTag("item")));
|
||||
} else {
|
||||
this.getUtil().setStack(9, null);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class IsolaterFX extends MachineComponent implements IRender.RandomDispla
|
||||
this.motionY = -0.012;
|
||||
this.particleMaxAge = 100;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.4f, 0.0f);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class IsolaterFX extends MachineComponent implements IRender.RandomDispla
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||
double angle = 0.7 + (int) (this.world.getTotalWorldTime() % 2L) * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -71,7 +71,7 @@ public class IsolaterFX extends MachineComponent implements IRender.RandomDispla
|
||||
this.motionY = 0.012;
|
||||
this.particleMaxAge = 100;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class PolymeriserFX extends MachineComponent implements IRender.DisplayTi
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.8, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||
double angle = 0.7 + (int) (this.world.getTotalWorldTime() % 2L) * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -36,7 +36,7 @@ public class PolymeriserFX extends MachineComponent implements IRender.DisplayTi
|
||||
this.motionY = -0.006;
|
||||
this.particleMaxAge = 140;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SequencerFX extends MachineComponent implements IRender.RandomDispl
|
||||
this.motionY = 0.0;
|
||||
this.particleMaxAge = 200;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.6f + this.rand.nextFloat() * 0.2f, 1.0f, 0.8f * this.rand.nextFloat() * 0.2f);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class SequencerFX extends MachineComponent implements IRender.RandomDispl
|
||||
this.motionY = 0.012;
|
||||
this.particleMaxAge = 50;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.particleScale = 2.0f;
|
||||
//TODO: Add sprites
|
||||
//this.setParticleIcon((new BinnieIcon[] { Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT })[this.rand.nextInt(4)].getIcon());
|
||||
|
||||
@@ -54,7 +54,7 @@ public class SequencerLogic extends ComponentProcess implements IProcess {
|
||||
return new ErrorState.NoItem(Genetics.proxy.localise("machine.machine.sequencer.errors.insufficient.dye"), Sequencer.SLOT_DYE);
|
||||
}
|
||||
ItemStack stackDone = this.getUtil().getStack(Sequencer.SLOT_DONE);
|
||||
if (stackDone != null && stackDone.stackSize >= 64) {
|
||||
if (stackDone != null && stackDone.getCount() >= 64) {
|
||||
return new ErrorState.NoSpace(Genetics.proxy.localise("machine.machine.sequencer.errors.no.space"), new int[]{Sequencer.SLOT_DONE});
|
||||
}
|
||||
return super.canProgress();
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
double angle = (int) (this.world.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -46,11 +46,12 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
this.motionY = (this.rand.nextDouble() - 0.5) * 0.02;
|
||||
this.particleMaxAge = 240;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.3f + this.rand.nextFloat() * 0.5f, 0.3f + this.rand.nextFloat() * 0.5f, 0.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
final double speed = 0.04;
|
||||
@@ -75,7 +76,7 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
return;
|
||||
}
|
||||
final ItemStack stack = this.getUtil().getStack(9);
|
||||
this.dummyEntityItem.worldObj = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.world = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
final EntityItem dummyEntityItem = this.dummyEntityItem;
|
||||
dummyEntityItem.setAgeToCreativeDespawnTime(); //++dummyEntityItem.age;
|
||||
@@ -107,7 +108,7 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
@Override
|
||||
public void syncFromNBT(final NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("item")) {
|
||||
this.getUtil().setStack(9, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item")));
|
||||
this.getUtil().setStack(9, new ItemStack(nbt.getCompoundTag("item")));
|
||||
} else {
|
||||
this.getUtil().setStack(9, null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user