Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ItemBucketBase extends UniversalBucket implements ItemMeshDefinition {
- protected String name;
- final protected ModelResourceLocation modelLocation;
- public ItemBucketBase(String name, CreativeTabs aTab, ModelResourceLocation modelLocation) {
- super(Fluid.BUCKET_VOLUME, new ItemStack(Items.BUCKET), false);
- this.name = name;
- this.modelLocation = modelLocation;
- SetNamesAndCreativeTabHelper.setNamesAndCreativeTab(this, name, aTab);
- //registration must be done last
- GameRegistry.register(this);
- FoundationsMod.proxy.registerCustomModel(this, this, this.modelLocation);
- OreDictionary.registerOre("ore" + Utilities.upperCaseFirstLetter(this.name), this);
- }
- @Override
- public ModelResourceLocation getModelLocation(ItemStack stack) {
- return modelLocation;
- }
- }
- // Where the proxy location just ensures that models aren't registered for server-side logic, and the client side proxy does the work of the ModelLoader.setBucketModelDefinition function:
- public class ClientProxy extends CommonProxy {
- public void registerCustomModel(Item item, ItemMeshDefinition meshDefinition, ModelResourceLocation modelLocation)
- {
- ModelLoader.setCustomMeshDefinition(item, meshDefinition);
- ModelBakery.registerItemVariants(item, modelLocation);
- }
- }
- // Then I've initialized it like so:
- //hardened stone buckets
- hardenedStoneBucket = new ItemBucketBase("hardenedStoneBucket", CreativeTabs.MATERIALS,
- new ModelResourceLocation(new ResourceLocation(FoundationsMod.MODID, "hardenedStoneBucket"), "inventory"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement