mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-16 18:44:44 +00:00
The Horn of the Wild no longer uproots Glimmering Flowers.
This commit is contained in:
1 parent
e69306aae3
commit
e07bdbd0f4
4 files changed
+34
-3
No files matched your search
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Oct 29, 2014, 4:52:04 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* A BlockBush can implement this to check if it can be broken
|
||||
* by a Horn/Drum of the Wild or not.
|
||||
*/
|
||||
public interface IGrassHornExcempt {
|
||||
|
||||
public boolean canUproot(World world, int x, int y, int z);
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Botania", apiVersion = "20", provides = "BotaniaAPI")
|
||||
@API(owner = "Botania", apiVersion = "21", provides = "BotaniaAPI")
|
||||
package vazkii.botania.api;
|
||||
import cpw.mods.fml.common.API;
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
import vazkii.botania.api.item.IGrassHornExcempt;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -25,7 +26,7 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockShinyFlower extends BlockModFlower implements IInfusionStabiliser {
|
||||
public class BlockShinyFlower extends BlockModFlower implements IInfusionStabiliser, IGrassHornExcempt {
|
||||
|
||||
public BlockShinyFlower() {
|
||||
super(LibBlockNames.SHINY_FLOWER);
|
||||
@@ -52,4 +53,9 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUproot(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IGrassHornExcempt;
|
||||
import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -112,7 +113,7 @@ public class ItemGrassHorn extends ItemMod {
|
||||
int z = srcz + j;
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if(stackDmg == 0 && block instanceof BlockBush && !(block instanceof ISpecialFlower) || stackDmg == 1 && block instanceof BlockLeavesBase)
|
||||
if((stackDmg == 0 && block instanceof BlockBush && !(block instanceof ISpecialFlower) && (!(block instanceof IGrassHornExcempt) || ((IGrassHornExcempt) block).canUproot(world, x, y, z))) || (stackDmg == 1 && block instanceof BlockLeavesBase))
|
||||
coords.add(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user