mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Changed some tiny things
This commit is contained in:
parent
4cf3797058
commit
afcbc81d35
5 changed files with 56 additions and 57 deletions
|
@ -19,35 +19,33 @@ public class RenderPlayerEventAA{
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
|
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
|
||||||
if(!event.entityPlayer.isInvisible() && !event.entityPlayer.getHideCape()){
|
//Ellpeck
|
||||||
//Ellpeck
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){
|
ellpeckRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
ellpeckRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//Paktosan
|
//Paktosan
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
|
||||||
paktoRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
paktoRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TwoOfEight
|
//TwoOfEight
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
|
||||||
glenRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
glenRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//dqmhose
|
//dqmhose
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
|
||||||
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
|
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Lordi
|
//Lordi
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){
|
||||||
lordiRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
lordiRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ public class RenderSpecial{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(EntityPlayer player, float renderTick, float size, float offsetUp){
|
public void render(EntityPlayer player, float renderTick, float size, float offsetUp){
|
||||||
|
if(player.isInvisible() || player.getHideCape()) return;
|
||||||
|
|
||||||
int bobHeight = 70;
|
int bobHeight = 70;
|
||||||
long theTime = Minecraft.getSystemTime();
|
long theTime = Minecraft.getSystemTime();
|
||||||
long time = theTime/50;
|
long time = theTime/50;
|
||||||
|
|
|
@ -53,15 +53,15 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
|
||||||
int meta = worldObj.getBlockMetadata(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ());
|
int meta = worldObj.getBlockMetadata(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ());
|
||||||
drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), meta, 0));
|
drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), meta, 0));
|
||||||
|
|
||||||
if(addToInventory(this.slots, drops, false)){
|
if(WorldUtil.addToInventory(this.slots, drops, false)){
|
||||||
worldObj.playAuxSFX(2001, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), Block.getIdFromBlock(blockToBreak) + (meta << 12));
|
worldObj.playAuxSFX(2001, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), Block.getIdFromBlock(blockToBreak) + (meta << 12));
|
||||||
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord);
|
WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord);
|
||||||
addToInventory(this.slots, drops, true);
|
WorldUtil.addToInventory(this.slots, drops, true);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){
|
else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){
|
||||||
int theSlot = testInventory(this.slots);
|
int theSlot = WorldUtil.findFirstEmptySlot(this.slots);
|
||||||
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot]));
|
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot]));
|
||||||
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null;
|
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null;
|
||||||
}
|
}
|
||||||
|
@ -85,32 +85,6 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
|
||||||
this.currentTime = compound.getInteger("CurrentTime");
|
this.currentTime = compound.getInteger("CurrentTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean addToInventory(ItemStack[] slots, ArrayList<ItemStack> stacks, boolean actuallyDo){
|
|
||||||
int working = 0;
|
|
||||||
for(ItemStack stack : stacks){
|
|
||||||
for(int i = 0; i < slots.length; i++){
|
|
||||||
if(slots[i] == null || (slots[i].isItemEqual(stack) && slots[i].stackSize <= stack.getMaxStackSize()-stack.stackSize)){
|
|
||||||
working++;
|
|
||||||
if(actuallyDo){
|
|
||||||
if(slots[i] == null) slots[i] = stack.copy();
|
|
||||||
else slots[i].stackSize += stack.stackSize;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return working >= stacks.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int testInventory(ItemStack[] slots){
|
|
||||||
for(int i = 0; i < slots.length; i++){
|
|
||||||
if(slots[i] != null){
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int i, ItemStack stack){
|
public boolean isItemValidForSlot(int i, ItemStack stack){
|
||||||
return this.isPlacer;
|
return this.isPlacer;
|
||||||
|
|
|
@ -63,17 +63,17 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase{
|
||||||
int meta = boundPosition.getWorld().getBlockMetadata(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
|
int meta = boundPosition.getWorld().getBlockMetadata(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
|
||||||
drops.addAll(blockToBreak.getDrops(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), meta, 0));
|
drops.addAll(blockToBreak.getDrops(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), meta, 0));
|
||||||
|
|
||||||
if(TileEntityBreaker.addToInventory(this.slots, drops, false)){
|
if(WorldUtil.addToInventory(this.slots, drops, false)){
|
||||||
boundPosition.getWorld().playAuxSFX(2001, boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), Block.getIdFromBlock(blockToBreak)+(meta << 12));
|
boundPosition.getWorld().playAuxSFX(2001, boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), Block.getIdFromBlock(blockToBreak)+(meta << 12));
|
||||||
WorldUtil.breakBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
|
WorldUtil.breakBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
|
||||||
TileEntityBreaker.addToInventory(this.slots, drops, true);
|
WorldUtil.addToInventory(this.slots, drops, true);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){
|
if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){
|
||||||
int theSlot = TileEntityBreaker.testInventory(this.slots);
|
int theSlot = WorldUtil.findFirstEmptySlot(this.slots);
|
||||||
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot]));
|
this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot]));
|
||||||
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null;
|
if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,4 +183,29 @@ public class WorldUtil{
|
||||||
return blocks;
|
return blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean addToInventory(ItemStack[] slots, ArrayList<ItemStack> stacks, boolean actuallyDo){
|
||||||
|
int working = 0;
|
||||||
|
for(ItemStack stack : stacks){
|
||||||
|
for(int i = 0; i < slots.length; i++){
|
||||||
|
if(slots[i] == null || (slots[i].isItemEqual(stack) && slots[i].stackSize <= stack.getMaxStackSize()-stack.stackSize)){
|
||||||
|
working++;
|
||||||
|
if(actuallyDo){
|
||||||
|
if(slots[i] == null) slots[i] = stack.copy();
|
||||||
|
else slots[i].stackSize += stack.stackSize;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return working >= stacks.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int findFirstEmptySlot(ItemStack[] slots){
|
||||||
|
for(int i = 0; i < slots.length; i++){
|
||||||
|
if(slots[i] != null){
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue