Fix a load of null issues, and get it to sort of work.

This commit is contained in:
modmuss50 2016-11-19 16:36:13 +00:00
parent 65e651f402
commit 528fecc2b5
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
35 changed files with 101 additions and 87 deletions

View file

@ -132,6 +132,7 @@ public class ClientProxy extends CommonProxy {
@Override
public void registerFluidBlockRendering(Block block, String name) {
name = name.toLowerCase();
super.registerFluidBlockRendering(block, name);
final ModelResourceLocation fluidLocation = new ModelResourceLocation(ModInfo.MOD_ID.toLowerCase() + ":fluids", name);
@ -146,13 +147,15 @@ public class ClientProxy extends CommonProxy {
@Override
public void registerCustomBlockSateLocation(Block block, String resourceLocation) {
resourceLocation = resourceLocation.toLowerCase();
super.registerCustomBlockSateLocation(block, resourceLocation);
String finalResourceLocation = resourceLocation;
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
String propertyString = getPropertyString(state.getProperties());
return new ModelResourceLocation(resourceDomain + ':' + resourceLocation, propertyString);
return new ModelResourceLocation(resourceDomain + ':' + finalResourceLocation, propertyString);
}
});
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();