forked from progwml6/Natura
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing Leaf block names in WAILA (#17)
* Update buildscript and dependencies * Fix Leaf block names in WAILA
- Loading branch information
Showing
5 changed files
with
80 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/mods/natura/plugins/waila/NaturaLeavesDataProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package mods.natura.plugins.waila; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.world.World; | ||
|
||
import mcp.mobius.waila.api.IWailaConfigHandler; | ||
import mcp.mobius.waila.api.IWailaDataAccessor; | ||
import mcp.mobius.waila.api.IWailaDataProvider; | ||
import mods.natura.common.NContent; | ||
|
||
public class NaturaLeavesDataProvider implements IWailaDataProvider { | ||
|
||
@Override | ||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { | ||
Block block = accessor.getBlock(); | ||
int metadata = accessor.getMetadata(); | ||
|
||
if ((block == NContent.floraLeaves || block == NContent.floraLeavesNoColor | ||
|| block == NContent.rareLeaves | ||
|| block == NContent.darkLeaves) && metadata > 3) { | ||
return new ItemStack(block, 1, metadata % 4); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
@Override | ||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, | ||
IWailaConfigHandler config) { | ||
return currenttip; | ||
} | ||
|
||
@Override | ||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, | ||
IWailaConfigHandler config) { | ||
return currenttip; | ||
} | ||
|
||
@Override | ||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, | ||
IWailaConfigHandler config) { | ||
return currenttip; | ||
} | ||
|
||
@Override | ||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, | ||
int y, int z) { | ||
return tag; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters