mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-17 07:21:43 +01:00
Refactored item registering and rendering
- Item holders are now initialized with suppliers - Reduced redundancies with defining and registering custom item rendering - Removed the Gardens module - Fixed some colors in the existing custom item models
This commit is contained in:
parent
0099fe9b0d
commit
b5b1a995d7
38 changed files with 500 additions and 512 deletions
|
@ -208,8 +208,6 @@ public enum AllBlocks {
|
||||||
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
|
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
|
||||||
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),
|
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),
|
||||||
WINDOW_IN_A_BLOCK(new WindowInABlockBlock()),
|
WINDOW_IN_A_BLOCK(new WindowInABlockBlock()),
|
||||||
|
|
||||||
__GARDENS__(),
|
|
||||||
COCOA_LOG(new CocoaLogBlock()),
|
COCOA_LOG(new CocoaLogBlock()),
|
||||||
|
|
||||||
__PALETTES__(),
|
__PALETTES__(),
|
||||||
|
@ -343,7 +341,7 @@ public enum AllBlocks {
|
||||||
|
|
||||||
private static void registerAsItem(IForgeRegistry<Item> registry, Block blockIn) {
|
private static void registerAsItem(IForgeRegistry<Item> registry, Block blockIn) {
|
||||||
BlockItem blockItem = null;
|
BlockItem blockItem = null;
|
||||||
net.minecraft.item.Item.Properties standardItemProperties = AllItems.standardItemProperties();
|
Item.Properties standardItemProperties = AllItems.includeInItemGroup();
|
||||||
|
|
||||||
if (blockIn instanceof IHaveCustomBlockItem)
|
if (blockIn instanceof IHaveCustomBlockItem)
|
||||||
blockItem = ((IHaveCustomBlockItem) blockIn).getCustomItem(standardItemProperties);
|
blockItem = ((IHaveCustomBlockItem) blockIn).getCustomItem(standardItemProperties);
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
package com.simibubi.create;
|
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.item.IItemWithColorHandler;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
import com.simibubi.create.modules.IModule;
|
import com.simibubi.create.modules.IModule;
|
||||||
import com.simibubi.create.modules.contraptions.GogglesItem;
|
import com.simibubi.create.modules.contraptions.GogglesItem;
|
||||||
import com.simibubi.create.modules.contraptions.WrenchItem;
|
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.belt.BeltConnectorItem;
|
||||||
import com.simibubi.create.modules.contraptions.relays.gearbox.VerticalGearboxItem;
|
import com.simibubi.create.modules.contraptions.relays.gearbox.VerticalGearboxItem;
|
||||||
import com.simibubi.create.modules.curiosities.ChromaticCompoundCubeItem;
|
import com.simibubi.create.modules.curiosities.ChromaticCompoundCubeItem;
|
||||||
import com.simibubi.create.modules.curiosities.RefinedRadianceItem;
|
import com.simibubi.create.modules.curiosities.RefinedRadianceItem;
|
||||||
import com.simibubi.create.modules.curiosities.ShadowSteelItem;
|
import com.simibubi.create.modules.curiosities.ShadowSteelItem;
|
||||||
import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperItem;
|
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.DeforesterItem;
|
||||||
import com.simibubi.create.modules.curiosities.deforester.DeforesterItemRenderer;
|
|
||||||
import com.simibubi.create.modules.curiosities.symmetry.SymmetryWandItem;
|
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.SandPaperItem;
|
||||||
import com.simibubi.create.modules.curiosities.tools.SandPaperItemRenderer;
|
|
||||||
import com.simibubi.create.modules.gardens.TreeFertilizerItem;
|
import com.simibubi.create.modules.gardens.TreeFertilizerItem;
|
||||||
import com.simibubi.create.modules.logistics.item.filter.FilterItem;
|
import com.simibubi.create.modules.logistics.item.filter.FilterItem;
|
||||||
import com.simibubi.create.modules.schematics.item.SchematicAndQuillItem;
|
import com.simibubi.create.modules.schematics.item.SchematicAndQuillItem;
|
||||||
|
@ -41,71 +39,63 @@ import net.minecraftforge.registries.IForgeRegistry;
|
||||||
@EventBusSubscriber(value = Dist.CLIENT, bus = Bus.MOD)
|
@EventBusSubscriber(value = Dist.CLIENT, bus = Bus.MOD)
|
||||||
public enum AllItems {
|
public enum AllItems {
|
||||||
|
|
||||||
__MATERIALS__(),
|
__MATERIALS__(module()),
|
||||||
COPPER_NUGGET(ingredient()),
|
COPPER_NUGGET,
|
||||||
ZINC_NUGGET(ingredient()),
|
ZINC_NUGGET,
|
||||||
BRASS_NUGGET(ingredient()),
|
BRASS_NUGGET,
|
||||||
IRON_SHEET(ingredient()),
|
IRON_SHEET,
|
||||||
GOLD_SHEET(ingredient()),
|
GOLD_SHEET,
|
||||||
COPPER_SHEET(ingredient()),
|
COPPER_SHEET,
|
||||||
BRASS_SHEET(ingredient()),
|
BRASS_SHEET,
|
||||||
LAPIS_PLATE(ingredient()),
|
LAPIS_PLATE,
|
||||||
|
|
||||||
CRUSHED_IRON(ingredient()),
|
CRUSHED_IRON,
|
||||||
CRUSHED_GOLD(ingredient()),
|
CRUSHED_GOLD,
|
||||||
CRUSHED_COPPER(ingredient()),
|
CRUSHED_COPPER,
|
||||||
CRUSHED_ZINC(ingredient()),
|
CRUSHED_ZINC,
|
||||||
CRUSHED_BRASS(ingredient()),
|
CRUSHED_BRASS,
|
||||||
|
|
||||||
ANDESITE_ALLOY(ingredient()),
|
ANDESITE_ALLOY,
|
||||||
COPPER_INGOT(ingredient()),
|
COPPER_INGOT,
|
||||||
ZINC_INGOT(ingredient()),
|
ZINC_INGOT,
|
||||||
BRASS_INGOT(ingredient()),
|
BRASS_INGOT,
|
||||||
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()),
|
|
||||||
|
|
||||||
__GARDENS__(),
|
SAND_PAPER(SandPaperItem::new),
|
||||||
TREE_FERTILIZER(new TreeFertilizerItem(standardItemProperties())),
|
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__(),
|
__SCHEMATICS__(module()),
|
||||||
EMPTY_BLUEPRINT(new Item(standardItemProperties().maxStackSize(1))),
|
EMPTY_BLUEPRINT(Item::new, stackSize(1)),
|
||||||
BLUEPRINT_AND_QUILL(new SchematicAndQuillItem(standardItemProperties().maxStackSize(1))),
|
BLUEPRINT_AND_QUILL(SchematicAndQuillItem::new, stackSize(1)),
|
||||||
BLUEPRINT(new SchematicItem(standardItemProperties())),
|
BLUEPRINT(SchematicItem::new),
|
||||||
|
|
||||||
__CONTRAPTIONS__(),
|
__CONTRAPTIONS__(module()),
|
||||||
BELT_CONNECTOR(new BeltConnectorItem(standardItemProperties())),
|
BELT_CONNECTOR(BeltConnectorItem::new),
|
||||||
VERTICAL_GEARBOX(new VerticalGearboxItem(new Properties())),
|
VERTICAL_GEARBOX(VerticalGearboxItem::new),
|
||||||
FLOUR(ingredient()),
|
FLOUR,
|
||||||
DOUGH(ingredient()),
|
DOUGH,
|
||||||
PROPELLER(ingredient()),
|
PROPELLER,
|
||||||
WHISK(ingredient()),
|
WHISK,
|
||||||
BRASS_HAND(ingredient()),
|
BRASS_HAND,
|
||||||
WRENCH(new WrenchItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.WRENCH))), true),
|
WRENCH(WrenchItem::new),
|
||||||
GOGGLES(new GogglesItem(standardItemProperties()), true),
|
GOGGLES(GogglesItem::new),
|
||||||
|
|
||||||
__LOGISTICS__(),
|
__LOGISTICS__(module()),
|
||||||
FILTER(new FilterItem(standardItemProperties()), true),
|
FILTER(FilterItem::new),
|
||||||
PROPERTY_FILTER(new FilterItem(standardItemProperties()), true),
|
PROPERTY_FILTER(FilterItem::new),
|
||||||
|
|
||||||
__CURIOSITIES__(),
|
__CURIOSITIES__(module()),
|
||||||
PLACEMENT_HANDGUN(
|
TREE_FERTILIZER(TreeFertilizerItem::new),
|
||||||
new BlockzapperItem(new Properties().setTEISR(() -> () -> renderUsing(AllItemRenderers.BUILDER_GUN))),
|
PLACEMENT_HANDGUN(BlockzapperItem::new),
|
||||||
true),
|
DEFORESTER(DeforesterItem::new),
|
||||||
DEFORESTER(
|
SYMMETRY_WAND(SymmetryWandItem::new),
|
||||||
new DeforesterItem(standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.DEFORESTER))),
|
|
||||||
true),
|
|
||||||
SYMMETRY_WAND(new SymmetryWandItem(
|
|
||||||
standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SYMMETRY_WAND))), true),
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -115,11 +105,12 @@ public enum AllItems {
|
||||||
|
|
||||||
// Common
|
// Common
|
||||||
|
|
||||||
public Item item;
|
|
||||||
public IModule module;
|
public IModule module;
|
||||||
public boolean firstInCreativeTab;
|
private Function<Properties, Properties> specialProperties;
|
||||||
|
private Function<Properties, Item> itemSupplier;
|
||||||
|
private Item item;
|
||||||
|
|
||||||
private AllItems() {
|
private AllItems(int moduleMarker) {
|
||||||
CategoryTracker.currentModule = new IModule() {
|
CategoryTracker.currentModule = new IModule() {
|
||||||
@Override
|
@Override
|
||||||
public String getModuleName() {
|
public String getModuleName() {
|
||||||
|
@ -128,36 +119,51 @@ public enum AllItems {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private AllItems(Item item) {
|
private AllItems() {
|
||||||
this(item, false);
|
this(Item::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AllItems(Item item, boolean firstInCreativeTab) {
|
private AllItems(Function<Properties, Item> itemSupplier) {
|
||||||
this.item = item;
|
this(itemSupplier, Function.identity());
|
||||||
this.item.setRegistryName(Create.ID, Lang.asId(name()));
|
}
|
||||||
|
|
||||||
|
private AllItems(Function<Properties, Item> itemSupplier, Function<Properties, Properties> specialProperties) {
|
||||||
|
this.itemSupplier = itemSupplier;
|
||||||
this.module = CategoryTracker.currentModule;
|
this.module = CategoryTracker.currentModule;
|
||||||
this.firstInCreativeTab = firstInCreativeTab;
|
this.specialProperties = specialProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Properties standardItemProperties() {
|
private static Function<Properties, Properties> rarity(Rarity rarity) {
|
||||||
|
return p -> p.rarity(rarity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Function<Properties, Properties> 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);
|
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<Item> event) {
|
public static void register(RegistryEvent.Register<Item> event) {
|
||||||
IForgeRegistry<Item> registry = event.getRegistry();
|
IForgeRegistry<Item> registry = event.getRegistry();
|
||||||
|
|
||||||
for (AllItems item : values()) {
|
for (AllItems entry : values()) {
|
||||||
if (item.get() == null)
|
if (entry.itemSupplier == null)
|
||||||
continue;
|
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);
|
AllBlocks.registerItemBlocks(registry);
|
||||||
|
@ -177,8 +183,12 @@ public enum AllItems {
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
|
|
||||||
private enum AllItemRenderers {
|
@OnlyIn(Dist.CLIENT)
|
||||||
SYMMETRY_WAND, BUILDER_GUN, WRENCH, DEFORESTER, SAND_PAPER;
|
public ItemStackTileEntityRenderer getRenderer() {
|
||||||
|
if (!(item instanceof IHaveCustomItemModel))
|
||||||
|
return null;
|
||||||
|
IHaveCustomItemModel specialItem = (IHaveCustomItemModel) item;
|
||||||
|
return specialItem.createModel(null).getRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.CTModel;
|
||||||
import com.simibubi.create.foundation.block.connected.IHaveConnectedTextures;
|
import com.simibubi.create.foundation.block.connected.IHaveConnectedTextures;
|
||||||
import com.simibubi.create.foundation.block.render.ColoredVertexModel;
|
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.block.render.SpriteShiftEntry;
|
||||||
|
import com.simibubi.create.foundation.item.IHaveCustomItemModel;
|
||||||
import com.simibubi.create.foundation.utility.SuperByteBufferCache;
|
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.base.KineticTileEntityRenderer;
|
||||||
import com.simibubi.create.modules.contraptions.components.contraptions.ContraptionRenderer;
|
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.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.ClientSchematicLoader;
|
||||||
import com.simibubi.create.modules.schematics.client.SchematicAndQuillHandler;
|
import com.simibubi.create.modules.schematics.client.SchematicAndQuillHandler;
|
||||||
import com.simibubi.create.modules.schematics.client.SchematicHandler;
|
import com.simibubi.create.modules.schematics.client.SchematicHandler;
|
||||||
|
@ -121,6 +118,7 @@ public class CreateClient {
|
||||||
public static void onModelBake(ModelBakeEvent event) {
|
public static void onModelBake(ModelBakeEvent event) {
|
||||||
Map<ResourceLocation, IBakedModel> modelRegistry = event.getModelRegistry();
|
Map<ResourceLocation, IBakedModel> modelRegistry = event.getModelRegistry();
|
||||||
|
|
||||||
|
// Swap Models for CT Blocks and Blocks with colored Vertices
|
||||||
for (AllBlocks allBlocks : AllBlocks.values()) {
|
for (AllBlocks allBlocks : AllBlocks.values()) {
|
||||||
Block block = allBlocks.get();
|
Block block = allBlocks.get();
|
||||||
if (block == null)
|
if (block == null)
|
||||||
|
@ -135,22 +133,19 @@ public class CreateClient {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
swapModels(modelRegistry, getItemModelLocation(AllItems.SAND_PAPER),
|
// Swap Models for custom rendered item models
|
||||||
t -> new SandPaperModel(t));
|
for (AllItems item : AllItems.values()) {
|
||||||
swapModels(modelRegistry, getItemModelLocation(AllItems.RED_SAND_PAPER),
|
if (!(item.get() instanceof IHaveCustomItemModel))
|
||||||
t -> new SandPaperModel(t));
|
continue;
|
||||||
|
|
||||||
swapModels(modelRegistry, getItemModelLocation(AllItems.SYMMETRY_WAND),
|
IHaveCustomItemModel specialItem = (IHaveCustomItemModel) item.get();
|
||||||
t -> new SymmetryWandModel(t).loadPartials(event));
|
ModelResourceLocation location = new ModelResourceLocation(item.get().getRegistryName(), "inventory");
|
||||||
swapModels(modelRegistry, getItemModelLocation(AllItems.PLACEMENT_HANDGUN),
|
CustomRenderedItemModel model = specialItem.createModel(modelRegistry.get(location));
|
||||||
t -> new BlockzapperModel(t).loadPartials(event));
|
model.loadPartials(event);
|
||||||
swapModels(modelRegistry, getItemModelLocation(AllItems.WRENCH), t -> new WrenchModel(t).loadPartials(event));
|
modelRegistry.put(location, model);
|
||||||
swapModels(modelRegistry, getItemModelLocation(AllItems.DEFORESTER),
|
}
|
||||||
t -> new DeforesterModel(t).loadPartials(event));
|
|
||||||
swapModels(modelRegistry,
|
swapModels(modelRegistry, getAllBlockStateModelLocations(AllBlocks.WINDOW_IN_A_BLOCK),
|
||||||
getBlockModelLocation(AllBlocks.WINDOW_IN_A_BLOCK,
|
|
||||||
BlockModelShapes
|
|
||||||
.getPropertyMapString(AllBlocks.WINDOW_IN_A_BLOCK.get().getDefaultState().getValues())),
|
|
||||||
WindowInABlockModel::new);
|
WindowInABlockModel::new);
|
||||||
swapModels(modelRegistry,
|
swapModels(modelRegistry,
|
||||||
getBlockModelLocation(AllBlocks.WINDOW_IN_A_BLOCK,
|
getBlockModelLocation(AllBlocks.WINDOW_IN_A_BLOCK,
|
||||||
|
@ -161,19 +156,20 @@ public class CreateClient {
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static void onModelRegistry(ModelRegistryEvent event) {
|
public static void onModelRegistry(ModelRegistryEvent event) {
|
||||||
for (String location : SymmetryWandModel.getCustomModelLocations())
|
// Register submodels for custom rendered item models
|
||||||
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
|
for (AllItems item : AllItems.values()) {
|
||||||
for (String location : BlockzapperModel.getCustomModelLocations())
|
if (!(item.get() instanceof IHaveCustomItemModel))
|
||||||
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
|
continue;
|
||||||
for (String location : WrenchModel.getCustomModelLocations())
|
|
||||||
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
|
IHaveCustomItemModel specialItem = (IHaveCustomItemModel) item.get();
|
||||||
for (String location : DeforesterModel.getCustomModelLocations())
|
CustomRenderedItemModel model = specialItem.createModel(null);
|
||||||
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
|
model.getModelLocations().forEach(ModelLoader::addSpecialModel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
protected static ModelResourceLocation getItemModelLocation(AllItems item) {
|
protected static ModelResourceLocation getItemModelLocation(AllItems item) {
|
||||||
return new ModelResourceLocation(item.item.getRegistryName(), "inventory");
|
return new ModelResourceLocation(item.get().getRegistryName(), "inventory");
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
|
|
@ -35,7 +35,6 @@ public class CreateConfig {
|
||||||
public BooleanValue enableContraptions;
|
public BooleanValue enableContraptions;
|
||||||
public BooleanValue enablePalettes;
|
public BooleanValue enablePalettes;
|
||||||
public BooleanValue enableLogistics;
|
public BooleanValue enableLogistics;
|
||||||
public BooleanValue enableGardens;
|
|
||||||
|
|
||||||
// Damage Control
|
// Damage Control
|
||||||
public BooleanValue freezeRotationPropagator;
|
public BooleanValue freezeRotationPropagator;
|
||||||
|
@ -103,9 +102,6 @@ public class CreateConfig {
|
||||||
name = "enableCuriosities";
|
name = "enableCuriosities";
|
||||||
enableCuriosities = builder.translation(basePath + name).define(name, true);
|
enableCuriosities = builder.translation(basePath + name).define(name, true);
|
||||||
|
|
||||||
name = "enableGardens";
|
|
||||||
enableGardens = builder.translation(basePath + name).define(name, true);
|
|
||||||
|
|
||||||
name = "enableLogistics";
|
name = "enableLogistics";
|
||||||
enableLogistics = builder.translation(basePath + name).define(name, true);
|
enableLogistics = builder.translation(basePath + name).define(name, true);
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,14 @@ import com.simibubi.create.foundation.block.IHaveNoBlockItem;
|
||||||
import com.simibubi.create.foundation.item.IAddedByOther;
|
import com.simibubi.create.foundation.item.IAddedByOther;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
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.ItemGroup;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
public final class CreateItemGroup extends ItemGroup {
|
public final class CreateItemGroup extends ItemGroup {
|
||||||
|
|
||||||
|
@ -20,12 +25,14 @@ public final class CreateItemGroup extends ItemGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void fill(NonNullList<ItemStack> items) {
|
public void fill(NonNullList<ItemStack> items) {
|
||||||
addItems(items, true);
|
addItems(items, true);
|
||||||
addBlocks(items);
|
addBlocks(items);
|
||||||
addItems(items, false);
|
addItems(items, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void addBlocks(NonNullList<ItemStack> items) {
|
public void addBlocks(NonNullList<ItemStack> items) {
|
||||||
for (AllBlocks block : AllBlocks.values()) {
|
for (AllBlocks block : AllBlocks.values()) {
|
||||||
Block def = block.get();
|
Block def = block.get();
|
||||||
|
@ -44,13 +51,17 @@ public final class CreateItemGroup extends ItemGroup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItems(NonNullList<ItemStack> items, boolean prioritized) {
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public void addItems(NonNullList<ItemStack> items, boolean specialItems) {
|
||||||
|
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
|
||||||
|
|
||||||
for (AllItems item : AllItems.values()) {
|
for (AllItems item : AllItems.values()) {
|
||||||
if (item.get() == null)
|
if (item.get() == null)
|
||||||
continue;
|
continue;
|
||||||
if (!item.module.isEnabled())
|
if (!item.module.isEnabled())
|
||||||
continue;
|
continue;
|
||||||
if (item.firstInCreativeTab != prioritized)
|
IBakedModel model = itemRenderer.getModelWithOverrides(item.asStack());
|
||||||
|
if ((model.isBuiltInRenderer() || model.isGui3d()) != specialItems)
|
||||||
continue;
|
continue;
|
||||||
if (item.get() instanceof IAddedByOther)
|
if (item.get() instanceof IAddedByOther)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class CreateJEI implements IModPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerItemSubtypes(ISubtypeRegistration registration) {
|
public void registerItemSubtypes(ISubtypeRegistration registration) {
|
||||||
registration.useNbtForSubtypes(AllItems.PLACEMENT_HANDGUN.item);
|
registration.useNbtForSubtypes(AllItems.PLACEMENT_HANDGUN.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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<String, IBakedModel> 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<ResourceLocation> 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<? extends IBakedModel, Matrix4f> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
|
@ -28,8 +28,6 @@ public interface IModule {
|
||||||
return conf.enableLogistics.get();
|
return conf.enableLogistics.get();
|
||||||
case "schematics":
|
case "schematics":
|
||||||
return conf.enableSchematics.get();
|
return conf.enableSchematics.get();
|
||||||
case "gardens":
|
|
||||||
return conf.enableGardens.get();
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -45,15 +43,13 @@ public interface IModule {
|
||||||
case "contraptions":
|
case "contraptions":
|
||||||
return Palette.Red;
|
return Palette.Red;
|
||||||
case "palettes":
|
case "palettes":
|
||||||
return Palette.Yellow;
|
return Palette.Green;
|
||||||
case "curiosities":
|
case "curiosities":
|
||||||
return Palette.Purple;
|
return Palette.Purple;
|
||||||
case "logistics":
|
case "logistics":
|
||||||
return Palette.Yellow;
|
return Palette.Yellow;
|
||||||
case "schematics":
|
case "schematics":
|
||||||
return Palette.Blue;
|
return Palette.Blue;
|
||||||
case "gardens":
|
|
||||||
return Palette.Green;
|
|
||||||
default:
|
default:
|
||||||
return Palette.Purple;
|
return Palette.Purple;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package com.simibubi.create.modules.contraptions;
|
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.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -10,8 +14,10 @@ import net.minecraft.util.ActionResultType;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.server.ServerWorld;
|
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) {
|
public WrenchItem(Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
|
@ -45,4 +51,10 @@ public class WrenchItem extends Item {
|
||||||
return actor.onWrenched(state, context);
|
return actor.onWrenched(state, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public CustomRenderedItemModel createModel(IBakedModel original) {
|
||||||
|
return new WrenchModel(original);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class WrenchItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
GlStateManager.rotated(angle, 0, 1, 0);
|
GlStateManager.rotated(angle, 0, 1, 0);
|
||||||
GlStateManager.translatef(xOffset, 0, zOffset);
|
GlStateManager.translatef(xOffset, 0, zOffset);
|
||||||
|
|
||||||
itemRenderer.renderItem(stack, mainModel.gear);
|
itemRenderer.renderItem(stack, mainModel.getPartial("gear"));
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,20 @@
|
||||||
package com.simibubi.create.modules.contraptions;
|
package com.simibubi.create.modules.contraptions;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import com.simibubi.create.foundation.block.render.CustomRenderedItemModel;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
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) {
|
public WrenchModel(IBakedModel template) {
|
||||||
super(template);
|
super(template, "wrench");
|
||||||
}
|
addPartials("gear");
|
||||||
|
|
||||||
public static List<String> getCustomModelLocations() {
|
|
||||||
return Arrays.asList("wrench/gear");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
|
public ItemStackTileEntityRenderer createRenderer() {
|
||||||
this.gear = loadCustomModel(event, "wrench/gear");
|
return new WrenchItemRenderer();
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.simibubi.create.modules.contraptions.relays.gearbox;
|
package com.simibubi.create.modules.contraptions.relays.gearbox;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
import com.simibubi.create.foundation.item.IAddedByOther;
|
||||||
import com.simibubi.create.modules.contraptions.base.IRotate;
|
import com.simibubi.create.modules.contraptions.base.IRotate;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
@ -13,7 +14,7 @@ import net.minecraft.util.Direction.Axis;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class VerticalGearboxItem extends BlockItem {
|
public class VerticalGearboxItem extends BlockItem implements IAddedByOther {
|
||||||
|
|
||||||
public VerticalGearboxItem(Properties builder) {
|
public VerticalGearboxItem(Properties builder) {
|
||||||
super(AllBlocks.GEARBOX.get(), builder);
|
super(AllBlocks.GEARBOX.get(), builder);
|
||||||
|
|
|
@ -11,7 +11,9 @@ import com.google.common.base.Predicates;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllPackets;
|
import com.simibubi.create.AllPackets;
|
||||||
import com.simibubi.create.Create;
|
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.gui.ScreenOpener;
|
||||||
|
import com.simibubi.create.foundation.item.IHaveCustomItemModel;
|
||||||
import com.simibubi.create.foundation.item.ItemDescription;
|
import com.simibubi.create.foundation.item.ItemDescription;
|
||||||
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
||||||
import com.simibubi.create.foundation.utility.BlockHelper;
|
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.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
import net.minecraft.client.util.ITooltipFlag;
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
@ -67,7 +70,7 @@ import net.minecraftforge.event.ForgeEventFactory;
|
||||||
import net.minecraftforge.fml.DistExecutor;
|
import net.minecraftforge.fml.DistExecutor;
|
||||||
import net.minecraftforge.fml.network.PacketDistributor;
|
import net.minecraftforge.fml.network.PacketDistributor;
|
||||||
|
|
||||||
public class BlockzapperItem extends Item {
|
public class BlockzapperItem extends Item implements IHaveCustomItemModel {
|
||||||
|
|
||||||
public static enum ComponentTier {
|
public static enum ComponentTier {
|
||||||
None(TextFormatting.DARK_GRAY), Brass(TextFormatting.GOLD), Chromatic(TextFormatting.LIGHT_PURPLE),
|
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));
|
stack.getOrCreateTag().putString(component.name(), NBTHelper.writeEnum(tier));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(value = Dist.CLIENT)
|
||||||
|
public CustomRenderedItemModel createModel(IBakedModel original) {
|
||||||
|
return new BlockzapperModel(original);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,12 +18,14 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
import net.minecraft.client.renderer.ItemRenderer;
|
import net.minecraft.client.renderer.ItemRenderer;
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
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.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTUtil;
|
import net.minecraft.nbt.NBTUtil;
|
||||||
import net.minecraft.util.HandSide;
|
import net.minecraft.util.HandSide;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer {
|
public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
|
|
||||||
@Override
|
@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));
|
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, Math.min(lastCoordx + 60, 240), Math.min(lastCoordy + 120, 240));
|
||||||
|
|
||||||
itemRenderer.renderItem(stack, mainModel.getBakedModel());
|
itemRenderer.renderItem(stack, mainModel.getBakedModel());
|
||||||
renderComponent(stack, Body, itemRenderer, mainModel.body, mainModel.goldBody, mainModel.chorusBody);
|
renderComponent(stack, mainModel, Body, itemRenderer);
|
||||||
renderComponent(stack, Amplifier, itemRenderer, null, mainModel.goldAmp, mainModel.chorusAmp);
|
renderComponent(stack, mainModel, Amplifier, itemRenderer);
|
||||||
renderComponent(stack, Retriever, itemRenderer, null, mainModel.goldRetriever, mainModel.chorusRetriever);
|
renderComponent(stack, mainModel, Retriever, itemRenderer);
|
||||||
renderComponent(stack, Scope, itemRenderer, null, mainModel.goldScope, mainModel.chorusScope);
|
renderComponent(stack, mainModel, Scope, itemRenderer);
|
||||||
|
|
||||||
// Block indicator
|
// 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);
|
renderBlockUsed(stack, itemRenderer);
|
||||||
|
|
||||||
ClientPlayerEntity player = Minecraft.getInstance().player;
|
ClientPlayerEntity player = Minecraft.getInstance().player;
|
||||||
|
@ -66,9 +69,9 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
multiplier = animation;
|
multiplier = animation;
|
||||||
}
|
}
|
||||||
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, multiplier * 240, 120);
|
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)
|
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);
|
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
|
||||||
GlStateManager.enableLighting();
|
GlStateManager.enableLighting();
|
||||||
|
|
||||||
|
@ -82,7 +85,7 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
GlStateManager.translatef(0, offset, 0);
|
GlStateManager.translatef(0, offset, 0);
|
||||||
GlStateManager.rotatef(angle, 0, 0, 1);
|
GlStateManager.rotatef(angle, 0, 0, 1);
|
||||||
GlStateManager.translatef(0, -offset, 0);
|
GlStateManager.translatef(0, -offset, 0);
|
||||||
renderComponent(stack, Accelerator, itemRenderer, mainModel.acc, mainModel.goldAcc, mainModel.chorusAcc);
|
renderComponent(stack, mainModel, Accelerator, itemRenderer);
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
@ -103,18 +106,12 @@ public class BlockzapperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderComponent(ItemStack stack, Components component, ItemRenderer itemRenderer, IBakedModel none,
|
public void renderComponent(ItemStack stack, BlockzapperModel model, Components component,
|
||||||
IBakedModel gold, IBakedModel chorus) {
|
ItemRenderer itemRenderer) {
|
||||||
ComponentTier tier = BlockzapperItem.getTier(component, stack);
|
ComponentTier tier = BlockzapperItem.getTier(component, stack);
|
||||||
|
IBakedModel partial = model.getComponentPartial(tier, component);
|
||||||
IBakedModel model = tier == ComponentTier.Chromatic ? chorus : gold;
|
if (partial != null)
|
||||||
if (tier == ComponentTier.None) {
|
itemRenderer.renderItem(stack, partial);
|
||||||
if (none == null)
|
|
||||||
return;
|
|
||||||
model = none;
|
|
||||||
}
|
|
||||||
|
|
||||||
itemRenderer.renderItem(stack, model);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,79 +1,32 @@
|
||||||
package com.simibubi.create.modules.curiosities.blockzapper;
|
package com.simibubi.create.modules.curiosities.blockzapper;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import javax.annotation.Nullable;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.vecmath.Matrix4f;
|
import com.simibubi.create.foundation.block.render.CustomRenderedItemModel;
|
||||||
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import com.simibubi.create.modules.curiosities.blockzapper.BlockzapperItem.ComponentTier;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
|
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
public class BlockzapperModel extends CustomRenderedItemModel {
|
||||||
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 BlockzapperModel(IBakedModel template) {
|
public BlockzapperModel(IBakedModel template) {
|
||||||
super(template);
|
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",
|
||||||
public static List<String> getCustomModelLocations() {
|
"chorus_accelerator");
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
|
public ItemStackTileEntityRenderer createRenderer() {
|
||||||
showBlock = cameraTransformType == TransformType.GUI;
|
return new BlockzapperItemRenderer();
|
||||||
return super.handlePerspective(cameraTransformType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Nullable
|
||||||
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
|
IBakedModel getComponentPartial(BlockzapperItem.ComponentTier tier, BlockzapperItem.Components component) {
|
||||||
String p = "blockzapper/";
|
String prefix = tier == ComponentTier.Chromatic ? "chorus_" : tier == ComponentTier.Brass ? "gold_" : "";
|
||||||
|
return getPartial(prefix + Lang.asId(component.name()));
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.simibubi.create.modules.curiosities.deforester;
|
package com.simibubi.create.modules.curiosities.deforester;
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
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.BlockHelper;
|
||||||
import com.simibubi.create.foundation.utility.TreeCutter;
|
import com.simibubi.create.foundation.utility.TreeCutter;
|
||||||
import com.simibubi.create.foundation.utility.TreeCutter.Tree;
|
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 com.simibubi.create.modules.curiosities.tools.AllToolTiers;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.AxeItem;
|
import net.minecraft.item.AxeItem;
|
||||||
|
@ -18,13 +21,15 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.IWorld;
|
import net.minecraft.world.IWorld;
|
||||||
import net.minecraft.world.World;
|
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.event.world.BlockEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
||||||
|
|
||||||
@EventBusSubscriber(bus = Bus.FORGE)
|
@EventBusSubscriber(bus = Bus.FORGE)
|
||||||
public class DeforesterItem extends AxeItem {
|
public class DeforesterItem extends AxeItem implements IHaveCustomItemModel {
|
||||||
|
|
||||||
public DeforesterItem(Properties builder) {
|
public DeforesterItem(Properties builder) {
|
||||||
super(AllToolTiers.RADIANT, 10.0F, -3.1F, builder);
|
super(AllToolTiers.RADIANT, 10.0F, -3.1F, builder);
|
||||||
|
@ -75,4 +80,10 @@ public class DeforesterItem extends AxeItem {
|
||||||
world.addEntity(entity);
|
world.addEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public CustomRenderedItemModel createModel(IBakedModel original) {
|
||||||
|
return new DeforesterModel(original);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@ public class DeforesterItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
|
|
||||||
GlStateManager.disableLighting();
|
GlStateManager.disableLighting();
|
||||||
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 120);
|
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 120);
|
||||||
itemRenderer.renderItem(stack, mainModel.light);
|
itemRenderer.renderItem(stack, mainModel.getPartial("light"));
|
||||||
itemRenderer.renderItem(stack, mainModel.blade);
|
itemRenderer.renderItem(stack, mainModel.getPartial("blade"));
|
||||||
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
|
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
|
||||||
GlStateManager.enableLighting();
|
GlStateManager.enableLighting();
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class DeforesterItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
GlStateManager.rotated(angle, 0, 1, 0);
|
GlStateManager.rotated(angle, 0, 1, 0);
|
||||||
GlStateManager.translatef(xOffset, 0, zOffset);
|
GlStateManager.translatef(xOffset, 0, zOffset);
|
||||||
|
|
||||||
itemRenderer.renderItem(stack, mainModel.gear);
|
itemRenderer.renderItem(stack, mainModel.getPartial("gear"));
|
||||||
|
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
|
@ -1,33 +1,20 @@
|
||||||
package com.simibubi.create.modules.curiosities.deforester;
|
package com.simibubi.create.modules.curiosities.deforester;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import com.simibubi.create.foundation.block.render.CustomRenderedItemModel;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
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) {
|
public DeforesterModel(IBakedModel template) {
|
||||||
super(template);
|
super(template, "deforester");
|
||||||
}
|
addPartials("gear", "light", "blade");
|
||||||
|
|
||||||
public static List<String> getCustomModelLocations() {
|
|
||||||
return Arrays.asList("deforester/gear", "deforester/light", "deforester/blade");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
|
public ItemStackTileEntityRenderer createRenderer() {
|
||||||
this.gear = loadCustomModel(event, "deforester/gear");
|
return new DeforesterItemRenderer();
|
||||||
this.light = loadCustomModel(event, "deforester/light");
|
|
||||||
this.blade = loadCustomModel(event, "deforester/blade");
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,11 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.simibubi.create.AllPackets;
|
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.gui.ScreenOpener;
|
||||||
|
import com.simibubi.create.foundation.item.IHaveCustomItemModel;
|
||||||
import com.simibubi.create.foundation.utility.BlockHelper;
|
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.CrossPlaneMirror;
|
||||||
import com.simibubi.create.modules.curiosities.symmetry.mirror.EmptyMirror;
|
import com.simibubi.create.modules.curiosities.symmetry.mirror.EmptyMirror;
|
||||||
import com.simibubi.create.modules.curiosities.symmetry.mirror.PlaneMirror;
|
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.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -39,7 +43,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.fml.DistExecutor;
|
import net.minecraftforge.fml.DistExecutor;
|
||||||
import net.minecraftforge.fml.network.PacketDistributor;
|
import net.minecraftforge.fml.network.PacketDistributor;
|
||||||
|
|
||||||
public class SymmetryWandItem extends Item {
|
public class SymmetryWandItem extends Item implements IHaveCustomItemModel {
|
||||||
|
|
||||||
public static final String SYMMETRY = "symmetry";
|
public static final String SYMMETRY = "symmetry";
|
||||||
private static final String ENABLE = "enable";
|
private static final String ENABLE = "enable";
|
||||||
|
@ -268,4 +272,10 @@ public class SymmetryWandItem extends Item {
|
||||||
new SymmetryEffectPacket(to, targets));
|
new SymmetryEffectPacket(to, targets));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public CustomRenderedItemModel createModel(IBakedModel original) {
|
||||||
|
return new SymmetryWandModel(original);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,13 +31,13 @@ public class SymmetryWandItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
lastCoordy = GLX.lastBrightnessY;
|
lastCoordy = GLX.lastBrightnessY;
|
||||||
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 240);
|
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 240);
|
||||||
|
|
||||||
itemRenderer.renderItem(stack, mainModel.core);
|
itemRenderer.renderItem(stack, mainModel.getPartial("core"));
|
||||||
|
|
||||||
float floating = MathHelper.sin(worldTime) * .05f;
|
float floating = MathHelper.sin(worldTime) * .05f;
|
||||||
GlStateManager.translated(0, floating, 0);
|
GlStateManager.translated(0, floating, 0);
|
||||||
float angle = worldTime * -10 % 360;
|
float angle = worldTime * -10 % 360;
|
||||||
GlStateManager.rotated(angle, 0, 1, 0);
|
GlStateManager.rotated(angle, 0, 1, 0);
|
||||||
itemRenderer.renderItem(stack, mainModel.bits);
|
itemRenderer.renderItem(stack, mainModel.getPartial("bits"));
|
||||||
|
|
||||||
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
|
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
|
||||||
GlStateManager.enableLighting();
|
GlStateManager.enableLighting();
|
||||||
|
|
|
@ -1,31 +1,20 @@
|
||||||
package com.simibubi.create.modules.curiosities.symmetry.client;
|
package com.simibubi.create.modules.curiosities.symmetry.client;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import com.simibubi.create.foundation.block.render.CustomRenderedItemModel;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.simibubi.create.foundation.block.render.CustomRenderItemBakedModel;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
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) {
|
public SymmetryWandModel(IBakedModel template) {
|
||||||
super(template);
|
super(template, "symmetry_wand");
|
||||||
}
|
addPartials("bits", "core");
|
||||||
|
|
||||||
public static List<String> getCustomModelLocations() {
|
|
||||||
return Arrays.asList("symmetry_wand_core", "symmetry_wand_bits");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
|
public ItemStackTileEntityRenderer createRenderer() {
|
||||||
this.core = loadCustomModel(event, "symmetry_wand_core");
|
return new SymmetryWandItemRenderer();
|
||||||
this.bits = loadCustomModel(event, "symmetry_wand_bits");
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,15 @@ public enum AllToolTiers implements IItemTier {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
ROSE_QUARTZ(3, 1644, 7.0F, 2.0F, 24, () -> {
|
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, () -> {
|
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, () -> {
|
RADIANT(4, 1024, 16.0F, 3.5F, 10, () -> {
|
||||||
return Ingredient.fromItems(AllItems.REFINED_RADIANCE.item);
|
return Ingredient.fromItems(AllItems.REFINED_RADIANCE.get());
|
||||||
}),
|
}),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
package com.simibubi.create.modules.curiosities.tools;
|
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.foundation.utility.VecHelper;
|
||||||
import com.simibubi.create.modules.contraptions.components.deployer.DeployerFakePlayer;
|
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.Enchantment;
|
||||||
import net.minecraft.enchantment.Enchantments;
|
import net.minecraft.enchantment.Enchantments;
|
||||||
import net.minecraft.entity.LivingEntity;
|
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.RayTraceResult;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.World;
|
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) {
|
public SandPaperItem(Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
|
@ -177,4 +183,10 @@ public class SandPaperItem extends Item {
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public CustomRenderedItemModel createModel(IBakedModel original) {
|
||||||
|
return new SandPaperModel(original);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package com.simibubi.create.modules.curiosities.tools;
|
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.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 com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -17,7 +13,6 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
|
@ -27,10 +22,11 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
|
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
|
||||||
ClientPlayerEntity player = Minecraft.getInstance().player;
|
ClientPlayerEntity player = Minecraft.getInstance().player;
|
||||||
SandPaperModel mainModel = (SandPaperModel) itemRenderer.getModelWithOverrides(stack);
|
SandPaperModel mainModel = (SandPaperModel) itemRenderer.getModelWithOverrides(stack);
|
||||||
|
TransformType perspective = mainModel.getCurrentPerspective();
|
||||||
float partialTicks = Minecraft.getInstance().getRenderPartialTicks();
|
float partialTicks = Minecraft.getInstance().getRenderPartialTicks();
|
||||||
|
|
||||||
boolean leftHand = mainModel.transformType == TransformType.FIRST_PERSON_LEFT_HAND;
|
boolean leftHand = perspective == TransformType.FIRST_PERSON_LEFT_HAND;
|
||||||
boolean firstPerson = leftHand || mainModel.transformType == TransformType.FIRST_PERSON_RIGHT_HAND;
|
boolean firstPerson = leftHand || perspective == TransformType.FIRST_PERSON_RIGHT_HAND;
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translatef(.5f, .5f, .5f);
|
GlStateManager.translatef(.5f, .5f, .5f);
|
||||||
|
@ -41,7 +37,7 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
if (tag.contains("Polishing")) {
|
if (tag.contains("Polishing")) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
if (mainModel.transformType == TransformType.GUI) {
|
if (perspective == TransformType.GUI) {
|
||||||
GlStateManager.translatef(0.0F, .2f, 1.0F);
|
GlStateManager.translatef(0.0F, .2f, 1.0F);
|
||||||
GlStateManager.scalef(.75f, .75f, .75f);
|
GlStateManager.scalef(.75f, .75f, .75f);
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,7 +51,7 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
if (time / (float) stack.getUseDuration() < 0.8F) {
|
if (time / (float) stack.getUseDuration() < 0.8F) {
|
||||||
float bobbing = -MathHelper.abs(MathHelper.cos(time / 4.0F * (float) Math.PI) * 0.1F);
|
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);
|
GlStateManager.translatef(bobbing, bobbing, 0.0F);
|
||||||
else
|
else
|
||||||
GlStateManager.translatef(0.0f, bobbing, 0.0F);
|
GlStateManager.translatef(0.0f, bobbing, 0.0F);
|
||||||
|
@ -83,23 +79,15 @@ public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SandPaperModel extends CustomRenderItemBakedModel {
|
public static class SandPaperModel extends CustomRenderedItemModel {
|
||||||
|
|
||||||
TransformType transformType;
|
|
||||||
|
|
||||||
public SandPaperModel(IBakedModel template) {
|
public SandPaperModel(IBakedModel template) {
|
||||||
super(template);
|
super(template, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
|
public ItemStackTileEntityRenderer createRenderer() {
|
||||||
transformType = cameraTransformType;
|
return new SandPaperItemRenderer();
|
||||||
return super.handlePerspective(cameraTransformType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SchematicItem extends Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack create(String schematic, String owner) {
|
public static ItemStack create(String schematic, String owner) {
|
||||||
ItemStack blueprint = new ItemStack(AllItems.BLUEPRINT.item);
|
ItemStack blueprint = AllItems.BLUEPRINT.asStack();
|
||||||
|
|
||||||
CompoundNBT tag = new CompoundNBT();
|
CompoundNBT tag = new CompoundNBT();
|
||||||
tag.putBoolean("Deployed", false);
|
tag.putBoolean("Deployed", false);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||||
"parent": "create:item/placement_handgun",
|
"parent": "create:item/placement_handgun",
|
||||||
"textures": {
|
"textures": {
|
||||||
"cog": "minecraft:block/purpur_block"
|
"cog": "minecraft:block/mycelium_top"
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||||
"parent": "create:item/placement_handgun",
|
"parent": "create:item/placement_handgun",
|
||||||
"textures": {
|
"textures": {
|
||||||
"cog": "minecraft:block/yellow_concrete_powder"
|
"cog": "create:block/brass_block"
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,156 +1,126 @@
|
||||||
{
|
{
|
||||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
"credit": "Made with Blockbench",
|
||||||
"ambientocclusion": true,
|
|
||||||
"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 ]
|
|
||||||
},
|
|
||||||
"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": {
|
"textures": {
|
||||||
"0": "block/obsidian",
|
"0": "block/obsidian",
|
||||||
"1": "block/packed_ice",
|
|
||||||
"2": "block/dark_oak_log",
|
"2": "block/dark_oak_log",
|
||||||
"3": "block/white_stained_glass",
|
"6": "create:block/brass_block",
|
||||||
"4": "block/light_blue_stained_glass",
|
"7": "create:block/andesite_casing",
|
||||||
"5": "block/white_concrete_powder"
|
"particle": "create:block/brass_block"
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"name": "Grip Core",
|
"name": "Grip Core",
|
||||||
"from": [ 6.5, -5.0, 6.5 ],
|
"from": [6.5, -5, 6.5],
|
||||||
"to": [ 9.5, 6.0, 9.5 ],
|
"to": [9.5, 6, 9.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#0", "uv": [ 5.0, 1.0, 8.0, 12.0 ] },
|
"north": {"uv": [5, 1, 8, 12], "texture": "#0"},
|
||||||
"east": { "texture": "#0", "uv": [ 2.0, 3.0, 5.0, 14.0 ] },
|
"east": {"uv": [2, 3, 5, 14], "texture": "#0"},
|
||||||
"south": { "texture": "#0", "uv": [ 10.0, 1.0, 13.0, 12.0 ] },
|
"south": {"uv": [10, 1, 13, 12], "texture": "#0"},
|
||||||
"west": { "texture": "#0", "uv": [ 7.0, 1.0, 10.0, 12.0 ] },
|
"west": {"uv": [7, 1, 10, 12], "texture": "#0"},
|
||||||
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 3.0 ] },
|
"up": {"uv": [0, 0, 3, 3], "texture": "#0"},
|
||||||
"down": { "texture": "#0", "uv": [ 5.0, 6.0, 8.0, 9.0 ] }
|
"down": {"uv": [5, 6, 8, 9], "texture": "#0"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Rod Bottom Core",
|
"name": "Rod Bottom Core",
|
||||||
"from": [ 6.5, 8.0, 6.5 ],
|
"from": [6.5, 7, 6.5],
|
||||||
"to": [ 9.5, 17.0, 9.5 ],
|
"to": [9.5, 17, 9.5],
|
||||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
|
"rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#1", "uv": [ 5.0, 7.0, 8.0, 16.0 ] },
|
"north": {"uv": [5, 6, 8, 16], "texture": "#6"},
|
||||||
"east": { "texture": "#1", "uv": [ 7.0, 7.0, 10.0, 16.0 ] },
|
"east": {"uv": [2, 6, 5, 16], "texture": "#6"},
|
||||||
"south": { "texture": "#1", "uv": [ 1.0, 7.0, 4.0, 16.0 ] },
|
"south": {"uv": [11, 6, 14, 16], "texture": "#6"},
|
||||||
"west": { "texture": "#1", "uv": [ 3.0, 7.0, 6.0, 16.0 ] },
|
"west": {"uv": [8, 6, 11, 16], "texture": "#6"},
|
||||||
"up": { "texture": "#1", "uv": [ 12.0, 1.0, 15.0, 4.0 ] },
|
"up": {"uv": [12, 1, 15, 4], "texture": "#6"},
|
||||||
"down": { "texture": "#2", "uv": [ 8.0, 10.0, 11.0, 13.0 ] }
|
"down": {"uv": [8, 10, 11, 13], "texture": "#6"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Grip Cap",
|
"name": "Grip Cap",
|
||||||
"from": [ 6.0, 6.0, 6.0 ],
|
"from": [6, 6, 6],
|
||||||
"to": [ 10.0, 7.0, 10.0 ],
|
"to": [10, 7, 10],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#2", "uv": [ 2.0, 0.0, 6.0, 1.0 ] },
|
"north": {"uv": [2, 0, 6, 1], "texture": "#2"},
|
||||||
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
"east": {"uv": [0, 0, 4, 1], "texture": "#2"},
|
||||||
"south": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
"south": {"uv": [0, 0, 4, 1], "texture": "#2"},
|
||||||
"west": { "texture": "#2", "uv": [ 0.0, 1.0, 4.0, 2.0 ] },
|
"west": {"uv": [0, 1, 4, 2], "texture": "#2"},
|
||||||
"up": { "texture": "#2", "uv": [ 10.0, 15.0, 14.0, 11.0 ] },
|
"up": {"uv": [10, 15, 14, 11], "texture": "#2"},
|
||||||
"down": { "texture": "#2", "uv": [ 5.0, 3.0, 9.0, 7.0 ] }
|
"down": {"uv": [5, 3, 9, 7], "texture": "#2"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Rod Top Core",
|
"name": "Rod Top Core",
|
||||||
"from": [ 6.5, 27.0, 6.5 ],
|
"from": [6.5, 27, 6.5],
|
||||||
"to": [ 9.5, 30.0, 9.5 ],
|
"to": [9.5, 30, 9.5],
|
||||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
|
"rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] },
|
"north": {"uv": [8, 1, 11, 4], "texture": "#6"},
|
||||||
"east": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] },
|
"east": {"uv": [7, 1, 10, 4], "texture": "#6"},
|
||||||
"south": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] },
|
"south": {"uv": [5, 1, 8, 4], "texture": "#6"},
|
||||||
"west": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] },
|
"west": {"uv": [3, 1, 6, 4], "texture": "#6"},
|
||||||
"up": { "texture": "#1", "uv": [ 12.0, 1.0, 15.0, 4.0 ] },
|
"up": {"uv": [12, 1, 15, 4], "texture": "#6"},
|
||||||
"down": { "texture": "#1", "uv": [ 12.0, 1.0, 15.0, 4.0 ] }
|
"down": {"uv": [12, 1, 15, 4], "texture": "#6"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Cap",
|
"name": "Cap",
|
||||||
"from": [ 6.0, 30.0, 6.0 ],
|
"from": [6, 30, 6],
|
||||||
"to": [ 10.0, 31.0, 10.0 ],
|
"to": [10, 31, 10],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
"north": {"uv": [0, 0, 4, 1], "texture": "#2"},
|
||||||
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
"east": {"uv": [0, 0, 4, 1], "texture": "#2"},
|
||||||
"south": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
"south": {"uv": [0, 0, 4, 1], "texture": "#2"},
|
||||||
"west": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
|
"west": {"uv": [0, 0, 4, 1], "texture": "#2"},
|
||||||
"up": { "texture": "#2", "uv": [ 7.0, 10.0, 11.0, 14.0 ] },
|
"up": {"uv": [7, 10, 11, 14], "texture": "#2"},
|
||||||
"down": { "texture": "#2", "uv": [ 7.0, 10.0, 11.0, 14.0 ] }
|
"down": {"uv": [7, 10, 11, 14], "texture": "#2"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Grip Deco",
|
"name": "Grip Deco",
|
||||||
"from": [ 6.3000000193715096, 4.0, 6.3000000193715096 ],
|
"from": [6.3, 4, 6.3],
|
||||||
"to": [ 9.700000025331974, 5.0, 9.700000025331974 ],
|
"to": [9.7, 5, 9.7],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#2", "uv": [ 2.0, 7.0, 5.4000000059604645, 8.0 ] },
|
"north": {"uv": [4, 1, 7, 2], "texture": "#7"},
|
||||||
"east": { "texture": "#2", "uv": [ 4.0, 7.0, 7.4000000059604645, 8.0 ] },
|
"east": {"uv": [4, 1, 7, 2], "texture": "#7"},
|
||||||
"south": { "texture": "#2", "uv": [ 6.0, 7.0, 9.400000005960464, 8.0 ] },
|
"south": {"uv": [4, 1, 7, 2], "texture": "#7"},
|
||||||
"west": { "texture": "#2", "uv": [ 7.0, 7.0, 10.400000005960464, 8.0 ] }
|
"west": {"uv": [4, 1, 7, 2], "texture": "#7"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Rod Bottom Deco 1",
|
"name": "Grip Deco",
|
||||||
"from": [ 7.5, 9.0, 5.5 ],
|
"from": [6.3, -4, 6.3],
|
||||||
"to": [ 8.5, 10.0, 10.5 ],
|
"to": [9.7, -3, 9.7],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
"north": {"uv": [4, 1, 7, 2], "texture": "#7"},
|
||||||
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] },
|
"east": {"uv": [4, 1, 7, 2], "texture": "#7"},
|
||||||
"south": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
"south": {"uv": [4, 1, 7, 2], "texture": "#7"},
|
||||||
"west": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] },
|
"west": {"uv": [4, 1, 7, 2], "texture": "#7"}
|
||||||
"up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 5.0 ] },
|
|
||||||
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 5.0 ] }
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [15, 0, 0],
|
||||||
|
"translation": [-1, 1, 1],
|
||||||
|
"scale": [0.5, 0.5, 0.5]
|
||||||
},
|
},
|
||||||
{
|
"firstperson_righthand": {
|
||||||
"name": "Rod Bottom Deco 2",
|
"rotation": [15, 0, 0],
|
||||||
"from": [ 5.5, 9.0, 7.5 ],
|
"translation": [0, 0, -2],
|
||||||
"to": [ 10.5, 10.0, 8.5 ],
|
"scale": [0.6, 0.6, 0.6]
|
||||||
"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 ] }
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
"ground": {
|
||||||
"name": "Cube",
|
"translation": [0, 4.2, 0],
|
||||||
"from": [ 6.3000000193715096, -4.0, 6.3000000193715096 ],
|
"scale": [0.4, 0.4, 0.4]
|
||||||
"to": [ 9.700000025331974, -3.0, 9.700000025331974 ],
|
},
|
||||||
"faces": {
|
"gui": {
|
||||||
"north": { "texture": "#2", "uv": [ 5.0, 15.0, 8.400000005960464, 16.0 ] },
|
"rotation": [42, 135, 32],
|
||||||
"east": { "texture": "#2", "uv": [ 8.0, 15.0, 11.400000005960464, 16.0 ] },
|
"translation": [-1.7, -1.7, 3],
|
||||||
"south": { "texture": "#2", "uv": [ 8.0, 15.0, 11.400000005960464, 16.0 ] },
|
"scale": [0.8, 0.8, 0.8]
|
||||||
"west": { "texture": "#2", "uv": [ 7.0, 15.0, 3.4000000059604645, 16.0 ] }
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [0, 90, 0],
|
||||||
|
"translation": [0, -5, 0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 640 B |
Binary file not shown.
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 616 B |
|
@ -10,7 +10,7 @@
|
||||||
"item": "create:refined_radiance"
|
"item": "create:refined_radiance"
|
||||||
},
|
},
|
||||||
"L": {
|
"L": {
|
||||||
"tag": "forge:dyes/light_blue"
|
"tag": "forge:ingots/brass"
|
||||||
},
|
},
|
||||||
"O": {
|
"O": {
|
||||||
"item": "minecraft:obsidian"
|
"item": "minecraft:obsidian"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"type": "create:module",
|
"type": "create:module",
|
||||||
"module": "gardens"
|
"module": "curiosities"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -35,7 +35,7 @@
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"type": "create:module",
|
"type": "create:module",
|
||||||
"module": "gardens"
|
"module": "curiosities"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in a new issue