diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 3afa498e8..64df10b21 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -208,8 +208,6 @@ public enum AllBlocks { SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()), SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()), WINDOW_IN_A_BLOCK(new WindowInABlockBlock()), - - __GARDENS__(), COCOA_LOG(new CocoaLogBlock()), __PALETTES__(), @@ -343,7 +341,7 @@ public enum AllBlocks { private static void registerAsItem(IForgeRegistry registry, Block blockIn) { BlockItem blockItem = null; - net.minecraft.item.Item.Properties standardItemProperties = AllItems.standardItemProperties(); + Item.Properties standardItemProperties = AllItems.includeInItemGroup(); if (blockIn instanceof IHaveCustomBlockItem) blockItem = ((IHaveCustomBlockItem) blockIn).getCustomItem(standardItemProperties); diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index dda95060b..9c7504c81 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -1,24 +1,22 @@ package com.simibubi.create; +import java.util.function.Function; + +import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.item.IItemWithColorHandler; import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.IModule; import com.simibubi.create.modules.contraptions.GogglesItem; import com.simibubi.create.modules.contraptions.WrenchItem; -import com.simibubi.create.modules.contraptions.WrenchItemRenderer; import com.simibubi.create.modules.contraptions.relays.belt.BeltConnectorItem; import com.simibubi.create.modules.contraptions.relays.gearbox.VerticalGearboxItem; import com.simibubi.create.modules.curiosities.ChromaticCompoundCubeItem; import com.simibubi.create.modules.curiosities.RefinedRadianceItem; import com.simibubi.create.modules.curiosities.ShadowSteelItem; import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperItem; -import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperItemRenderer; import com.simibubi.create.modules.curiosities.deforester.DeforesterItem; -import com.simibubi.create.modules.curiosities.deforester.DeforesterItemRenderer; import com.simibubi.create.modules.curiosities.symmetry.SymmetryWandItem; -import com.simibubi.create.modules.curiosities.symmetry.client.SymmetryWandItemRenderer; import com.simibubi.create.modules.curiosities.tools.SandPaperItem; -import com.simibubi.create.modules.curiosities.tools.SandPaperItemRenderer; import com.simibubi.create.modules.gardens.TreeFertilizerItem; import com.simibubi.create.modules.logistics.item.filter.FilterItem; import com.simibubi.create.modules.schematics.item.SchematicAndQuillItem; @@ -41,71 +39,63 @@ import net.minecraftforge.registries.IForgeRegistry; @EventBusSubscriber(value = Dist.CLIENT, bus = Bus.MOD) public enum AllItems { - __MATERIALS__(), - COPPER_NUGGET(ingredient()), - ZINC_NUGGET(ingredient()), - BRASS_NUGGET(ingredient()), - IRON_SHEET(ingredient()), - GOLD_SHEET(ingredient()), - COPPER_SHEET(ingredient()), - BRASS_SHEET(ingredient()), - LAPIS_PLATE(ingredient()), + __MATERIALS__(module()), + COPPER_NUGGET, + ZINC_NUGGET, + BRASS_NUGGET, + IRON_SHEET, + GOLD_SHEET, + COPPER_SHEET, + BRASS_SHEET, + LAPIS_PLATE, - CRUSHED_IRON(ingredient()), - CRUSHED_GOLD(ingredient()), - CRUSHED_COPPER(ingredient()), - CRUSHED_ZINC(ingredient()), - CRUSHED_BRASS(ingredient()), + CRUSHED_IRON, + CRUSHED_GOLD, + CRUSHED_COPPER, + CRUSHED_ZINC, + CRUSHED_BRASS, - ANDESITE_ALLOY(ingredient()), - COPPER_INGOT(ingredient()), - ZINC_INGOT(ingredient()), - BRASS_INGOT(ingredient()), - SAND_PAPER( - new SandPaperItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SAND_PAPER)))), - RED_SAND_PAPER( - new SandPaperItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SAND_PAPER)))), - OBSIDIAN_DUST(ingredient()), - ROSE_QUARTZ(ingredient()), - POLISHED_ROSE_QUARTZ(ingredient()), - CHROMATIC_COMPOUND(new ChromaticCompoundCubeItem(standardItemProperties().rarity(Rarity.UNCOMMON))), - SHADOW_STEEL(new ShadowSteelItem(standardItemProperties().rarity(Rarity.UNCOMMON))), - REFINED_RADIANCE(new RefinedRadianceItem(standardItemProperties().rarity(Rarity.UNCOMMON))), - ELECTRON_TUBE(ingredient()), - INTEGRATED_CIRCUIT(ingredient()), + ANDESITE_ALLOY, + COPPER_INGOT, + ZINC_INGOT, + BRASS_INGOT, - __GARDENS__(), - TREE_FERTILIZER(new TreeFertilizerItem(standardItemProperties())), + SAND_PAPER(SandPaperItem::new), + RED_SAND_PAPER(SandPaperItem::new), + OBSIDIAN_DUST, + ROSE_QUARTZ, + POLISHED_ROSE_QUARTZ, + CHROMATIC_COMPOUND(ChromaticCompoundCubeItem::new, rarity(Rarity.UNCOMMON)), + SHADOW_STEEL(ShadowSteelItem::new, rarity(Rarity.UNCOMMON)), + REFINED_RADIANCE(RefinedRadianceItem::new, rarity(Rarity.UNCOMMON)), + ELECTRON_TUBE, + INTEGRATED_CIRCUIT, - __SCHEMATICS__(), - EMPTY_BLUEPRINT(new Item(standardItemProperties().maxStackSize(1))), - BLUEPRINT_AND_QUILL(new SchematicAndQuillItem(standardItemProperties().maxStackSize(1))), - BLUEPRINT(new SchematicItem(standardItemProperties())), + __SCHEMATICS__(module()), + EMPTY_BLUEPRINT(Item::new, stackSize(1)), + BLUEPRINT_AND_QUILL(SchematicAndQuillItem::new, stackSize(1)), + BLUEPRINT(SchematicItem::new), - __CONTRAPTIONS__(), - BELT_CONNECTOR(new BeltConnectorItem(standardItemProperties())), - VERTICAL_GEARBOX(new VerticalGearboxItem(new Properties())), - FLOUR(ingredient()), - DOUGH(ingredient()), - PROPELLER(ingredient()), - WHISK(ingredient()), - BRASS_HAND(ingredient()), - WRENCH(new WrenchItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.WRENCH))), true), - GOGGLES(new GogglesItem(standardItemProperties()), true), + __CONTRAPTIONS__(module()), + BELT_CONNECTOR(BeltConnectorItem::new), + VERTICAL_GEARBOX(VerticalGearboxItem::new), + FLOUR, + DOUGH, + PROPELLER, + WHISK, + BRASS_HAND, + WRENCH(WrenchItem::new), + GOGGLES(GogglesItem::new), - __LOGISTICS__(), - FILTER(new FilterItem(standardItemProperties()), true), - PROPERTY_FILTER(new FilterItem(standardItemProperties()), true), + __LOGISTICS__(module()), + FILTER(FilterItem::new), + PROPERTY_FILTER(FilterItem::new), - __CURIOSITIES__(), - PLACEMENT_HANDGUN( - new BlockzapperItem(new Properties().setTEISR(() -> () -> renderUsing(AllItemRenderers.BUILDER_GUN))), - true), - DEFORESTER( - new DeforesterItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.DEFORESTER))), - true), - SYMMETRY_WAND(new SymmetryWandItem( - standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SYMMETRY_WAND))), true), + __CURIOSITIES__(module()), + TREE_FERTILIZER(TreeFertilizerItem::new), + PLACEMENT_HANDGUN(BlockzapperItem::new), + DEFORESTER(DeforesterItem::new), + SYMMETRY_WAND(SymmetryWandItem::new), ; @@ -115,11 +105,12 @@ public enum AllItems { // Common - public Item item; public IModule module; - public boolean firstInCreativeTab; + private Function specialProperties; + private Function itemSupplier; + private Item item; - private AllItems() { + private AllItems(int moduleMarker) { CategoryTracker.currentModule = new IModule() { @Override public String getModuleName() { @@ -128,36 +119,51 @@ public enum AllItems { }; } - private AllItems(Item item) { - this(item, false); + private AllItems() { + this(Item::new); } - private AllItems(Item item, boolean firstInCreativeTab) { - this.item = item; - this.item.setRegistryName(Create.ID, Lang.asId(name())); + private AllItems(Function itemSupplier) { + this(itemSupplier, Function.identity()); + } + + private AllItems(Function itemSupplier, Function specialProperties) { + this.itemSupplier = itemSupplier; this.module = CategoryTracker.currentModule; - this.firstInCreativeTab = firstInCreativeTab; + this.specialProperties = specialProperties; } - public static Properties standardItemProperties() { + private static Function rarity(Rarity rarity) { + return p -> p.rarity(rarity); + } + + private static Function stackSize(int stackSize) { + return p -> p.maxStackSize(stackSize); + } + + private static Properties defaultProperties(AllItems item) { + return includeInItemGroup().setTEISR(() -> item::getRenderer); + } + + private static int module() { + return 0; + } + + public static Properties includeInItemGroup() { return new Properties().group(Create.creativeTab); } - private static Item ingredient() { - return ingredient(Rarity.COMMON); - } - - private static Item ingredient(Rarity rarity) { - return new Item(standardItemProperties().rarity(rarity)); - } - public static void register(RegistryEvent.Register event) { IForgeRegistry registry = event.getRegistry(); - for (AllItems item : values()) { - if (item.get() == null) + for (AllItems entry : values()) { + if (entry.itemSupplier == null) continue; - registry.register(item.get()); + + entry.item = entry.itemSupplier.apply(new Properties()); + entry.item = entry.itemSupplier.apply(entry.specialProperties.apply(defaultProperties(entry))); + entry.item.setRegistryName(Create.ID, Lang.asId(entry.name())); + registry.register(entry.item); } AllBlocks.registerItemBlocks(registry); @@ -177,8 +183,12 @@ public enum AllItems { // Client - private enum AllItemRenderers { - SYMMETRY_WAND, BUILDER_GUN, WRENCH, DEFORESTER, SAND_PAPER; + @OnlyIn(Dist.CLIENT) + public ItemStackTileEntityRenderer getRenderer() { + if (!(item instanceof IHaveCustomItemModel)) + return null; + IHaveCustomItemModel specialItem = (IHaveCustomItemModel) item; + return specialItem.createModel(null).getRenderer(); } @OnlyIn(Dist.CLIENT) @@ -191,23 +201,4 @@ public enum AllItems { } } - @OnlyIn(Dist.CLIENT) - public static ItemStackTileEntityRenderer renderUsing(AllItemRenderers renderer) { - switch (renderer) { - - case SYMMETRY_WAND: - return new SymmetryWandItemRenderer(); - case BUILDER_GUN: - return new BlockzapperItemRenderer(); - case WRENCH: - return new WrenchItemRenderer(); - case DEFORESTER: - return new DeforesterItemRenderer(); - case SAND_PAPER: - return new SandPaperItemRenderer(); - default: - return null; - } - } - } diff --git a/src/main/java/com/simibubi/create/CreateClient.java b/src/main/java/com/simibubi/create/CreateClient.java index 501eb6cfe..6c1f9dbff 100644 --- a/src/main/java/com/simibubi/create/CreateClient.java +++ b/src/main/java/com/simibubi/create/CreateClient.java @@ -9,16 +9,13 @@ import com.simibubi.create.foundation.block.IHaveColoredVertices; import com.simibubi.create.foundation.block.connected.CTModel; import com.simibubi.create.foundation.block.connected.IHaveConnectedTextures; import com.simibubi.create.foundation.block.render.ColoredVertexModel; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.block.render.SpriteShiftEntry; +import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.utility.SuperByteBufferCache; -import com.simibubi.create.modules.contraptions.WrenchModel; import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.modules.contraptions.components.contraptions.ContraptionRenderer; -import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperModel; -import com.simibubi.create.modules.curiosities.deforester.DeforesterModel; import com.simibubi.create.modules.curiosities.partialWindows.WindowInABlockModel; -import com.simibubi.create.modules.curiosities.symmetry.client.SymmetryWandModel; -import com.simibubi.create.modules.curiosities.tools.SandPaperItemRenderer.SandPaperModel; import com.simibubi.create.modules.schematics.ClientSchematicLoader; import com.simibubi.create.modules.schematics.client.SchematicAndQuillHandler; import com.simibubi.create.modules.schematics.client.SchematicHandler; @@ -106,7 +103,7 @@ public class CreateClient { public static void onTextureStitch(TextureStitchEvent.Pre event) { if (!event.getMap().getBasePath().equals("textures")) return; - + event.addSprite(new ResourceLocation(Create.ID, "block/belt_animated")); for (AllBlocks allBlocks : AllBlocks.values()) { Block block = allBlocks.get(); @@ -121,6 +118,7 @@ public class CreateClient { public static void onModelBake(ModelBakeEvent event) { Map modelRegistry = event.getModelRegistry(); + // Swap Models for CT Blocks and Blocks with colored Vertices for (AllBlocks allBlocks : AllBlocks.values()) { Block block = allBlocks.get(); if (block == null) @@ -135,22 +133,19 @@ public class CreateClient { } - swapModels(modelRegistry, getItemModelLocation(AllItems.SAND_PAPER), - t -> new SandPaperModel(t)); - swapModels(modelRegistry, getItemModelLocation(AllItems.RED_SAND_PAPER), - t -> new SandPaperModel(t)); - - swapModels(modelRegistry, getItemModelLocation(AllItems.SYMMETRY_WAND), - t -> new SymmetryWandModel(t).loadPartials(event)); - swapModels(modelRegistry, getItemModelLocation(AllItems.PLACEMENT_HANDGUN), - t -> new BlockzapperModel(t).loadPartials(event)); - swapModels(modelRegistry, getItemModelLocation(AllItems.WRENCH), t -> new WrenchModel(t).loadPartials(event)); - swapModels(modelRegistry, getItemModelLocation(AllItems.DEFORESTER), - t -> new DeforesterModel(t).loadPartials(event)); - swapModels(modelRegistry, - getBlockModelLocation(AllBlocks.WINDOW_IN_A_BLOCK, - BlockModelShapes - .getPropertyMapString(AllBlocks.WINDOW_IN_A_BLOCK.get().getDefaultState().getValues())), + // Swap Models for custom rendered item models + for (AllItems item : AllItems.values()) { + if (!(item.get() instanceof IHaveCustomItemModel)) + continue; + + IHaveCustomItemModel specialItem = (IHaveCustomItemModel) item.get(); + ModelResourceLocation location = new ModelResourceLocation(item.get().getRegistryName(), "inventory"); + CustomRenderedItemModel model = specialItem.createModel(modelRegistry.get(location)); + model.loadPartials(event); + modelRegistry.put(location, model); + } + + swapModels(modelRegistry, getAllBlockStateModelLocations(AllBlocks.WINDOW_IN_A_BLOCK), WindowInABlockModel::new); swapModels(modelRegistry, getBlockModelLocation(AllBlocks.WINDOW_IN_A_BLOCK, @@ -161,19 +156,20 @@ public class CreateClient { @OnlyIn(Dist.CLIENT) public static void onModelRegistry(ModelRegistryEvent event) { - for (String location : SymmetryWandModel.getCustomModelLocations()) - ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location)); - for (String location : BlockzapperModel.getCustomModelLocations()) - ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location)); - for (String location : WrenchModel.getCustomModelLocations()) - ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location)); - for (String location : DeforesterModel.getCustomModelLocations()) - ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location)); + // Register submodels for custom rendered item models + for (AllItems item : AllItems.values()) { + if (!(item.get() instanceof IHaveCustomItemModel)) + continue; + + IHaveCustomItemModel specialItem = (IHaveCustomItemModel) item.get(); + CustomRenderedItemModel model = specialItem.createModel(null); + model.getModelLocations().forEach(ModelLoader::addSpecialModel); + } } @OnlyIn(Dist.CLIENT) protected static ModelResourceLocation getItemModelLocation(AllItems item) { - return new ModelResourceLocation(item.item.getRegistryName(), "inventory"); + return new ModelResourceLocation(item.get().getRegistryName(), "inventory"); } @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/simibubi/create/CreateConfig.java b/src/main/java/com/simibubi/create/CreateConfig.java index 82e3bcd65..27220f3e0 100644 --- a/src/main/java/com/simibubi/create/CreateConfig.java +++ b/src/main/java/com/simibubi/create/CreateConfig.java @@ -35,7 +35,6 @@ public class CreateConfig { public BooleanValue enableContraptions; public BooleanValue enablePalettes; public BooleanValue enableLogistics; - public BooleanValue enableGardens; // Damage Control public BooleanValue freezeRotationPropagator; @@ -103,9 +102,6 @@ public class CreateConfig { name = "enableCuriosities"; enableCuriosities = builder.translation(basePath + name).define(name, true); - name = "enableGardens"; - enableGardens = builder.translation(basePath + name).define(name, true); - name = "enableLogistics"; enableLogistics = builder.translation(basePath + name).define(name, true); diff --git a/src/main/java/com/simibubi/create/CreateItemGroup.java b/src/main/java/com/simibubi/create/CreateItemGroup.java index 2b7f72285..d6cc68790 100644 --- a/src/main/java/com/simibubi/create/CreateItemGroup.java +++ b/src/main/java/com/simibubi/create/CreateItemGroup.java @@ -4,9 +4,14 @@ import com.simibubi.create.foundation.block.IHaveNoBlockItem; import com.simibubi.create.foundation.item.IAddedByOther; import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public final class CreateItemGroup extends ItemGroup { @@ -20,12 +25,14 @@ public final class CreateItemGroup extends ItemGroup { } @Override + @OnlyIn(Dist.CLIENT) public void fill(NonNullList items) { addItems(items, true); addBlocks(items); addItems(items, false); } + @OnlyIn(Dist.CLIENT) public void addBlocks(NonNullList items) { for (AllBlocks block : AllBlocks.values()) { Block def = block.get(); @@ -44,13 +51,17 @@ public final class CreateItemGroup extends ItemGroup { } } - public void addItems(NonNullList items, boolean prioritized) { + @OnlyIn(Dist.CLIENT) + public void addItems(NonNullList items, boolean specialItems) { + ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); + for (AllItems item : AllItems.values()) { if (item.get() == null) continue; if (!item.module.isEnabled()) continue; - if (item.firstInCreativeTab != prioritized) + IBakedModel model = itemRenderer.getModelWithOverrides(item.asStack()); + if ((model.isBuiltInRenderer() || model.isGui3d()) != specialItems) continue; if (item.get() instanceof IAddedByOther) continue; diff --git a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java index e1d90a6a5..4e5e8e513 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -94,7 +94,7 @@ public class CreateJEI implements IModPlugin { @Override public void registerItemSubtypes(ISubtypeRegistration registration) { - registration.useNbtForSubtypes(AllItems.PLACEMENT_HANDGUN.item); + registration.useNbtForSubtypes(AllItems.PLACEMENT_HANDGUN.get()); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/block/render/CustomRenderItemBakedModel.java b/src/main/java/com/simibubi/create/foundation/block/render/CustomRenderItemBakedModel.java deleted file mode 100644 index b4b878a9e..000000000 --- a/src/main/java/com/simibubi/create/foundation/block/render/CustomRenderItemBakedModel.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.simibubi.create.foundation.block.render; - -import com.simibubi.create.Create; - -import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.client.renderer.model.ModelRotation; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.ModelBakeEvent; - -public abstract class CustomRenderItemBakedModel extends WrappedBakedModel { - - public CustomRenderItemBakedModel(IBakedModel template) { - super(template); - } - - public abstract CustomRenderItemBakedModel loadPartials(ModelBakeEvent event); - - @Override - public boolean isBuiltInRenderer() { - return true; - } - - protected static IBakedModel loadCustomModel(ModelBakeEvent event, String name) { - return event.getModelLoader().func_217845_a(new ResourceLocation(Create.ID, "item/" + name), - ModelRotation.X0_Y0); - } - -} diff --git a/src/main/java/com/simibubi/create/foundation/block/render/CustomRenderedItemModel.java b/src/main/java/com/simibubi/create/foundation/block/render/CustomRenderedItemModel.java new file mode 100644 index 000000000..15f7fa801 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/block/render/CustomRenderedItemModel.java @@ -0,0 +1,83 @@ +package com.simibubi.create.foundation.block.render; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.vecmath.Matrix4f; + +import org.apache.commons.lang3.tuple.Pair; + +import com.simibubi.create.Create; + +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.model.ModelRotation; +import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.ModelBakeEvent; + +@SuppressWarnings("deprecation") +public abstract class CustomRenderedItemModel extends WrappedBakedModel { + + protected String basePath; + protected Map partials = new HashMap<>(); + protected TransformType currentPerspective; + protected ItemStackTileEntityRenderer renderer; + + public CustomRenderedItemModel(IBakedModel template, String basePath) { + super(template); + this.basePath = basePath; + this.renderer = createRenderer(); + } + + public final List getModelLocations() { + return partials.keySet().stream().map(this::getPartialModelLocation).collect(Collectors.toList()); + } + + public ItemStackTileEntityRenderer getRenderer() { + return renderer; + } + + public abstract ItemStackTileEntityRenderer createRenderer(); + + @Override + public boolean isBuiltInRenderer() { + return true; + } + + @Override + public Pair handlePerspective(TransformType cameraTransformType) { + currentPerspective = cameraTransformType; + return super.handlePerspective(cameraTransformType); + } + + protected void addPartials(String... partials) { + this.partials.clear(); + for (String name : partials) + this.partials.put(name, null); + } + + public void loadPartials(ModelBakeEvent event) { + for (String name : partials.keySet()) + partials.put(name, loadModel(event, name)); + } + + private IBakedModel loadModel(ModelBakeEvent event, String name) { + return event.getModelLoader().func_217845_a(getPartialModelLocation(name), ModelRotation.X0_Y0); + } + + private ResourceLocation getPartialModelLocation(String name) { + return new ResourceLocation(Create.ID, "item/" + basePath + "/" + name); + } + + public TransformType getCurrentPerspective() { + return currentPerspective; + } + + public IBakedModel getPartial(String name) { + return partials.get(name); + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/item/IHaveCustomItemModel.java b/src/main/java/com/simibubi/create/foundation/item/IHaveCustomItemModel.java new file mode 100644 index 000000000..8a08b5295 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/item/IHaveCustomItemModel.java @@ -0,0 +1,16 @@ +package com.simibubi.create.foundation.item; + +import javax.annotation.Nullable; + +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; + +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +public interface IHaveCustomItemModel { + + @OnlyIn(value = Dist.CLIENT) + public CustomRenderedItemModel createModel(@Nullable IBakedModel original); + +} diff --git a/src/main/java/com/simibubi/create/modules/IModule.java b/src/main/java/com/simibubi/create/modules/IModule.java index f0ea64542..1918f0a2e 100644 --- a/src/main/java/com/simibubi/create/modules/IModule.java +++ b/src/main/java/com/simibubi/create/modules/IModule.java @@ -28,8 +28,6 @@ public interface IModule { return conf.enableLogistics.get(); case "schematics": return conf.enableSchematics.get(); - case "gardens": - return conf.enableGardens.get(); default: return false; } @@ -45,15 +43,13 @@ public interface IModule { case "contraptions": return Palette.Red; case "palettes": - return Palette.Yellow; + return Palette.Green; case "curiosities": return Palette.Purple; case "logistics": return Palette.Yellow; case "schematics": return Palette.Blue; - case "gardens": - return Palette.Green; default: return Palette.Purple; } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java b/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java index bfc9c3af5..a3b65a548 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java @@ -1,7 +1,11 @@ package com.simibubi.create.modules.contraptions; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; +import com.simibubi.create.foundation.item.IHaveCustomItemModel; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -10,8 +14,10 @@ import net.minecraft.util.ActionResultType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -public class WrenchItem extends Item { +public class WrenchItem extends Item implements IHaveCustomItemModel { public WrenchItem(Properties properties) { super(properties); @@ -45,4 +51,10 @@ public class WrenchItem extends Item { return actor.onWrenched(state, context); } + @Override + @OnlyIn(Dist.CLIENT) + public CustomRenderedItemModel createModel(IBakedModel original) { + return new WrenchModel(original); + } + } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/WrenchItemRenderer.java b/src/main/java/com/simibubi/create/modules/contraptions/WrenchItemRenderer.java index 42144b3ff..8b6cdbbe3 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/WrenchItemRenderer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/WrenchItemRenderer.java @@ -29,7 +29,7 @@ public class WrenchItemRenderer extends ItemStackTileEntityRenderer { GlStateManager.rotated(angle, 0, 1, 0); GlStateManager.translatef(xOffset, 0, zOffset); - itemRenderer.renderItem(stack, mainModel.gear); + itemRenderer.renderItem(stack, mainModel.getPartial("gear")); GlStateManager.popMatrix(); } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/WrenchModel.java b/src/main/java/com/simibubi/create/modules/contraptions/WrenchModel.java index ca63700b2..5d9254643 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/WrenchModel.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/WrenchModel.java @@ -1,29 +1,20 @@ package com.simibubi.create.modules.contraptions; -import java.util.Arrays; -import java.util.List; - -import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; -public class WrenchModel extends CustomRenderItemBakedModel { +public class WrenchModel extends CustomRenderedItemModel { - public IBakedModel gear; - public WrenchModel(IBakedModel template) { - super(template); + super(template, "wrench"); + addPartials("gear"); } - public static List getCustomModelLocations() { - return Arrays.asList("wrench/gear"); - } - @Override - public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) { - this.gear = loadCustomModel(event, "wrench/gear"); - return this; + public ItemStackTileEntityRenderer createRenderer() { + return new WrenchItemRenderer(); } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/gearbox/VerticalGearboxItem.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/gearbox/VerticalGearboxItem.java index 5b3040d5d..67b24f87f 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/gearbox/VerticalGearboxItem.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/gearbox/VerticalGearboxItem.java @@ -1,6 +1,7 @@ package com.simibubi.create.modules.contraptions.relays.gearbox; import com.simibubi.create.AllBlocks; +import com.simibubi.create.foundation.item.IAddedByOther; import com.simibubi.create.modules.contraptions.base.IRotate; import net.minecraft.block.BlockState; @@ -13,7 +14,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class VerticalGearboxItem extends BlockItem { +public class VerticalGearboxItem extends BlockItem implements IAddedByOther { public VerticalGearboxItem(Properties builder) { super(AllBlocks.GEARBOX.get(), builder); diff --git a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItem.java b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItem.java index 911b88196..8e4be547d 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItem.java @@ -11,7 +11,9 @@ import com.google.common.base.Predicates; import com.simibubi.create.AllItems; import com.simibubi.create.AllPackets; import com.simibubi.create.Create; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.item.ItemDescription; import com.simibubi.create.foundation.item.ItemDescription.Palette; import com.simibubi.create.foundation.utility.BlockHelper; @@ -23,6 +25,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; @@ -67,7 +70,7 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.PacketDistributor; -public class BlockzapperItem extends Item { +public class BlockzapperItem extends Item implements IHaveCustomItemModel { public static enum ComponentTier { None(TextFormatting.DARK_GRAY), Brass(TextFormatting.GOLD), Chromatic(TextFormatting.LIGHT_PURPLE), @@ -589,4 +592,10 @@ public class BlockzapperItem extends Item { stack.getOrCreateTag().putString(component.name(), NBTHelper.writeEnum(tier)); } + @Override + @OnlyIn(value = Dist.CLIENT) + public CustomRenderedItemModel createModel(IBakedModel original) { + return new BlockzapperModel(original); + } + } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItemRenderer.java b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItemRenderer.java index cb28a82dd..50b7bf488 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItemRenderer.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperItemRenderer.java @@ -18,12 +18,14 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTUtil; import net.minecraft.util.HandSide; import net.minecraft.util.math.MathHelper; +@SuppressWarnings("deprecation") public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer { @Override @@ -40,13 +42,14 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer { GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, Math.min(lastCoordx + 60, 240), Math.min(lastCoordy + 120, 240)); itemRenderer.renderItem(stack, mainModel.getBakedModel()); - renderComponent(stack, Body, itemRenderer, mainModel.body, mainModel.goldBody, mainModel.chorusBody); - renderComponent(stack, Amplifier, itemRenderer, null, mainModel.goldAmp, mainModel.chorusAmp); - renderComponent(stack, Retriever, itemRenderer, null, mainModel.goldRetriever, mainModel.chorusRetriever); - renderComponent(stack, Scope, itemRenderer, null, mainModel.goldScope, mainModel.chorusScope); + renderComponent(stack, mainModel, Body, itemRenderer); + renderComponent(stack, mainModel, Amplifier, itemRenderer); + renderComponent(stack, mainModel, Retriever, itemRenderer); + renderComponent(stack, mainModel, Scope, itemRenderer); // Block indicator - if (mainModel.showBlock && stack.hasTag() && stack.getTag().contains("BlockUsed")) + if (mainModel.getCurrentPerspective() == TransformType.GUI && stack.hasTag() + && stack.getTag().contains("BlockUsed")) renderBlockUsed(stack, itemRenderer); ClientPlayerEntity player = Minecraft.getInstance().player; @@ -66,9 +69,9 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer { multiplier = animation; } GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, multiplier * 240, 120); - itemRenderer.renderItem(stack, mainModel.core); + itemRenderer.renderItem(stack, mainModel.getPartial("core")); if (BlockzapperItem.getTier(Amplifier, stack) != ComponentTier.None) - itemRenderer.renderItem(stack, mainModel.ampCore); + itemRenderer.renderItem(stack, mainModel.getPartial("amplifier_core")); GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy); GlStateManager.enableLighting(); @@ -82,7 +85,7 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer { GlStateManager.translatef(0, offset, 0); GlStateManager.rotatef(angle, 0, 0, 1); GlStateManager.translatef(0, -offset, 0); - renderComponent(stack, Accelerator, itemRenderer, mainModel.acc, mainModel.goldAcc, mainModel.chorusAcc); + renderComponent(stack, mainModel, Accelerator, itemRenderer); GlStateManager.popMatrix(); } @@ -98,23 +101,17 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer { if (state.getBlock() instanceof FourWayBlock) modelForState = Minecraft.getInstance().getItemRenderer() .getModelWithOverrides(new ItemStack(state.getBlock())); - + itemRenderer.renderItem(new ItemStack(state.getBlock()), modelForState); GlStateManager.popMatrix(); } - public void renderComponent(ItemStack stack, Components component, ItemRenderer itemRenderer, IBakedModel none, - IBakedModel gold, IBakedModel chorus) { + public void renderComponent(ItemStack stack, BlockzapperModel model, Components component, + ItemRenderer itemRenderer) { ComponentTier tier = BlockzapperItem.getTier(component, stack); - - IBakedModel model = tier == ComponentTier.Chromatic ? chorus : gold; - if (tier == ComponentTier.None) { - if (none == null) - return; - model = none; - } - - itemRenderer.renderItem(stack, model); + IBakedModel partial = model.getComponentPartial(tier, component); + if (partial != null) + itemRenderer.renderItem(stack, partial); } } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperModel.java b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperModel.java index fec0e35d7..a6a724140 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperModel.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperModel.java @@ -1,79 +1,32 @@ package com.simibubi.create.modules.curiosities.blockzapper; -import java.util.Arrays; -import java.util.List; +import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; - -import org.apache.commons.lang3.tuple.Pair; - -import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; +import com.simibubi.create.foundation.utility.Lang; +import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperItem.ComponentTier; import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; -import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; -@SuppressWarnings("deprecation") -public class BlockzapperModel extends CustomRenderItemBakedModel { - - public boolean showBlock; - - public IBakedModel core; - public IBakedModel body; - public IBakedModel ampCore; - public IBakedModel acc; - - public IBakedModel goldBody; - public IBakedModel goldScope; - public IBakedModel goldAmp; - public IBakedModel goldRetriever; - public IBakedModel goldAcc; - - public IBakedModel chorusBody; - public IBakedModel chorusScope; - public IBakedModel chorusAmp; - public IBakedModel chorusRetriever; - public IBakedModel chorusAcc; +public class BlockzapperModel extends CustomRenderedItemModel { public BlockzapperModel(IBakedModel template) { - super(template); - } - - public static List getCustomModelLocations() { - String p = "blockzapper/"; - return Arrays.asList(p + "core", p + "body", p + "amplifier_core", p + "accelerator", p + "gold_body", - p + "gold_scope", p + "gold_amplifier", p + "gold_retriever", p + "gold_accelerator", p + "chorus_body", - p + "chorus_amplifier", p + "chorus_retriever", p + "chorus_accelerator"); + super(template, "blockzapper"); + addPartials("core", "body", "amplifier_core", "accelerator", "gold_body", "gold_scope", "gold_amplifier", + "gold_retriever", "gold_accelerator", "chorus_body", "chorus_amplifier", "chorus_retriever", + "chorus_accelerator"); } @Override - public Pair handlePerspective(TransformType cameraTransformType) { - showBlock = cameraTransformType == TransformType.GUI; - return super.handlePerspective(cameraTransformType); + public ItemStackTileEntityRenderer createRenderer() { + return new BlockzapperItemRenderer(); } - @Override - public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) { - String p = "blockzapper/"; - - this.core = loadCustomModel(event, p + "core"); - this.body = loadCustomModel(event, p + "body"); - this.ampCore = loadCustomModel(event, p + "amplifier_core"); - this.acc = loadCustomModel(event, p + "accelerator"); - - this.goldBody = loadCustomModel(event, p + "gold_body"); - this.goldScope = loadCustomModel(event, p + "gold_scope"); - this.goldAmp = loadCustomModel(event, p + "gold_amplifier"); - this.goldRetriever = loadCustomModel(event, p + "gold_retriever"); - this.goldAcc = loadCustomModel(event, p + "gold_accelerator"); - - this.chorusBody = loadCustomModel(event, p + "chorus_body"); - this.chorusScope = loadCustomModel(event, p + "chorus_scope"); - this.chorusAmp = loadCustomModel(event, p + "chorus_amplifier"); - this.chorusRetriever = loadCustomModel(event, p + "chorus_retriever"); - this.chorusAcc = loadCustomModel(event, p + "chorus_accelerator"); - - return this; + @Nullable + IBakedModel getComponentPartial(BlockzapperItem.ComponentTier tier, BlockzapperItem.Components component) { + String prefix = tier == ComponentTier.Chromatic ? "chorus_" : tier == ComponentTier.Brass ? "gold_" : ""; + return getPartial(prefix + Lang.asId(component.name())); } } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItem.java b/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItem.java index a84c8f6da..aa9c3eb4c 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItem.java @@ -1,6 +1,8 @@ package com.simibubi.create.modules.curiosities.deforester; import com.simibubi.create.AllItems; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; +import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.TreeCutter; import com.simibubi.create.foundation.utility.TreeCutter.Tree; @@ -8,6 +10,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.modules.curiosities.tools.AllToolTiers; import net.minecraft.block.BlockState; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.AxeItem; @@ -18,13 +21,15 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.IWorld; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; @EventBusSubscriber(bus = Bus.FORGE) -public class DeforesterItem extends AxeItem { +public class DeforesterItem extends AxeItem implements IHaveCustomItemModel { public DeforesterItem(Properties builder) { super(AllToolTiers.RADIANT, 10.0F, -3.1F, builder); @@ -75,4 +80,10 @@ public class DeforesterItem extends AxeItem { world.addEntity(entity); } + @Override + @OnlyIn(Dist.CLIENT) + public CustomRenderedItemModel createModel(IBakedModel original) { + return new DeforesterModel(original); + } + } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItemRenderer.java b/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItemRenderer.java index 0dd717b89..46454947c 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItemRenderer.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterItemRenderer.java @@ -26,8 +26,8 @@ public class DeforesterItemRenderer extends ItemStackTileEntityRenderer { GlStateManager.disableLighting(); GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 120); - itemRenderer.renderItem(stack, mainModel.light); - itemRenderer.renderItem(stack, mainModel.blade); + itemRenderer.renderItem(stack, mainModel.getPartial("light")); + itemRenderer.renderItem(stack, mainModel.getPartial("blade")); GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy); GlStateManager.enableLighting(); @@ -38,7 +38,7 @@ public class DeforesterItemRenderer extends ItemStackTileEntityRenderer { GlStateManager.rotated(angle, 0, 1, 0); GlStateManager.translatef(xOffset, 0, zOffset); - itemRenderer.renderItem(stack, mainModel.gear); + itemRenderer.renderItem(stack, mainModel.getPartial("gear")); GlStateManager.popMatrix(); diff --git a/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterModel.java b/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterModel.java index e774cda73..57c6c2bc1 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterModel.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/deforester/DeforesterModel.java @@ -1,33 +1,20 @@ package com.simibubi.create.modules.curiosities.deforester; -import java.util.Arrays; -import java.util.List; - -import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; -public class DeforesterModel extends CustomRenderItemBakedModel { +public class DeforesterModel extends CustomRenderedItemModel { - public IBakedModel gear; - public IBakedModel light; - public IBakedModel blade; - public DeforesterModel(IBakedModel template) { - super(template); + super(template, "deforester"); + addPartials("gear", "light", "blade"); } - public static List getCustomModelLocations() { - return Arrays.asList("deforester/gear", "deforester/light", "deforester/blade"); - } - @Override - public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) { - this.gear = loadCustomModel(event, "deforester/gear"); - this.light = loadCustomModel(event, "deforester/light"); - this.blade = loadCustomModel(event, "deforester/blade"); - return this; + public ItemStackTileEntityRenderer createRenderer() { + return new DeforesterItemRenderer(); } } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/symmetry/SymmetryWandItem.java b/src/main/java/com/simibubi/create/modules/curiosities/symmetry/SymmetryWandItem.java index 4b63adbc1..4cd9864e0 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/symmetry/SymmetryWandItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/symmetry/SymmetryWandItem.java @@ -8,8 +8,11 @@ import java.util.List; import java.util.Map; import com.simibubi.create.AllPackets; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.utility.BlockHelper; +import com.simibubi.create.modules.curiosities.symmetry.client.SymmetryWandModel; import com.simibubi.create.modules.curiosities.symmetry.mirror.CrossPlaneMirror; import com.simibubi.create.modules.curiosities.symmetry.mirror.EmptyMirror; import com.simibubi.create.modules.curiosities.symmetry.mirror.PlaneMirror; @@ -18,6 +21,7 @@ import com.simibubi.create.modules.curiosities.symmetry.mirror.SymmetryMirror; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; @@ -39,7 +43,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.PacketDistributor; -public class SymmetryWandItem extends Item { +public class SymmetryWandItem extends Item implements IHaveCustomItemModel { public static final String SYMMETRY = "symmetry"; private static final String ENABLE = "enable"; @@ -268,4 +272,10 @@ public class SymmetryWandItem extends Item { new SymmetryEffectPacket(to, targets)); } + @Override + @OnlyIn(Dist.CLIENT) + public CustomRenderedItemModel createModel(IBakedModel original) { + return new SymmetryWandModel(original); + } + } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandItemRenderer.java b/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandItemRenderer.java index f12500b55..64f5fb888 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandItemRenderer.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandItemRenderer.java @@ -31,13 +31,13 @@ public class SymmetryWandItemRenderer extends ItemStackTileEntityRenderer { lastCoordy = GLX.lastBrightnessY; GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 240); - itemRenderer.renderItem(stack, mainModel.core); + itemRenderer.renderItem(stack, mainModel.getPartial("core")); float floating = MathHelper.sin(worldTime) * .05f; GlStateManager.translated(0, floating, 0); float angle = worldTime * -10 % 360; GlStateManager.rotated(angle, 0, 1, 0); - itemRenderer.renderItem(stack, mainModel.bits); + itemRenderer.renderItem(stack, mainModel.getPartial("bits")); GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy); GlStateManager.enableLighting(); diff --git a/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandModel.java b/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandModel.java index ab8b5d9ad..75c3c6f49 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandModel.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/symmetry/client/SymmetryWandModel.java @@ -1,31 +1,20 @@ package com.simibubi.create.modules.curiosities.symmetry.client; -import java.util.Arrays; -import java.util.List; - -import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; -public class SymmetryWandModel extends CustomRenderItemBakedModel { +public class SymmetryWandModel extends CustomRenderedItemModel { - public IBakedModel core; - public IBakedModel bits; - public SymmetryWandModel(IBakedModel template) { - super(template); + super(template, "symmetry_wand"); + addPartials("bits", "core"); } - public static List getCustomModelLocations() { - return Arrays.asList("symmetry_wand_core", "symmetry_wand_bits"); + @Override + public ItemStackTileEntityRenderer createRenderer() { + return new SymmetryWandItemRenderer(); } - @Override - public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) { - this.core = loadCustomModel(event, "symmetry_wand_core"); - this.bits = loadCustomModel(event, "symmetry_wand_bits"); - return this; - } - } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/AllToolTiers.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/AllToolTiers.java index 0188f27db..e0189ab3b 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/AllToolTiers.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/AllToolTiers.java @@ -16,15 +16,15 @@ public enum AllToolTiers implements IItemTier { }), ROSE_QUARTZ(3, 1644, 7.0F, 2.0F, 24, () -> { - return Ingredient.fromItems(AllItems.POLISHED_ROSE_QUARTZ.item); + return Ingredient.fromItems(AllItems.POLISHED_ROSE_QUARTZ.get()); }), SHADOW_STEEL(4, 2303, 16.0F, 3.5F, 10, () -> { - return Ingredient.fromItems(AllItems.SHADOW_STEEL.item); + return Ingredient.fromItems(AllItems.SHADOW_STEEL.get()); }), RADIANT(4, 1024, 16.0F, 3.5F, 10, () -> { - return Ingredient.fromItems(AllItems.REFINED_RADIANCE.item); + return Ingredient.fromItems(AllItems.REFINED_RADIANCE.get()); }), ; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java index 71d872ade..de251d29a 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java @@ -1,8 +1,12 @@ package com.simibubi.create.modules.curiosities.tools; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; +import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.modules.contraptions.components.deployer.DeployerFakePlayer; +import com.simibubi.create.modules.curiosities.tools.SandPaperItemRenderer.SandPaperModel; +import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.LivingEntity; @@ -24,8 +28,10 @@ import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; -public class SandPaperItem extends Item { +public class SandPaperItem extends Item implements IHaveCustomItemModel { public SandPaperItem(Properties properties) { super(properties); @@ -177,4 +183,10 @@ public class SandPaperItem extends Item { return 8; } + @Override + @OnlyIn(Dist.CLIENT) + public CustomRenderedItemModel createModel(IBakedModel original) { + return new SandPaperModel(original); + } + } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItemRenderer.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItemRenderer.java index 7fec0f6a4..3556725a3 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItemRenderer.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItemRenderer.java @@ -1,11 +1,7 @@ package com.simibubi.create.modules.curiosities.tools; -import javax.vecmath.Matrix4f; - -import org.apache.commons.lang3.tuple.Pair; - import com.mojang.blaze3d.platform.GlStateManager; -import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel; +import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.Minecraft; @@ -17,7 +13,6 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.math.MathHelper; -import net.minecraftforge.client.event.ModelBakeEvent; @SuppressWarnings("deprecation") public class SandPaperItemRenderer extends ItemStackTileEntityRenderer { @@ -27,10 +22,11 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer { ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); ClientPlayerEntity player = Minecraft.getInstance().player; SandPaperModel mainModel = (SandPaperModel) itemRenderer.getModelWithOverrides(stack); + TransformType perspective = mainModel.getCurrentPerspective(); float partialTicks = Minecraft.getInstance().getRenderPartialTicks(); - boolean leftHand = mainModel.transformType == TransformType.FIRST_PERSON_LEFT_HAND; - boolean firstPerson = leftHand || mainModel.transformType == TransformType.FIRST_PERSON_RIGHT_HAND; + boolean leftHand = perspective == TransformType.FIRST_PERSON_LEFT_HAND; + boolean firstPerson = leftHand || perspective == TransformType.FIRST_PERSON_RIGHT_HAND; GlStateManager.pushMatrix(); GlStateManager.translatef(.5f, .5f, .5f); @@ -41,7 +37,7 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer { if (tag.contains("Polishing")) { GlStateManager.pushMatrix(); - if (mainModel.transformType == TransformType.GUI) { + if (perspective == TransformType.GUI) { GlStateManager.translatef(0.0F, .2f, 1.0F); GlStateManager.scalef(.75f, .75f, .75f); } else { @@ -55,7 +51,7 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer { if (time / (float) stack.getUseDuration() < 0.8F) { float bobbing = -MathHelper.abs(MathHelper.cos(time / 4.0F * (float) Math.PI) * 0.1F); - if (mainModel.transformType == TransformType.GUI) + if (perspective == TransformType.GUI) GlStateManager.translatef(bobbing, bobbing, 0.0F); else GlStateManager.translatef(0.0f, bobbing, 0.0F); @@ -83,23 +79,15 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer { GlStateManager.popMatrix(); } - public static class SandPaperModel extends CustomRenderItemBakedModel { - - TransformType transformType; + public static class SandPaperModel extends CustomRenderedItemModel { public SandPaperModel(IBakedModel template) { - super(template); + super(template, ""); } @Override - public Pair handlePerspective(TransformType cameraTransformType) { - transformType = cameraTransformType; - return super.handlePerspective(cameraTransformType); - } - - @Override - public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) { - return this; + public ItemStackTileEntityRenderer createRenderer() { + return new SandPaperItemRenderer(); } } diff --git a/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java b/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java index 4cdb611de..32a9309a5 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java +++ b/src/main/java/com/simibubi/create/modules/schematics/item/SchematicItem.java @@ -47,7 +47,7 @@ public class SchematicItem extends Item { } public static ItemStack create(String schematic, String owner) { - ItemStack blueprint = new ItemStack(AllItems.BLUEPRINT.item); + ItemStack blueprint = AllItems.BLUEPRINT.asStack(); CompoundNBT tag = new CompoundNBT(); tag.putBoolean("Deployed", false); diff --git a/src/main/resources/assets/create/models/item/blockzapper/chorus_accelerator.json b/src/main/resources/assets/create/models/item/blockzapper/chorus_accelerator.json index 0172df56b..49b4bcc7f 100644 --- a/src/main/resources/assets/create/models/item/blockzapper/chorus_accelerator.json +++ b/src/main/resources/assets/create/models/item/blockzapper/chorus_accelerator.json @@ -2,7 +2,7 @@ "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", "parent": "create:item/placement_handgun", "textures": { - "cog": "minecraft:block/purpur_block" + "cog": "minecraft:block/mycelium_top" }, "elements": [ { diff --git a/src/main/resources/assets/create/models/item/blockzapper/gold_accelerator.json b/src/main/resources/assets/create/models/item/blockzapper/gold_accelerator.json index e2149ed31..173324752 100644 --- a/src/main/resources/assets/create/models/item/blockzapper/gold_accelerator.json +++ b/src/main/resources/assets/create/models/item/blockzapper/gold_accelerator.json @@ -2,7 +2,7 @@ "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", "parent": "create:item/placement_handgun", "textures": { - "cog": "minecraft:block/yellow_concrete_powder" + "cog": "create:block/brass_block" }, "elements": [ { diff --git a/src/main/resources/assets/create/models/item/symmetry_wand.json b/src/main/resources/assets/create/models/item/symmetry_wand.json index ae65a49f4..530067fc5 100644 --- a/src/main/resources/assets/create/models/item/symmetry_wand.json +++ b/src/main/resources/assets/create/models/item/symmetry_wand.json @@ -1,156 +1,126 @@ { - "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", - "ambientocclusion": true, + "credit": "Made with Blockbench", + "textures": { + "0": "block/obsidian", + "2": "block/dark_oak_log", + "6": "create:block/brass_block", + "7": "create:block/andesite_casing", + "particle": "create:block/brass_block" + }, + "elements": [ + { + "name": "Grip Core", + "from": [6.5, -5, 6.5], + "to": [9.5, 6, 9.5], + "faces": { + "north": {"uv": [5, 1, 8, 12], "texture": "#0"}, + "east": {"uv": [2, 3, 5, 14], "texture": "#0"}, + "south": {"uv": [10, 1, 13, 12], "texture": "#0"}, + "west": {"uv": [7, 1, 10, 12], "texture": "#0"}, + "up": {"uv": [0, 0, 3, 3], "texture": "#0"}, + "down": {"uv": [5, 6, 8, 9], "texture": "#0"} + } + }, + { + "name": "Rod Bottom Core", + "from": [6.5, 7, 6.5], + "to": [9.5, 17, 9.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [5, 6, 8, 16], "texture": "#6"}, + "east": {"uv": [2, 6, 5, 16], "texture": "#6"}, + "south": {"uv": [11, 6, 14, 16], "texture": "#6"}, + "west": {"uv": [8, 6, 11, 16], "texture": "#6"}, + "up": {"uv": [12, 1, 15, 4], "texture": "#6"}, + "down": {"uv": [8, 10, 11, 13], "texture": "#6"} + } + }, + { + "name": "Grip Cap", + "from": [6, 6, 6], + "to": [10, 7, 10], + "faces": { + "north": {"uv": [2, 0, 6, 1], "texture": "#2"}, + "east": {"uv": [0, 0, 4, 1], "texture": "#2"}, + "south": {"uv": [0, 0, 4, 1], "texture": "#2"}, + "west": {"uv": [0, 1, 4, 2], "texture": "#2"}, + "up": {"uv": [10, 15, 14, 11], "texture": "#2"}, + "down": {"uv": [5, 3, 9, 7], "texture": "#2"} + } + }, + { + "name": "Rod Top Core", + "from": [6.5, 27, 6.5], + "to": [9.5, 30, 9.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [8, 1, 11, 4], "texture": "#6"}, + "east": {"uv": [7, 1, 10, 4], "texture": "#6"}, + "south": {"uv": [5, 1, 8, 4], "texture": "#6"}, + "west": {"uv": [3, 1, 6, 4], "texture": "#6"}, + "up": {"uv": [12, 1, 15, 4], "texture": "#6"}, + "down": {"uv": [12, 1, 15, 4], "texture": "#6"} + } + }, + { + "name": "Cap", + "from": [6, 30, 6], + "to": [10, 31, 10], + "faces": { + "north": {"uv": [0, 0, 4, 1], "texture": "#2"}, + "east": {"uv": [0, 0, 4, 1], "texture": "#2"}, + "south": {"uv": [0, 0, 4, 1], "texture": "#2"}, + "west": {"uv": [0, 0, 4, 1], "texture": "#2"}, + "up": {"uv": [7, 10, 11, 14], "texture": "#2"}, + "down": {"uv": [7, 10, 11, 14], "texture": "#2"} + } + }, + { + "name": "Grip Deco", + "from": [6.3, 4, 6.3], + "to": [9.7, 5, 9.7], + "faces": { + "north": {"uv": [4, 1, 7, 2], "texture": "#7"}, + "east": {"uv": [4, 1, 7, 2], "texture": "#7"}, + "south": {"uv": [4, 1, 7, 2], "texture": "#7"}, + "west": {"uv": [4, 1, 7, 2], "texture": "#7"} + } + }, + { + "name": "Grip Deco", + "from": [6.3, -4, 6.3], + "to": [9.7, -3, 9.7], + "faces": { + "north": {"uv": [4, 1, 7, 2], "texture": "#7"}, + "east": {"uv": [4, 1, 7, 2], "texture": "#7"}, + "south": {"uv": [4, 1, 7, 2], "texture": "#7"}, + "west": {"uv": [4, 1, 7, 2], "texture": "#7"} + } + } + ], "display": { - "firstperson_righthand": { - "rotation": [ 15, 0, 0 ], - "translation": [ 0, 0, -2], - "scale":[ 0.6, 0.6, 0.6 ] - }, "thirdperson_righthand": { - "rotation": [ 15, 0, 0 ], - "translation": [ -1, 1, 1], - "scale":[ 0.5, 0.5, 0.5 ] - }, - "gui": { - "rotation": [ 42, 135, 32 ], - "translation": [ -1.7, -1.7, 3], - "scale":[ 0.8, 0.8, 0.8 ] - }, + "rotation": [15, 0, 0], + "translation": [-1, 1, 1], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [15, 0, 0], + "translation": [0, 0, -2], + "scale": [0.6, 0.6, 0.6] + }, "ground": { - "rotation": [ 0, 0, 0 ], - "translation": [ 0, 4.2, 0], - "scale":[ 0.4, 0.4, 0.4 ] - }, - "fixed": { - "rotation": [ 0, 90, 0 ], - "translation": [ 0, -5, 0 ], - "scale": [ 1, 1, 1 ] - } - }, - "textures": { - "0": "block/obsidian", - "1": "block/packed_ice", - "2": "block/dark_oak_log", - "3": "block/white_stained_glass", - "4": "block/light_blue_stained_glass", - "5": "block/white_concrete_powder" - }, - "elements": [ - { - "name": "Grip Core", - "from": [ 6.5, -5.0, 6.5 ], - "to": [ 9.5, 6.0, 9.5 ], - "faces": { - "north": { "texture": "#0", "uv": [ 5.0, 1.0, 8.0, 12.0 ] }, - "east": { "texture": "#0", "uv": [ 2.0, 3.0, 5.0, 14.0 ] }, - "south": { "texture": "#0", "uv": [ 10.0, 1.0, 13.0, 12.0 ] }, - "west": { "texture": "#0", "uv": [ 7.0, 1.0, 10.0, 12.0 ] }, - "up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] }, - "down": { "texture": "#0", "uv": [ 5.0, 6.0, 8.0, 9.0 ] } - } - }, - { - "name": "Rod Bottom Core", - "from": [ 6.5, 8.0, 6.5 ], - "to": [ 9.5, 17.0, 9.5 ], - "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 }, - "faces": { - "north": { "texture": "#1", "uv": [ 5.0, 7.0, 8.0, 16.0 ] }, - "east": { "texture": "#1", "uv": [ 7.0, 7.0, 10.0, 16.0 ] }, - "south": { "texture": "#1", "uv": [ 1.0, 7.0, 4.0, 16.0 ] }, - "west": { "texture": "#1", "uv": [ 3.0, 7.0, 6.0, 16.0 ] }, - "up": { "texture": "#1", "uv": [ 12.0, 1.0, 15.0, 4.0 ] }, - "down": { "texture": "#2", "uv": [ 8.0, 10.0, 11.0, 13.0 ] } - } - }, - { - "name": "Grip Cap", - "from": [ 6.0, 6.0, 6.0 ], - "to": [ 10.0, 7.0, 10.0 ], - "faces": { - "north": { "texture": "#2", "uv": [ 2.0, 0.0, 6.0, 1.0 ] }, - "east": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] }, - "south": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] }, - "west": { "texture": "#2", "uv": [ 0.0, 1.0, 4.0, 2.0 ] }, - "up": { "texture": "#2", "uv": [ 10.0, 15.0, 14.0, 11.0 ] }, - "down": { "texture": "#2", "uv": [ 5.0, 3.0, 9.0, 7.0 ] } - } - }, - { - "name": "Rod Top Core", - "from": [ 6.5, 27.0, 6.5 ], - "to": [ 9.5, 30.0, 9.5 ], - "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 }, - "faces": { - "north": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] }, - "east": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] }, - "south": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] }, - "west": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] }, - "up": { "texture": "#1", "uv": [ 12.0, 1.0, 15.0, 4.0 ] }, - "down": { "texture": "#1", "uv": [ 12.0, 1.0, 15.0, 4.0 ] } - } - }, - { - "name": "Cap", - "from": [ 6.0, 30.0, 6.0 ], - "to": [ 10.0, 31.0, 10.0 ], - "faces": { - "north": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] }, - "east": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] }, - "south": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] }, - "west": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] }, - "up": { "texture": "#2", "uv": [ 7.0, 10.0, 11.0, 14.0 ] }, - "down": { "texture": "#2", "uv": [ 7.0, 10.0, 11.0, 14.0 ] } - } - }, - { - "name": "Grip Deco", - "from": [ 6.3000000193715096, 4.0, 6.3000000193715096 ], - "to": [ 9.700000025331974, 5.0, 9.700000025331974 ], - "faces": { - "north": { "texture": "#2", "uv": [ 2.0, 7.0, 5.4000000059604645, 8.0 ] }, - "east": { "texture": "#2", "uv": [ 4.0, 7.0, 7.4000000059604645, 8.0 ] }, - "south": { "texture": "#2", "uv": [ 6.0, 7.0, 9.400000005960464, 8.0 ] }, - "west": { "texture": "#2", "uv": [ 7.0, 7.0, 10.400000005960464, 8.0 ] } - } - }, - { - "name": "Rod Bottom Deco 1", - "from": [ 7.5, 9.0, 5.5 ], - "to": [ 8.5, 10.0, 10.5 ], - "faces": { - "north": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, - "east": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, - "south": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, - "west": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, - "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }, - "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 5.0 ] } - } - }, - { - "name": "Rod Bottom Deco 2", - "from": [ 5.5, 9.0, 7.5 ], - "to": [ 10.5, 10.0, 8.5 ], - "faces": { - "north": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, - "east": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, - "south": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, - "west": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, - "up": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }, - "down": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] } - } - }, - { - "name": "Cube", - "from": [ 6.3000000193715096, -4.0, 6.3000000193715096 ], - "to": [ 9.700000025331974, -3.0, 9.700000025331974 ], - "faces": { - "north": { "texture": "#2", "uv": [ 5.0, 15.0, 8.400000005960464, 16.0 ] }, - "east": { "texture": "#2", "uv": [ 8.0, 15.0, 11.400000005960464, 16.0 ] }, - "south": { "texture": "#2", "uv": [ 8.0, 15.0, 11.400000005960464, 16.0 ] }, - "west": { "texture": "#2", "uv": [ 7.0, 15.0, 3.4000000059604645, 16.0 ] } - } - } - ] + "translation": [0, 4.2, 0], + "scale": [0.4, 0.4, 0.4] + }, + "gui": { + "rotation": [42, 135, 32], + "translation": [-1.7, -1.7, 3], + "scale": [0.8, 0.8, 0.8] + }, + "fixed": { + "rotation": [0, 90, 0], + "translation": [0, -5, 0] + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/item/symmetry_wand_bits.json b/src/main/resources/assets/create/models/item/symmetry_wand/bits.json similarity index 100% rename from src/main/resources/assets/create/models/item/symmetry_wand_bits.json rename to src/main/resources/assets/create/models/item/symmetry_wand/bits.json diff --git a/src/main/resources/assets/create/models/item/symmetry_wand_core.json b/src/main/resources/assets/create/models/item/symmetry_wand/core.json similarity index 100% rename from src/main/resources/assets/create/models/item/symmetry_wand_core.json rename to src/main/resources/assets/create/models/item/symmetry_wand/core.json diff --git a/src/main/resources/assets/create/models/item/wrench/wrench.bbmodel b/src/main/resources/assets/create/models/item/wrench/wrench.bbmodel deleted file mode 100644 index def095282..000000000 --- a/src/main/resources/assets/create/models/item/wrench/wrench.bbmodel +++ /dev/null @@ -1 +0,0 @@ -{"meta":{"format_version":"3.0","model_format":"java_block","box_uv":false},"name":"wrench","parent":"create:item/placement_handgun","ambientocclusion":true,"resolution":{"width":16,"height":16},"elements":[{"name":"handle","from":[7.5,0,7.5],"to":[8.5,14,8.5],"autouv":0,"color":1,"origin":[8.5,11,8],"faces":{"north":{"uv":[1,0,2,14],"texture":1},"east":{"uv":[1,0,2,14],"texture":1},"south":{"uv":[1,0,2,14],"texture":1},"west":{"uv":[1,0,2,14],"texture":1},"up":{"uv":[0,0,1,1],"texture":1},"down":{"uv":[0,0,1,1],"texture":1}},"uuid":"f41d6186-8865-2c76-59f2-99f71bda6878"},{"name":"top thing","from":[7,14,7],"to":[11,15,9],"autouv":0,"color":7,"origin":[8.5,11,7],"faces":{"north":{"uv":[6,1,10,2],"texture":2},"east":{"uv":[6,1,8,2],"texture":2},"south":{"uv":[6,1,10,2],"texture":2},"west":{"uv":[6,1,8,2],"texture":2},"up":{"uv":[5,0,9,2],"texture":2},"down":{"uv":[6,0,10,2],"texture":2}},"uuid":"95f11db2-f806-25cf-0a8a-ae2c5a7d9dbb"},{"name":"bottom thing","from":[8,12,7],"to":[11,13,9],"autouv":0,"color":7,"origin":[8.5,11,7],"faces":{"north":{"uv":[6,1,9,2],"texture":2},"east":{"uv":[6,1,8,2],"texture":2},"south":{"uv":[5,1,8,2],"texture":2},"west":{"uv":[7,1,9,2],"texture":2},"up":{"uv":[6,0,9,2],"texture":2},"down":{"uv":[7,0,10,2],"texture":2}},"uuid":"11a2771f-be0d-ba79-b40a-6bc320a73032"},{"name":"gear case top","from":[7,8,7],"to":[10,9,9],"autouv":0,"color":7,"origin":[9,11,8],"faces":{"north":{"uv":[10,0,13,1],"texture":2},"east":{"uv":[7,0,9,1],"texture":2},"south":{"uv":[7,0,10,1],"texture":2},"west":{"uv":[9,0,11,1],"texture":2},"up":{"uv":[7,0,10,2],"texture":2},"down":{"uv":[6,0,9,2],"texture":2}},"uuid":"4506aa5b-9b1b-1ed6-8b6c-f2e27ad3ae9b"},{"name":"axle","from":[8.353553390593273,5,7.146446609406727],"to":[9.353553390593273,12,8.146446609406727],"autouv":0,"color":1,"rotation":[0,-45,0],"origin":[8.5,11,8],"faces":{"north":{"uv":[5,2,6,9],"texture":3},"east":{"uv":[5,2,6,9],"texture":3},"south":{"uv":[0,0,1,7],"texture":3},"west":{"uv":[4,3,5,10],"texture":3},"up":{"uv":[0,0,1,1],"texture":3},"down":{"uv":[0,0,1,1],"texture":3}},"uuid":"d9f02155-4ddc-75bb-2c9d-a99bb3463e39"},{"name":"gear case","from":[7.5,6.5,7],"to":[9.5,7.5,9],"autouv":0,"color":7,"rotation":[0,45,0],"origin":[8.5,11,8],"faces":{"north":{"uv":[0,0,2,1],"texture":1},"east":{"uv":[0,0,2,1],"texture":1},"south":{"uv":[0,0,2,1],"texture":1},"west":{"uv":[0,0,2,1],"texture":1},"up":{"uv":[0,0,2,2],"texture":1},"down":{"uv":[0,0,2,2],"texture":1}},"uuid":"fc2bb8a5-1331-14f9-d29f-57a6e4172874"},{"name":"Cog","from":[8,7,6],"to":[9,8,10],"autouv":0,"color":0,"rotation":[0,-45,0],"origin":[8.5,7,8],"faces":{"north":{"uv":[3,6,4,7],"rotation":180,"texture":0},"east":{"uv":[5,6,9,7],"rotation":180,"texture":0},"south":{"uv":[3,6,4,7],"rotation":180,"texture":0},"west":{"uv":[5,6,9,7],"rotation":180,"texture":0},"up":{"uv":[5,6,6,10],"rotation":180,"texture":0},"down":{"uv":[5,6,6,10],"rotation":180,"texture":0}},"uuid":"feb916ab-cb3f-19d4-d4ac-ce15d5aecd24"},{"name":"Cog","from":[8,7,6],"to":[9,8,10],"autouv":0,"color":3,"origin":[8.5,7,8],"faces":{"north":{"uv":[3,6,4,7],"rotation":180,"texture":0},"east":{"uv":[5,6,9,7],"rotation":180,"texture":0},"south":{"uv":[3,6,4,7],"rotation":180,"texture":0},"west":{"uv":[5,6,9,7],"rotation":180,"texture":0},"up":{"uv":[5,6,6,10],"rotation":180,"texture":0},"down":{"uv":[5,6,6,10],"rotation":180,"texture":0}},"uuid":"fc83063d-febf-aee3-4771-86572cad1982"},{"name":"Cog","from":[8,7,6],"to":[9,8,10],"autouv":0,"color":7,"rotation":[0,45,0],"origin":[8.5,7,8],"faces":{"north":{"uv":[3,6,4,7],"rotation":180,"texture":0},"east":{"uv":[5,6,9,7],"rotation":180,"texture":0},"south":{"uv":[3,6,4,7],"rotation":180,"texture":0},"west":{"uv":[5,6,9,7],"rotation":180,"texture":0},"up":{"uv":[5,6,6,10],"rotation":180,"texture":0},"down":{"uv":[5,6,6,10],"rotation":180,"texture":0}},"uuid":"b64cf2bf-9ac4-24ae-9079-0bb04e30a01a"},{"name":"Cog","from":[6.5,7,7.5],"to":[10.5,8,8.5],"autouv":0,"color":6,"origin":[8.5,7,8],"faces":{"north":{"uv":[3,6,7,7],"rotation":180,"texture":0},"east":{"uv":[3,6,4,7],"rotation":180,"texture":0},"south":{"uv":[3,6,7,7],"rotation":180,"texture":0},"west":{"uv":[7,4,8,5],"rotation":180,"texture":0},"up":{"uv":[5,6,9,7],"rotation":180,"texture":0},"down":{"uv":[5,6,9,7],"rotation":180,"texture":0}},"uuid":"f132aba1-28e7-4b8a-ffe4-9139ffe048a9"}],"outliner":["f41d6186-8865-2c76-59f2-99f71bda6878","d9f02155-4ddc-75bb-2c9d-a99bb3463e39","95f11db2-f806-25cf-0a8a-ae2c5a7d9dbb","11a2771f-be0d-ba79-b40a-6bc320a73032","4506aa5b-9b1b-1ed6-8b6c-f2e27ad3ae9b","fc2bb8a5-1331-14f9-d29f-57a6e4172874","feb916ab-cb3f-19d4-d4ac-ce15d5aecd24","b64cf2bf-9ac4-24ae-9079-0bb04e30a01a","fc83063d-febf-aee3-4771-86572cad1982","f132aba1-28e7-4b8a-ffe4-9139ffe048a9"],"textures":[{"path":"D:\\simon\\Minecraft\\Minecraft Assets\\minecraft\\textures\\block\\stripped_spruce_log.png","name":"stripped_spruce_log.png","folder":"block","namespace":"minecraft","id":"0","particle":true,"mode":"link","saved":true,"uuid":"18b56023-22d1-3743-fca4-09b5521d9a5c"},{"path":"D:\\simon\\Minecraft\\Minecraft Assets\\minecraft\\textures\\block\\spruce_log.png","name":"spruce_log.png","folder":"block","namespace":"minecraft","id":"1","particle":false,"mode":"link","saved":true,"uuid":"7b7b3c39-c6f6-4982-b9bb-2f8ca03394ac"},{"path":"C:\\Users\\simon\\Desktop\\Forge\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\brass_casing.png","name":"brass_casing.png","folder":"block","namespace":"create","id":"2","particle":false,"mode":"link","saved":true,"uuid":"8ed78919-82aa-35a4-8894-b02e40f46b06"},{"path":"D:\\simon\\Minecraft\\Minecraft Assets\\minecraft\\textures\\block\\andesite.png","name":"andesite.png","folder":"block","namespace":"minecraft","id":"3","particle":false,"mode":"link","saved":true,"uuid":"b8b10c08-30ef-39e6-dd58-8511f63964c1"}]} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/blaze_brass_mesh.png b/src/main/resources/assets/create/textures/block/blaze_brass_mesh.png index 3fb2bd787..ec2c80202 100644 Binary files a/src/main/resources/assets/create/textures/block/blaze_brass_mesh.png and b/src/main/resources/assets/create/textures/block/blaze_brass_mesh.png differ diff --git a/src/main/resources/assets/create/textures/block/chorus_chrome_mesh.png b/src/main/resources/assets/create/textures/block/chorus_chrome_mesh.png index 62fc84abe..45aec71b1 100644 Binary files a/src/main/resources/assets/create/textures/block/chorus_chrome_mesh.png and b/src/main/resources/assets/create/textures/block/chorus_chrome_mesh.png differ diff --git a/src/main/resources/data/create/recipes/crafting_shaped/curiosities/symmetry_wand.json b/src/main/resources/data/create/recipes/crafting_shaped/curiosities/symmetry_wand.json index e4d6df733..5ef8d5c08 100644 --- a/src/main/resources/data/create/recipes/crafting_shaped/curiosities/symmetry_wand.json +++ b/src/main/resources/data/create/recipes/crafting_shaped/curiosities/symmetry_wand.json @@ -10,7 +10,7 @@ "item": "create:refined_radiance" }, "L": { - "tag": "forge:dyes/light_blue" + "tag": "forge:ingots/brass" }, "O": { "item": "minecraft:obsidian" diff --git a/src/main/resources/data/create/recipes/crafting_shaped/cocoa_log.json b/src/main/resources/data/create/recipes/crafting_shapeless/cocoa_log.json similarity index 91% rename from src/main/resources/data/create/recipes/crafting_shaped/cocoa_log.json rename to src/main/resources/data/create/recipes/crafting_shapeless/cocoa_log.json index 76938b837..1ae4faed0 100644 --- a/src/main/resources/data/create/recipes/crafting_shaped/cocoa_log.json +++ b/src/main/resources/data/create/recipes/crafting_shapeless/cocoa_log.json @@ -15,7 +15,7 @@ "conditions": [ { "type": "create:module", - "module": "gardens" + "module": "curiosities" } ] } \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/tree_fertilizer.json b/src/main/resources/data/create/recipes/crafting_shapeless/tree_fertilizer.json index 20dad4a67..0b1319537 100644 --- a/src/main/resources/data/create/recipes/crafting_shapeless/tree_fertilizer.json +++ b/src/main/resources/data/create/recipes/crafting_shapeless/tree_fertilizer.json @@ -35,7 +35,7 @@ "conditions": [ { "type": "create:module", - "module": "gardens" + "module": "curiosities" } ] } \ No newline at end of file