mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Added Comparator Support to the Spark Tinkerer. Closes #1360
This commit is contained in:
1 parent
51a82ccf37
commit
cf74725d33
3 files changed
+19
-2
No files matched your search
@@ -95,12 +95,14 @@ public class BlockSparkChanger extends BlockModContainer implements ILexiconable
|
||||
ItemStack pstack = player.getCurrentEquippedItem();
|
||||
if(cstack != null) {
|
||||
changer.setInventorySlotContents(0, null);
|
||||
world.func_147453_f(x, y, z, this);
|
||||
changer.markDirty();
|
||||
if(!player.inventory.addItemStackToInventory(cstack))
|
||||
player.dropPlayerItemWithRandomChoice(cstack, false);
|
||||
return true;
|
||||
} else if(pstack != null && pstack.getItem() == ModItems.sparkUpgrade) {
|
||||
changer.setInventorySlotContents(0, pstack.copy().splitStack(1));
|
||||
world.func_147453_f(x, y, z, this);
|
||||
changer.markDirty();
|
||||
|
||||
pstack.stackSize--;
|
||||
@@ -150,7 +152,21 @@ public class BlockSparkChanger extends BlockModContainer implements ILexiconable
|
||||
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int s) {
|
||||
TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(x, y, z);
|
||||
ItemStack stack = changer.getStackInSlot(0);
|
||||
if(stack == null)
|
||||
return 0;
|
||||
return stack.getItemDamage() + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileSparkChanger();
|
||||
|
||||
@@ -57,6 +57,7 @@ public class TileSparkChanger extends TileSimpleInventory {
|
||||
if(transfers != null)
|
||||
transfers.clear();
|
||||
setInventorySlotContents(0, sparkStack);
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2142,7 +2142,7 @@ botania.page.poolCart4=This is not a pipe
|
||||
# -- SPARK TINKERER
|
||||
botania.entry.sparkChanger=Spark Tinkerer
|
||||
botania.page.sparkChanger0=The &1Spark Tinkerer&0 is a block with the ability to modify the &1Augments&0 placed on &1Sparks&0. Placing it adjacent to &1Mana Pools&0 or other blocks with a &1Spark&0 attached will connect it to those blocks.<br>Right clicking the &1Spark Tinkerer&0 with a &1Spark Augment&0 will put the augment in the block, it can be removed by right clicking again.
|
||||
botania.page.sparkChanger1=When the &1Spark Tinkerer&0 gets a redstone signal it'll randomly pick a &1Spark&0, between all of those it's connected to that have a different augment from the one stored in it, and swap the augment in that &1Spark&0 with the one stored in the block.<br>The stored augment can be withdrawn or deposited with &1Hoppers&0 or other automation methods.
|
||||
botania.page.sparkChanger1=When the &1Spark Tinkerer&0 gets a redstone signal it'll randomly pick a &1Spark&0, between all of those it's connected to that have a different augment from the one stored in it, and swap the augment in that &1Spark&0 with the one stored in the block.<br>The stored augment can be withdrawn or deposited with &1Hoppers&0 or other automation methods. &1Comparators&0 can read what augment is stored.
|
||||
botania.page.sparkChanger2=Hahahaha, water fire...
|
||||
|
||||
# -- MANATIDE BELLOWS
|
||||
|
||||
Reference in new issue
Block a user