mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-27 15:33:10 +00:00
Clean up
Added setters for the IAccessor.
This commit is contained in:
1 parent
3843fd9815
commit
28d19ef015
3 files changed
+19
-40
No files matched your search
@@ -68,11 +68,28 @@ public class DataAccessor implements IWailaDataAccessor {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockID() {
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
public void setBlock(Block block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public void setBlockID(int val) {
|
||||
this.blockID = val;
|
||||
}
|
||||
|
||||
public void setMetadata(int val) {
|
||||
this.metadata = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity() {
|
||||
return this.entity;
|
||||
@@ -108,11 +125,6 @@ public class DataAccessor implements IWailaDataAccessor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockID() {
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
private boolean isTagCorrect(NBTTagCompound tag){
|
||||
if (tag == null){
|
||||
this.timeLastUpdate = System.currentTimeMillis() - 250;
|
||||
|
||||
@@ -5,11 +5,13 @@ import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.api.IWailaBlock;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.network.Packet0x01TERequest;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.nei.api.ItemInfo.Layout;
|
||||
@@ -27,7 +29,6 @@ public class MetaDataProvider{
|
||||
Block block = accessor.getBlock();
|
||||
int blockID = accessor.getBlockID();
|
||||
|
||||
/*
|
||||
if (IWailaBlock.class.isInstance(block)){
|
||||
try{
|
||||
return ((IWailaBlock)block).getWailaStack(accessor, ConfigHandler.instance());
|
||||
@@ -35,7 +36,6 @@ public class MetaDataProvider{
|
||||
WailaExceptionHandler.handleErr(e, block.getClass().toString(), null);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if(ModuleRegistrar.instance().hasStackProviders(blockID)){
|
||||
for (IWailaDataProvider dataProvider : ModuleRegistrar.instance().getStackProviders(blockID)){
|
||||
@@ -62,7 +62,6 @@ public class MetaDataProvider{
|
||||
}
|
||||
|
||||
/* Interface IWailaBlock */
|
||||
/*
|
||||
if (IWailaBlock.class.isInstance(block)){
|
||||
TileEntity entity = world.getBlockTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
if (layout == Layout.HEADER)
|
||||
@@ -84,7 +83,6 @@ public class MetaDataProvider{
|
||||
return WailaExceptionHandler.handleErr(e, block.getClass().toString(), currenttip);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
headProviders.clear();
|
||||
bodyProviders.clear();
|
||||
|
||||
@@ -122,7 +122,6 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
||||
if (!this.stackProviders.containsKey(blockID))
|
||||
this.stackProviders.put(blockID, new ArrayList<IWailaDataProvider>());
|
||||
this.stackProviders.get(blockID).add(dataProvider);
|
||||
//API.registerHighlightIdentifier(blockID, new HUDHandlerExternal());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,21 +152,6 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
||||
this.blockClassDecorators.put(block, new ArrayList<IWailaBlockDecorator>());
|
||||
this.blockClassDecorators.get(block).add(decorator);
|
||||
}
|
||||
|
||||
/* Arrays getters */
|
||||
/*
|
||||
public ArrayList<IWailaDataProvider> getHeadProviders(int blockID) {
|
||||
return this.headProviders.get(blockID);
|
||||
}
|
||||
|
||||
public ArrayList<IWailaDataProvider> getBodyProviders(int blockID) {
|
||||
return this.bodyProviders.get(blockID);
|
||||
}
|
||||
|
||||
public ArrayList<IWailaDataProvider> getTailProviders(int blockID) {
|
||||
return this.tailProviders.get(blockID);
|
||||
}
|
||||
*/
|
||||
|
||||
public ArrayList<IWailaDataProvider> getHeadProviders(Object block) {
|
||||
ArrayList<IWailaDataProvider> returnList = new ArrayList<IWailaDataProvider>();
|
||||
@@ -222,21 +206,6 @@ public class ModuleRegistrar implements IWailaRegistrar {
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/* Providers querry methods */
|
||||
/*
|
||||
public boolean hasHeadProviders(int blockID){
|
||||
return this.headProviders.containsKey(blockID);
|
||||
}
|
||||
|
||||
public boolean hasBodyProviders(int blockID){
|
||||
return this.bodyProviders.containsKey(blockID);
|
||||
}
|
||||
|
||||
public boolean hasTailProviders(int blockID){
|
||||
return this.tailProviders.containsKey(blockID);
|
||||
}
|
||||
*/
|
||||
|
||||
public boolean hasStackProviders(int blockID){
|
||||
return this.stackProviders.containsKey(blockID);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user