The Wand of the Forest can rotate blocks now.

This commit is contained in:
Vasco Lavos committed 2014-06-22 00:07:00 +01:00
1 parent 470790819d
commit fdd7aea16b
3 files changed
+10 -3

No files matched your search

@@ -30,6 +30,7 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.wand.ICoordBoundItem;
import vazkii.botania.api.wand.ITileBound;
import vazkii.botania.api.wand.IWandable;
@@ -62,7 +63,9 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
Block block = par3World.getBlock(par4, par5, par6);
ChunkCoordinates boundSpreader = getBoundSpreader(par1ItemStack);
if(boundSpreader.posY != -1 && par2EntityPlayer.isSneaking() && !par3World.isRemote && (boundSpreader.posX != par4 || boundSpreader.posY != par5 || boundSpreader.posZ != par6)) {
TileEntity tile = par3World.getTileEntity(boundSpreader.posX, boundSpreader.posY, boundSpreader.posZ);
if(tile instanceof TileSpreader) {
@@ -96,9 +99,12 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
par3World.markBlockForUpdate(boundSpreader.posX, boundSpreader.posY, boundSpreader.posZ);
return true;
} else setBoundSpreader(par1ItemStack, 0, -1, 0);
} else if(par2EntityPlayer.isSneaking()) {
block.rotateBlock(par3World, par4, par5, par6, ForgeDirection.getOrientation(par7));
if(par3World.isRemote)
par2EntityPlayer.swingItem();
}
Block block = par3World.getBlock(par4, par5, par6);
if(block == Blocks.lapis_block) {
int meta = -1;
if(TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 0))
@@ -187,7 +187,7 @@ public final class LexiconData {
lexicon.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLexicon), new PageText("2"));
wand = new BLexiconEntry(LibLexicon.BASICS_WAND, categoryBasics);
wand.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipesTwigWand));
wand.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipesTwigWand));
pureDaisy = new BLexiconEntry(LibLexicon.BASICS_PURE_DAISY, categoryBasics);
pureDaisy.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_PURE_DAISY), new PageCraftingRecipe("2", ModCrafingRecipes.recipeLivingwoodTwig), new PagePetalRecipe("3", ModPetalRecipes.pureDaisyRecipe));