Revert a shit load of stuff

This commit is contained in:
modmuss50 2016-07-01 15:40:46 +01:00
parent 1acacd811b
commit d25bb23e8e
327 changed files with 2470 additions and 1680 deletions

View file

@ -163,8 +163,8 @@ public class ClientProxy extends CommonProxy
}
@Override
public void registerCustomBlockSateLocation(Block block, String resourceLocation) {
super.registerCustomBlockSateLocation(block, resourceLocation);
public void registerCustomBlockStateLocation(Block block, String resourceLocation, boolean item) {
super.registerCustomBlockStateLocation(block, resourceLocation, item);
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper()
{
@Override
@ -175,7 +175,35 @@ public class ClientProxy extends CommonProxy
return new ModelResourceLocation(resourceDomain + ':' + resourceLocation, propertyString);
}
});
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
if(item){
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
}
}
@Override
public void registerSubItemInventoryLocation(Item item, int meta, String location, String name) {
super.registerSubItemInventoryLocation(item, meta, location, name);
Block block = Block.getBlockFromItem(item);
if(block != null){
IBlockState state = block.getStateFromMeta(meta);
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
StateMapperBase base = new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return null;
}
};
String propertyString = base.getPropertyString(state.getProperties());
ModelResourceLocation resourceLocation = new ModelResourceLocation(resourceDomain + ':' + location, propertyString);
ModelLoader.setCustomModelResourceLocation(item, meta, resourceLocation);
} else {
ResourceLocation loc = item.getRegistryName();
String resourceDomain = Item.REGISTRY.getNameForObject(item).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(resourceDomain + ':' + loc, "type=" + name));
}
}
}

View file

@ -1,6 +1,7 @@
package techreborn.proxies;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@ -38,8 +39,20 @@ public class CommonProxy implements ICompatModule
}
public void registerCustomBlockSateLocation(Block block, String name) {
public void registerCustomBlockStateLocation(Block block, String name) {
registerCustomBlockStateLocation(block, name, true);
}
public void registerCustomBlockStateLocation(Block block, String name, boolean item) {
}
public void registerSubItemInventoryLocation(Item item, int meta , String location, String name){
}
public void registerSubBlockInventoryLocation(Block block, int meta , String location, String name){
registerSubItemInventoryLocation(Item.getItemFromBlock(block), meta, location, name);
}
}