use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Charset by CharsetMC.
the class CharsetLibWires method onPostBake.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPostBake(ModelBakeEvent event) {
event.getModelRegistry().putObject(new ModelResourceLocation("charset:wire", "redstone=false"), rendererWire);
event.getModelRegistry().putObject(new ModelResourceLocation("charset:wire", "redstone=true"), rendererWire);
event.getModelRegistry().putObject(new ModelResourceLocation("charset:wire", "inventory"), rendererWire);
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Charset by CharsetMC.
the class CharsetCraftingCauldron method onModelBake.
@SubscribeEvent(priority = EventPriority.LOW)
@SideOnly(Side.CLIENT)
public void onModelBake(ModelBakeEvent event) {
IBakedModel l0 = event.getModelRegistry().getObject(new ModelResourceLocation("minecraft:cauldron#level=0"));
if (l0 != null) {
event.getModelRegistry().putObject(new ModelResourceLocation("minecraft:cauldron#level=1"), l0);
event.getModelRegistry().putObject(new ModelResourceLocation("minecraft:cauldron#level=2"), l0);
event.getModelRegistry().putObject(new ModelResourceLocation("minecraft:cauldron#level=3"), l0);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Charset by CharsetMC.
the class CharsetStorageTanks method bakeModels.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void bakeModels(ModelBakeEvent event) {
for (int i = 0; i < 12; i++) {
IBlockState state = tankBlock.getDefaultState().withProperty(BlockTank.VARIANT, i);
ModelResourceLocation location = new ModelResourceLocation("charset:fluidtank", "connections=" + i);
IBakedModel model = event.getModelRegistry().getObject(location);
if (model != null) {
SimpleMultiLayerBakedModel result = new SimpleMultiLayerBakedModel(model);
BlockRenderLayer targetLayer = (i >= 4 && i < 8) ? BlockRenderLayer.TRANSLUCENT : BlockRenderLayer.CUTOUT;
for (int j = 0; j <= 6; j++) {
EnumFacing facingIn = (j < 6) ? EnumFacing.getFront(j) : null;
for (BakedQuad quadIn : model.getQuads(state, facingIn, 0)) {
result.addQuad(targetLayer, facingIn, quadIn);
}
}
event.getModelRegistry().putObject(location, result);
}
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Charset by CharsetMC.
the class CharsetStorageTanks method registerModels.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void registerModels(ModelRegistryEvent event) {
ModelResourceLocation locationNormal = new ModelResourceLocation("charset:fluidtank", "inventory");
ModelResourceLocation locationStained = new ModelResourceLocation("charset:fluidtank", "inventory_stained");
ModelResourceLocation locationCreative = new ModelResourceLocation("charset:fluidtank", "inventory_creative");
ModelLoader.setCustomMeshDefinition(tankItem, stack -> {
if (stack.hasTagCompound()) {
int c = stack.getTagCompound().getInteger("color");
if (c >= 0 && c < 16) {
return locationStained;
} else if (c == 16) {
return locationCreative;
} else {
return locationNormal;
}
} else {
return locationNormal;
}
});
ModelLoader.registerItemVariants(tankItem, locationNormal, locationStained, locationCreative);
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Charset by CharsetMC.
the class CharsetStorageBarrels method onPostBake.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPostBake(ModelBakeEvent event) {
event.getModelRegistry().putObject(new ModelResourceLocation("charset:barrel", "normal"), BarrelModel.INSTANCE);
event.getModelRegistry().putObject(new ModelResourceLocation("charset:barrel", "inventory"), BarrelModel.INSTANCE);
BarrelModel.INSTANCE.template = RenderUtils.getModel(new ResourceLocation("charset:block/barrel"));
}
Aggregations