From d72f343fdfa4bba1b88b42e424feb5bb97906b61 Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Sat, 2 Oct 2021 13:02:27 -0700 Subject: [PATCH] Various cleanup - Remove Create namespace restriction in CTSpriteShifter - Add method to register ponder chapter lang - Clean up palette block code; Closes #386 - Clean up tag code - Use Create.asResource in as many places as possible - Organize imports --- src/generated/resources/.cache/cache | 1 + .../data/forge/tags/blocks/cobblestone.json | 14 ++ .../java/com/simibubi/create/AllBlocks.java | 2 +- .../java/com/simibubi/create/AllItems.java | 8 +- .../simibubi/create/AllSpecialTextures.java | 2 +- .../com/simibubi/create/AllSpriteShifts.java | 2 +- .../java/com/simibubi/create/AllTags.java | 194 ++++++++++-------- .../simibubi/create/compat/jei/CreateJEI.java | 2 +- .../jei/category/CreateRecipeCategory.java | 2 +- .../base/CutoutRotatingInstance.java | 1 - .../base/KineticTileInstance.java | 2 +- .../components/flywheel/FlyWheelInstance.java | 2 +- .../flywheel/engine/EngineInstance.java | 2 +- .../BlockMovementChecks.java | 2 +- .../chassis/StickerInstance.java | 2 +- .../structureMovement/glue/GlueInstance.java | 8 +- .../glue/SuperGlueRenderer.java | 2 +- .../render/ContraptionInstanceManager.java | 2 +- .../render/ContraptionRenderDispatcher.java | 1 - .../render/LightVolumeDebugger.java | 6 - .../relays/encased/SplitShaftInstance.java | 2 +- .../relays/gearbox/GearboxInstance.java | 2 +- .../curiosities/armor/CopperArmorItem.java | 6 +- .../weapons/PotatoProjectileEntity.java | 18 +- .../weapons/PotatoProjectileRenderMode.java | 2 + .../weapons/ProperProjectileEntity.java | 40 ---- .../content/logistics/block/FlapData.java | 1 - .../belts/tunnel/BeltTunnelInstance.java | 2 +- .../block/funnel/FunnelInstance.java | 2 +- .../content/palettes/AllPaletteBlocks.java | 18 +- .../content/palettes/PaletteBlockPattern.java | 29 ++- .../palettes/PaletteStoneVariants.java | 8 +- .../palettes/PalettesVariantEntry.java | 41 ++-- .../block/SchematicannonInstance.java | 2 +- .../simibubi/create/events/ClientEvents.java | 6 +- .../advancement/CriterionTriggerBase.java | 6 +- .../block/connected/CTSpriteShiftEntry.java | 2 +- .../block/connected/CTSpriteShifter.java | 38 ++-- .../block/render/SpriteShifter.java | 21 +- .../foundation/data/BuilderTransformers.java | 2 +- .../create/foundation/data/ModelGen.java | 2 +- .../create/foundation/data/WindowGen.java | 2 +- .../create/foundation/gui/AllGuiTextures.java | 2 +- .../foundation/item/ItemDescription.java | 1 - .../foundation/networking/AllPackets.java | 6 +- .../foundation/ponder/PonderLocalization.java | 4 + .../create/foundation/ponder/PonderScene.java | 4 +- .../foundation/render/AllMaterialSpecs.java | 8 +- .../foundation/render/AllProgramSpecs.java | 17 +- .../render/RainbowDebugStateProvider.java | 2 +- .../tileEntity/TileEntityBehaviour.java | 4 +- .../foundation/utility/WorldAttached.java | 2 - 52 files changed, 292 insertions(+), 267 deletions(-) create mode 100644 src/generated/resources/data/forge/tags/blocks/cobblestone.json delete mode 100644 src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index a5943c70d..fb2fc5102 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -3757,6 +3757,7 @@ bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json 6cdeeac1689f7b5bfd9bc40b462143d8eaf3ad0b data/create/tags/items/seats.json 2f4044c2989b9a8aa394c88617d67a6a310e6b1b data/create/tags/items/upright_on_belt.json 50936b211d94167a35ec78c89954082a336b6269 data/create/tags/items/valve_handles.json +05ca51cdc60a5e109b5a0e3b782de13d34ebcb24 data/forge/tags/blocks/cobblestone.json 16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data/forge/tags/blocks/glass/colorless.json 81d3eb40b048160fcc2d6bb7ff12b49276297efd data/forge/tags/blocks/glass_panes.json 4b700ee8aa748c2ec70c29ef1589844879c0deae data/forge/tags/blocks/ores.json diff --git a/src/generated/resources/data/forge/tags/blocks/cobblestone.json b/src/generated/resources/data/forge/tags/blocks/cobblestone.json new file mode 100644 index 000000000..4a5c2c1fb --- /dev/null +++ b/src/generated/resources/data/forge/tags/blocks/cobblestone.json @@ -0,0 +1,14 @@ +{ + "replace": false, + "values": [ + "create:granite_cobblestone", + "create:diorite_cobblestone", + "create:andesite_cobblestone", + "create:limestone_cobblestone", + "create:weathered_limestone_cobblestone", + "create:dolomite_cobblestone", + "create:gabbro_cobblestone", + "create:scoria_cobblestone", + "create:dark_scoria_cobblestone" + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index a990a6d10..aec652b71 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -160,9 +160,9 @@ import com.simibubi.create.content.logistics.block.redstone.StockpileSwitchBlock import com.simibubi.create.content.logistics.item.LecternControllerBlock; import com.simibubi.create.content.schematics.block.SchematicTableBlock; import com.simibubi.create.content.schematics.block.SchematicannonBlock; +import com.simibubi.create.foundation.block.BlockStressDefaults; import com.simibubi.create.foundation.block.DyedBlockList; import com.simibubi.create.foundation.block.ItemUseOverrides; -import com.simibubi.create.foundation.block.BlockStressDefaults; import com.simibubi.create.foundation.data.AssetLookup; import com.simibubi.create.foundation.data.BlockStateGen; import com.simibubi.create.foundation.data.BuilderTransformers; diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 36885956c..5afe68f88 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -3,7 +3,6 @@ package com.simibubi.create; import static com.simibubi.create.AllTags.forgeItemTag; import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS; import static com.simibubi.create.AllTags.AllItemTags.CRUSHED_ORES; -import static com.simibubi.create.AllTags.AllItemTags.NUGGETS; import static com.simibubi.create.AllTags.AllItemTags.PLATES; import static com.simibubi.create.content.AllSections.CURIOSITIES; import static com.simibubi.create.content.AllSections.KINETICS; @@ -64,6 +63,7 @@ import net.minecraft.item.Rarity; import net.minecraft.tags.ITag; import net.minecraft.tags.ItemTags; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.Tags; public class AllItems { @@ -167,9 +167,9 @@ public class AllItems { .register(); public static final ItemEntry COPPER_NUGGET = - taggedIngredient("copper_nugget", forgeItemTag("nuggets/copper"), NUGGETS.tag), - ZINC_NUGGET = taggedIngredient("zinc_nugget", forgeItemTag("nuggets/zinc"), NUGGETS.tag), - BRASS_NUGGET = taggedIngredient("brass_nugget", forgeItemTag("nuggets/brass"), NUGGETS.tag), + taggedIngredient("copper_nugget", forgeItemTag("nuggets/copper"), Tags.Items.NUGGETS), + ZINC_NUGGET = taggedIngredient("zinc_nugget", forgeItemTag("nuggets/zinc"), Tags.Items.NUGGETS), + BRASS_NUGGET = taggedIngredient("brass_nugget", forgeItemTag("nuggets/brass"), Tags.Items.NUGGETS), COPPER_SHEET = taggedIngredient("copper_sheet", forgeItemTag("plates/copper"), PLATES.tag), BRASS_SHEET = taggedIngredient("brass_sheet", forgeItemTag("plates/brass"), PLATES.tag), diff --git a/src/main/java/com/simibubi/create/AllSpecialTextures.java b/src/main/java/com/simibubi/create/AllSpecialTextures.java index 3f0826421..4a0117b8f 100644 --- a/src/main/java/com/simibubi/create/AllSpecialTextures.java +++ b/src/main/java/com/simibubi/create/AllSpecialTextures.java @@ -18,7 +18,7 @@ public enum AllSpecialTextures { private ResourceLocation location; private AllSpecialTextures(String filename) { - location = new ResourceLocation(Create.ID, ASSET_PATH + filename); + location = Create.asResource(ASSET_PATH + filename); } public void bind() { diff --git a/src/main/java/com/simibubi/create/AllSpriteShifts.java b/src/main/java/com/simibubi/create/AllSpriteShifts.java index 94ba43b41..dfae3fdd4 100644 --- a/src/main/java/com/simibubi/create/AllSpriteShifts.java +++ b/src/main/java/com/simibubi/create/AllSpriteShifts.java @@ -78,7 +78,7 @@ public class AllSpriteShifts { // private static void populateMaps() { - WoodType[] supportedWoodTypes = new WoodType[]{ + WoodType[] supportedWoodTypes = new WoodType[] { WoodType.OAK, WoodType.SPRUCE, WoodType.BIRCH, WoodType.ACACIA, WoodType.JUNGLE, WoodType.DARK_OAK, WoodType.CRIMSON, WoodType.WARPED }; diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 0e1668c51..19e148d20 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -27,9 +27,11 @@ import net.minecraft.tags.FluidTags; import net.minecraft.tags.ITag; import net.minecraft.tags.ItemTags; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.Tags; import net.minecraftforge.fml.ModList; public class AllTags { + private static final CreateRegistrate REGISTRATE = Create.registrate() .itemGroup(() -> Create.BASE_CREATIVE_TAB); @@ -61,105 +63,38 @@ public class AllTags { return wrapperFactory.apply(new ResourceLocation(domain, name).toString()); } - public static enum NameSpace { + public enum NameSpace { - MOD(Create.ID), FORGE("forge"), MC("minecraft"), TIC("tconstruct") + MOD(Create.ID), FORGE("forge"), TIC("tconstruct") ; - String id; + public final String id; private NameSpace(String id) { this.id = id; } + } - public static enum AllItemTags { - CRUSHED_ORES(MOD), - SEATS(MOD), - VALVE_HANDLES(MOD), - UPRIGHT_ON_BELT(MOD), - SANDPAPER(MOD), - CREATE_INGOTS(MOD), - BEACON_PAYMENT(FORGE), - INGOTS(FORGE), - NUGGETS(FORGE), - PLATES(FORGE), - COBBLESTONE(FORGE) + public enum AllBlockTags { - ; - - public ITag.INamedTag tag; - - private AllItemTags(NameSpace namespace) { - this(namespace, ""); - } - - private AllItemTags(NameSpace namespace, String path) { - tag = ItemTags.bind( - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name())).toString()); - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)); - } - - public boolean matches(ItemStack stack) { - return tag.contains(stack.getItem()); - } - - public void add(Item... values) { - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag) - .add(values)); - } - - public void includeIn(AllItemTags parent) { - REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(parent.tag) - .addTag(tag)); - } - } - - public static enum AllFluidTags { - NO_INFINITE_DRAINING, - HONEY(FORGE) - - ; - - public ITag.INamedTag tag; - - private AllFluidTags() { - this(MOD, ""); - } - - private AllFluidTags(NameSpace namespace) { - this(namespace, ""); - } - - private AllFluidTags(NameSpace namespace, String path) { - tag = FluidTags.createOptional( - new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name()))); - } - - public boolean matches(Fluid fluid) { - return fluid != null && fluid.is(tag); - } - - static void loadClass() {} - } - - public static enum AllBlockTags { - WINDMILL_SAILS, - FAN_HEATERS, - WINDOWABLE, BRITTLE, - SEATS, - SAILS, - VALVE_HANDLES, + FAN_HEATERS, FAN_TRANSPARENT, SAFE_NBT, - SLIMY_LOGS(TIC), + SAILS, + SEATS, + VALVE_HANDLES, + WINDMILL_SAILS, + WINDOWABLE, WRENCH_PICKUP, + SLIMY_LOGS(TIC), + ; - public ITag.INamedTag tag; + public final ITag.INamedTag tag; private AllBlockTags() { this(MOD, ""); @@ -186,25 +121,111 @@ public class AllTags { return tag.contains(block.getBlock()); } - public void includeIn(AllBlockTags parent) { - REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(parent.tag) + public void add(Block... values) { + REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) + .add(values)); + } + + public void includeIn(ITag.INamedTag parent) { + REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(parent) .addTag(tag)); } + public void includeIn(AllBlockTags parent) { + includeIn(parent.tag); + } + public void includeAll(ITag.INamedTag child) { REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) .addTag(child)); } - public void add(Block... values) { - REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag) + } + + public enum AllItemTags { + + CREATE_INGOTS(), + CRUSHED_ORES(), + SANDPAPER(), + SEATS(), + UPRIGHT_ON_BELT(), + VALVE_HANDLES(), + + BEACON_PAYMENT(FORGE), + PLATES(FORGE) + + ; + + public final ITag.INamedTag tag; + + private AllItemTags() { + this(MOD, ""); + } + + private AllItemTags(NameSpace namespace) { + this(namespace, ""); + } + + private AllItemTags(NameSpace namespace, String path) { + tag = ItemTags.bind( + new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name())).toString()); + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)); + } + + public boolean matches(ItemStack stack) { + return tag.contains(stack.getItem()); + } + + public void add(Item... values) { + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag) .add(values)); } + + public void includeIn(ITag.INamedTag parent) { + REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(parent) + .addTag(tag)); + } + + public void includeIn(AllItemTags parent) { + includeIn(parent.tag); + } + + } + + public enum AllFluidTags { + + NO_INFINITE_DRAINING, + + HONEY(FORGE) + + ; + + public final ITag.INamedTag tag; + + private AllFluidTags() { + this(MOD, ""); + } + + private AllFluidTags(NameSpace namespace) { + this(namespace, ""); + } + + private AllFluidTags(NameSpace namespace, String path) { + tag = FluidTags.createOptional( + new ResourceLocation(namespace.id, (path.isEmpty() ? "" : path + "/") + Lang.asId(name()))); + } + + public boolean matches(Fluid fluid) { + return fluid != null && fluid.is(tag); + } + + private static void loadClass() {} + } public static void register() { AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT); - AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.INGOTS); + AllItemTags.CREATE_INGOTS.includeIn(Tags.Items.INGOTS); AllItemTags.UPRIGHT_ON_BELT.add(Items.GLASS_BOTTLE, Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION, Items.HONEY_BOTTLE, Items.CAKE); @@ -231,4 +252,5 @@ public class AllTags { AllFluidTags.loadClass(); } + } 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 2cf7dcf90..3f00139d7 100644 --- a/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java +++ b/src/main/java/com/simibubi/create/compat/jei/CreateJEI.java @@ -78,7 +78,7 @@ import net.minecraftforge.fml.ModList; @SuppressWarnings("unused") public class CreateJEI implements IModPlugin { - private static final ResourceLocation ID = new ResourceLocation(Create.ID, "jei_plugin"); + private static final ResourceLocation ID = Create.asResource("jei_plugin"); public IIngredientManager ingredientManager; private final List> allCategories = new ArrayList<>(); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 359c4ee06..a309a6955 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -45,7 +45,7 @@ public abstract class CreateRecipeCategory> implements IRec } public void setCategoryId(String name) { - this.uid = new ResourceLocation(Create.ID, name); + this.uid = Create.asResource(name); this.name = name; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java index c8f3d4335..65b164208 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/CutoutRotatingInstance.java @@ -1,6 +1,5 @@ package com.simibubi.create.content.contraptions.base; -import com.jozufozu.flywheel.backend.instancing.Instancer; import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.foundation.render.AllMaterialSpecs; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java index c845b8a48..9a2f61bd9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java @@ -1,8 +1,8 @@ package com.simibubi.create.content.contraptions.base; +import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; -import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel; import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java index ea35ee0e3..5c20fe6db 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java @@ -8,8 +8,8 @@ import java.util.List; import com.google.common.collect.Lists; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.InstanceData; -import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.instancing.Instancer; +import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java index 230960d90..cb02e4da7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineInstance.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.contraptions.components.flywheel.engine; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java index c1b5b796b..3635706fa 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementChecks.java @@ -74,7 +74,7 @@ public class BlockMovementChecks { private static final List BRITTLE_CHECKS = new ArrayList<>(); private static final List ATTACHED_CHECKS = new ArrayList<>(); private static final List NOT_SUPPORTIVE_CHECKS = new ArrayList<>(); - public static final ResourceLocation NON_MOVABLE = new ResourceLocation(Create.ID, "non_movable"); + public static final ResourceLocation NON_MOVABLE = Create.asResource("non_movable"); // Registration // Add new checks to the front instead of the end diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java index 050fbc56d..250f73941 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerInstance.java @@ -1,8 +1,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement.chassis; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java index 751fe2236..c4c560fb9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueInstance.java @@ -4,16 +4,12 @@ import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.backend.instancing.ITickableInstance; import com.jozufozu.flywheel.backend.instancing.Instancer; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; import com.jozufozu.flywheel.backend.material.MaterialGroup; -import com.jozufozu.flywheel.backend.model.BufferedModel; -import com.jozufozu.flywheel.backend.model.ElementBuffer; -import com.jozufozu.flywheel.backend.model.IndexedModel; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.state.TextureRenderState; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.QuadConverter; import com.jozufozu.flywheel.core.instancing.ConditionalInstance; import com.jozufozu.flywheel.core.materials.OrientedData; import com.jozufozu.flywheel.core.model.IModel; @@ -36,7 +32,7 @@ import net.minecraft.world.LightType; public class GlueInstance extends EntityInstance implements ITickableInstance { private static final boolean USE_ATLAS = false; - private static final ResourceLocation TEXTURE = new ResourceLocation(Create.ID, "textures/entity/super_glue/slime.png"); + private static final ResourceLocation TEXTURE = Create.asResource("textures/entity/super_glue/slime.png"); private final Quaternion rotation; protected ConditionalInstance model; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java index 10b91afec..9c2ad5ef3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java @@ -30,7 +30,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class SuperGlueRenderer extends EntityRenderer { - private ResourceLocation regular = new ResourceLocation(Create.ID, "textures/entity/super_glue/slime.png"); + private ResourceLocation regular = Create.asResource("textures/entity/super_glue/slime.png"); private float[] insideQuad; private float[] outsideQuad; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java index 47cd9258a..261aca5d5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionInstanceManager.java @@ -7,8 +7,8 @@ import javax.annotation.Nullable; import org.apache.commons.lang3.tuple.Pair; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllMovementBehaviours; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java index 98e5e9fbb..bb906a32f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java @@ -18,7 +18,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Abs import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.render.Compartment; import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.TileEntityRenderHelper; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java index 82f6e64e6..c495e0dbe 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/LightVolumeDebugger.java @@ -1,13 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.render; -import java.util.ArrayList; - -import com.jozufozu.flywheel.light.GridAlignedBB; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; -import com.simibubi.create.foundation.utility.AnimationTickHolder; -import com.simibubi.create.foundation.utility.Pair; -import com.simibubi.create.foundation.utility.outliner.AABBOutline; public class LightVolumeDebugger { public static void render(MatrixStack ms, SuperRenderTypeBuffer buffer) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java index 73ed999ca..dc5193c81 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java @@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.relays.encased; import java.util.ArrayList; import com.jozufozu.flywheel.backend.instancing.InstanceData; -import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.instancing.Instancer; +import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.IRotate; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java index 0b86084aa..da4b1f8f6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java @@ -4,8 +4,8 @@ import java.util.EnumMap; import java.util.Map; import com.jozufozu.flywheel.backend.instancing.InstanceData; -import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.instancing.Instancer; +import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileInstance; diff --git a/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java b/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java index 5aa6098db..d036b562e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/armor/CopperArmorItem.java @@ -7,9 +7,13 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; public class CopperArmorItem extends ArmorItem { + public static final ResourceLocation TEXTURE = Create.asResource("textures/models/armor/copper.png"); + private static final String TEXTURE_STRING = TEXTURE.toString(); + public CopperArmorItem(EquipmentSlotType p_i48534_2_, Properties p_i48534_3_) { super(AllArmorMaterials.COPPER, p_i48534_2_, p_i48534_3_.stacksTo(1)); } @@ -23,7 +27,7 @@ public class CopperArmorItem extends ArmorItem { @Override public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { - return String.format("%s:textures/models/armor/copper.png", Create.ID); + return TEXTURE_STRING; } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java index b6e188202..73c5d924d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileEntity.java @@ -39,17 +39,17 @@ import net.minecraftforge.items.ItemHandlerHelper; public class PotatoProjectileEntity extends DamagingProjectileEntity implements IEntityAdditionalSpawnData { - PotatoCannonProjectileType type; - ItemStack stack = ItemStack.EMPTY; + protected PotatoCannonProjectileType type; + protected ItemStack stack = ItemStack.EMPTY; - Entity stuckEntity; - Vector3d stuckOffset; - PotatoProjectileRenderMode stuckRenderer; - double stuckFallSpeed; + protected Entity stuckEntity; + protected Vector3d stuckOffset; + protected PotatoProjectileRenderMode stuckRenderer; + protected double stuckFallSpeed; - float additionalDamageMult = 1; - float additionalKnockback = 0; - float recoveryChance = 0; + protected float additionalDamageMult = 1; + protected float additionalKnockback = 0; + protected float recoveryChance = 0; public PotatoProjectileEntity(EntityType type, World world) { super(type, world); diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java index 799ed35e1..aa8111556 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java +++ b/src/main/java/com/simibubi/create/content/curiosities/weapons/PotatoProjectileRenderMode.java @@ -1,5 +1,7 @@ package com.simibubi.create.content.curiosities.weapons; +import static com.simibubi.create.content.curiosities.weapons.PotatoProjectileRenderMode.entityRandom; + import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.foundation.utility.AngleHelper; diff --git a/src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java deleted file mode 100644 index e8271d2f4..000000000 --- a/src/main/java/com/simibubi/create/content/curiosities/weapons/ProperProjectileEntity.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.simibubi.create.content.curiosities.weapons; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.nbt.CompoundNBT; -import net.minecraft.network.IPacket; -import net.minecraft.world.World; - -public abstract class ProperProjectileEntity extends Entity { - - public ProperProjectileEntity(EntityType p_i48580_1_, World p_i48580_2_) { - super(p_i48580_1_, p_i48580_2_); - // TODO Auto-generated constructor stub - } - - @Override - protected void defineSynchedData() { - // TODO Auto-generated method stub - - } - - @Override - protected void readAdditionalSaveData(CompoundNBT p_70037_1_) { - // TODO Auto-generated method stub - - } - - @Override - protected void addAdditionalSaveData(CompoundNBT p_213281_1_) { - // TODO Auto-generated method stub - - } - - @Override - public IPacket getAddEntityPacket() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java b/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java index 5dfe87e95..9ce6469a3 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/FlapData.java @@ -7,7 +7,6 @@ import com.jozufozu.flywheel.core.materials.IFlatLight; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3f; -import net.minecraft.util.math.vector.Vector3i; public class FlapData extends InstanceData implements IFlatLight { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java index 05b4a1f78..3ad030006 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java @@ -8,8 +8,8 @@ import java.util.Map; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.Instancer; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.logistics.block.FlapData; import com.simibubi.create.foundation.gui.widgets.InterpolatedValue; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java index 470e56bda..3be5421f1 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.InstanceData; import com.jozufozu.flywheel.backend.instancing.Instancer; -import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; +import com.jozufozu.flywheel.backend.material.MaterialManager; import com.jozufozu.flywheel.core.PartialModel; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.logistics.block.FlapData; diff --git a/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java b/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java index 0e8bae19e..8dcea9a50 100644 --- a/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java +++ b/src/main/java/com/simibubi/create/content/palettes/AllPaletteBlocks.java @@ -96,13 +96,13 @@ public class AllPaletteBlocks { // Vanilla stone variant patterns public static final PalettesVariantEntry GRANITE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.GRANITE, PaletteBlockPattern.VANILLA_RANGE, () -> Blocks.GRANITE); + new PalettesVariantEntry(PaletteStoneVariants.GRANITE, PaletteBlockPattern.VANILLA_RANGE); public static final PalettesVariantEntry DIORITE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.DIORITE, PaletteBlockPattern.VANILLA_RANGE, () -> Blocks.DIORITE); + new PalettesVariantEntry(PaletteStoneVariants.DIORITE, PaletteBlockPattern.VANILLA_RANGE); public static final PalettesVariantEntry ANDESITE_VARIANTS = new PalettesVariantEntry(PaletteStoneVariants.ANDESITE, - PaletteBlockPattern.VANILLA_RANGE, () -> Blocks.ANDESITE); + PaletteBlockPattern.VANILLA_RANGE); // Create stone variants @@ -119,7 +119,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry LIMESTONE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.LIMESTONE, PaletteBlockPattern.STANDARD_RANGE, LIMESTONE); + new PalettesVariantEntry(PaletteStoneVariants.LIMESTONE, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry WEATHERED_LIMESTONE = REGISTRATE.baseBlock("weathered_limestone", Block::new, () -> Blocks.SANDSTONE, true) @@ -128,7 +128,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry WEATHERED_LIMESTONE_VARIANTS = new PalettesVariantEntry( - PaletteStoneVariants.WEATHERED_LIMESTONE, PaletteBlockPattern.STANDARD_RANGE, WEATHERED_LIMESTONE); + PaletteStoneVariants.WEATHERED_LIMESTONE, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry DOLOMITE = REGISTRATE.baseBlock("dolomite", Block::new, () -> Blocks.QUARTZ_BLOCK, true) @@ -137,7 +137,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry DOLOMITE_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.DOLOMITE, PaletteBlockPattern.STANDARD_RANGE, DOLOMITE); + new PalettesVariantEntry(PaletteStoneVariants.DOLOMITE, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry GABBRO = REGISTRATE.baseBlock("gabbro", Block::new, () -> Blocks.ANDESITE, true) @@ -146,7 +146,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry GABBRO_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.GABBRO, PaletteBlockPattern.STANDARD_RANGE, GABBRO); + new PalettesVariantEntry(PaletteStoneVariants.GABBRO, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry SCORIA = REGISTRATE.baseBlock("scoria", Block::new, () -> Blocks.ANDESITE, true) @@ -163,7 +163,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry SCORIA_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.SCORIA, PaletteBlockPattern.STANDARD_RANGE, SCORIA); + new PalettesVariantEntry(PaletteStoneVariants.SCORIA, PaletteBlockPattern.STANDARD_RANGE); public static final BlockEntry DARK_SCORIA = REGISTRATE.baseBlock("dark_scoria", Block::new, () -> Blocks.ANDESITE, false) @@ -171,7 +171,7 @@ public class AllPaletteBlocks { .register(); public static final PalettesVariantEntry DARK_SCORIA_VARIANTS = - new PalettesVariantEntry(PaletteStoneVariants.DARK_SCORIA, PaletteBlockPattern.STANDARD_RANGE, DARK_SCORIA); + new PalettesVariantEntry(PaletteStoneVariants.DARK_SCORIA, PaletteBlockPattern.STANDARD_RANGE); private static NonNullBiConsumer cobblestoneLoot(PaletteStoneVariants variant) { return (loot, block) -> loot.add(block, RegistrateBlockLootTables.droppingWithSilkTouch(block, diff --git a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java index 91819c83d..72f3b6b56 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java +++ b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPattern.java @@ -30,16 +30,21 @@ import net.minecraft.block.RotatedPillarBlock; import net.minecraft.client.renderer.RenderType; import net.minecraft.data.CookingRecipeBuilder; import net.minecraft.data.ShapedRecipeBuilder; +import net.minecraft.item.Item; +import net.minecraft.tags.ITag; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.model.generators.ModelFile; +import net.minecraftforge.common.Tags; public class PaletteBlockPattern { public static final PaletteBlockPattern COBBLESTONE = create("cobblestone", SUFFIX, ALL_PARTIALS) + .blockTags(Tags.Blocks.COBBLESTONE) + .itemTags(Tags.Items.COBBLESTONE) .addRecipes(v -> (c, p) -> { DataIngredient ingredient = DataIngredient.items(c.get()); Block result = v.getBaseBlock().get(); @@ -111,6 +116,8 @@ public class PaletteBlockPattern { private String id; private boolean isTranslucent; private boolean hasFoliage; + private ITag.INamedTag[] blockTags; + private ITag.INamedTag[] itemTags; private Optional> ctBehaviour; private IPatternBlockStateGenerator blockStateGenerator; @@ -149,6 +156,14 @@ public class PaletteBlockPattern { return hasFoliage; } + public ITag.INamedTag[] getBlockTags() { + return blockTags; + } + + public ITag.INamedTag[] getItemTags() { + return itemTags; + } + public NonNullFunction getBlockFactory() { return blockFactory; } @@ -198,6 +213,18 @@ public class PaletteBlockPattern { return this; } + @SafeVarargs + private final PaletteBlockPattern blockTags(ITag.INamedTag... tags) { + blockTags = tags; + return this; + } + + @SafeVarargs + private final PaletteBlockPattern itemTags(ITag.INamedTag... tags) { + itemTags = tags; + return this; + } + private PaletteBlockPattern connectedTextures(Function factory) { this.ctBehaviour = Optional.of(factory); return this; @@ -300,7 +327,7 @@ public class PaletteBlockPattern { // Textures with connectability, used by Spriteshifter - public static enum CTs { + public enum CTs { POLISHED(CTType.OMNIDIRECTIONAL), LAYERED(CTType.HORIZONTAL) diff --git a/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java b/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java index f15d019f3..e7933fcf1 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java +++ b/src/main/java/com/simibubi/create/content/palettes/PaletteStoneVariants.java @@ -2,6 +2,8 @@ package com.simibubi.create.content.palettes; import java.util.function.Supplier; +import com.tterrag.registrate.util.nullness.NonNullSupplier; + import net.minecraft.block.Block; import net.minecraft.block.Blocks; @@ -19,15 +21,15 @@ public enum PaletteStoneVariants { ; - private Supplier> baseBlock; + private NonNullSupplier> baseBlock; private Supplier variants; - private PaletteStoneVariants(Supplier> baseBlock, Supplier variants) { + private PaletteStoneVariants(NonNullSupplier> baseBlock, Supplier variants) { this.baseBlock = baseBlock; this.variants = variants; } - public Supplier getBaseBlock() { + public NonNullSupplier getBaseBlock() { return baseBlock.get(); } diff --git a/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java b/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java index cecd78294..62a91346a 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java +++ b/src/main/java/com/simibubi/create/content/palettes/PalettesVariantEntry.java @@ -3,32 +3,35 @@ package com.simibubi.create.content.palettes; import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures; import com.google.common.collect.ImmutableList; -import com.simibubi.create.AllTags; import com.simibubi.create.Create; import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.utility.ColorHandlers; import com.simibubi.create.foundation.utility.Lang; import com.tterrag.registrate.builders.BlockBuilder; +import com.tterrag.registrate.builders.ItemBuilder; import com.tterrag.registrate.util.DataIngredient; import com.tterrag.registrate.util.entry.BlockEntry; import com.tterrag.registrate.util.nullness.NonNullSupplier; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderType; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.tags.ITag; public class PalettesVariantEntry { - public ImmutableList> registeredBlocks; - public ImmutableList> registeredPartials; + public final ImmutableList> registeredBlocks; + public final ImmutableList> registeredPartials; - public PalettesVariantEntry(PaletteStoneVariants variant, PaletteBlockPattern[] patterns, - NonNullSupplier initialProperties) { + public PalettesVariantEntry(PaletteStoneVariants variant, PaletteBlockPattern[] patterns) { String name = Lang.asId(variant.name()); + NonNullSupplier initialProperties = variant.getBaseBlock(); ImmutableList.Builder> registeredBlocks = ImmutableList.builder(); ImmutableList.Builder> registeredPartials = ImmutableList.builder(); + CreateRegistrate registrate = Create.registrate(); for (PaletteBlockPattern pattern : patterns) { - CreateRegistrate registrate = Create.registrate(); BlockBuilder builder = registrate.block(pattern.createName(name), pattern.getBlockFactory()) .initialProperties(initialProperties) @@ -36,12 +39,24 @@ public class PalettesVariantEntry { .apply(pattern) .apply(name)::accept); + ItemBuilder> itemBuilder = + builder.item(); + + ITag.INamedTag[] blockTags = pattern.getBlockTags(); + if (blockTags != null) { + builder.tag(blockTags); + } + ITag.INamedTag[] itemTags = pattern.getItemTags(); + if (itemTags != null) { + itemBuilder.tag(itemTags); + } + if (pattern.isTranslucent()) builder.addLayer(() -> RenderType::translucent); - if (pattern == PaletteBlockPattern.COBBLESTONE) - builder.item().tag(AllTags.AllItemTags.COBBLESTONE.tag); - if (pattern.hasFoliage()) + if (pattern.hasFoliage()) { builder.color(() -> ColorHandlers::getGrassyBlock); + itemBuilder.color(() -> ColorHandlers::getGrassyItem); + } pattern.createCTBehaviour(variant) .ifPresent(b -> builder.onRegister(connectedTextures(b))); @@ -51,13 +66,7 @@ public class PalettesVariantEntry { pattern.addRecipes(variant, c, p); }); - if (pattern.hasFoliage()) - builder.item() - .color(() -> ColorHandlers::getGrassyItem) - .build(); - else - builder.simpleItem(); - + itemBuilder.register(); BlockEntry block = builder.register(); registeredBlocks.add(block); diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java index 3d64468c1..0d9e73822 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonInstance.java @@ -1,9 +1,9 @@ package com.simibubi.create.content.schematics.block; import com.jozufozu.flywheel.backend.instancing.IDynamicInstance; +import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.backend.material.InstanceMaterial; import com.jozufozu.flywheel.backend.material.MaterialManager; -import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; import com.jozufozu.flywheel.core.materials.ModelData; import com.jozufozu.flywheel.util.transform.MatrixTransformStack; import com.mojang.blaze3d.matrix.MatrixStack; diff --git a/src/main/java/com/simibubi/create/events/ClientEvents.java b/src/main/java/com/simibubi/create/events/ClientEvents.java index c25d99b98..41edcf514 100644 --- a/src/main/java/com/simibubi/create/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/events/ClientEvents.java @@ -92,8 +92,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; @EventBusSubscriber(value = Dist.CLIENT) public class ClientEvents { - private static final String itemPrefix = "item." + Create.ID; - private static final String blockPrefix = "block." + Create.ID; + private static final String ITEM_PREFIX = "item." + Create.ID; + private static final String BLOCK_PREFIX = "block." + Create.ID; @SubscribeEvent public static void onTick(ClientTickEvent event) { @@ -243,7 +243,7 @@ public class ClientEvents { String translationKey = stack.getItem() .getDescriptionId(stack); - if (translationKey.startsWith(itemPrefix) || translationKey.startsWith(blockPrefix)) + if (translationKey.startsWith(ITEM_PREFIX) || translationKey.startsWith(BLOCK_PREFIX)) if (TooltipHelper.hasTooltip(stack, event.getPlayer())) { List itemTooltip = event.getToolTip(); List toolTip = new ArrayList<>(); diff --git a/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java b/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java index c6389a6cb..e3ab6d356 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java @@ -26,10 +26,10 @@ import net.minecraft.util.ResourceLocation; public abstract class CriterionTriggerBase implements ICriterionTrigger { public CriterionTriggerBase(String id) { - this.ID = new ResourceLocation(Create.ID, id); + this.id = Create.asResource(id); } - private final ResourceLocation ID; + private final ResourceLocation id; protected final Map>> listeners = Maps.newHashMap(); @Override @@ -57,7 +57,7 @@ public abstract class CriterionTriggerBase> suppliers) { diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java index 40d6bf434..c1cf56332 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShiftEntry.java @@ -7,7 +7,7 @@ import com.simibubi.create.foundation.render.SuperByteBuffer; public abstract class CTSpriteShiftEntry extends SpriteShiftEntry { - int textureSheetSize; + protected int textureSheetSize; public CTSpriteShiftEntry(int sheetSize) { this.textureSheetSize = sheetSize; diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java index 2b09a995a..588656377 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/CTSpriteShifter.java @@ -7,33 +7,25 @@ import net.minecraft.util.ResourceLocation; public class CTSpriteShifter extends SpriteShifter { - public enum CTType { - OMNIDIRECTIONAL, HORIZONTAL, VERTICAL, CROSS; + public static CTSpriteShiftEntry getCT(CTType type, ResourceLocation blockTexture, ResourceLocation connectedTexture) { + String key = type.name() + ":" + blockTexture + "->" + connectedTexture; + if (ENTRY_CACHE.containsKey(key)) + return (CTSpriteShiftEntry) ENTRY_CACHE.get(key); + + CTSpriteShiftEntry entry = create(type); + entry.set(blockTexture, connectedTexture); + ENTRY_CACHE.put(key, entry); + return entry; + } + + public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName, String connectedTextureName) { + return getCT(type, Create.asResource("block/" + blockTextureName), Create.asResource("block/" + connectedTextureName + "_connected")); } public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName) { return getCT(type, blockTextureName, blockTextureName); } - public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName, String connectedTextureName) { - return getCT(type, new ResourceLocation(Create.ID, "block/" + blockTextureName), connectedTextureName); - } - - public static CTSpriteShiftEntry getCT(CTType type, ResourceLocation blockTexture, String connectedTextureName) { - String targetLocation = "block/" + connectedTextureName + "_connected"; - String key = - type.name() + ":" + blockTexture.getNamespace() + ":" + blockTexture.getPath() + "->" + targetLocation; - if (textures.containsKey(key)) - return (CTSpriteShiftEntry) textures.get(key); - - CTSpriteShiftEntry entry = create(type); - ResourceLocation targetTextureLocation = new ResourceLocation(Create.ID, targetLocation); - entry.set(blockTexture, targetTextureLocation); - - textures.put(key, entry); - return entry; - } - private static CTSpriteShiftEntry create(CTType type) { switch (type) { case HORIZONTAL: @@ -49,4 +41,8 @@ public class CTSpriteShifter extends SpriteShifter { } } + public enum CTType { + OMNIDIRECTIONAL, HORIZONTAL, VERTICAL, CROSS; + } + } diff --git a/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java b/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java index a4f0d19c4..d1e88676e 100644 --- a/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java +++ b/src/main/java/com/simibubi/create/foundation/block/render/SpriteShifter.java @@ -11,26 +11,29 @@ import net.minecraft.util.ResourceLocation; public class SpriteShifter { - protected static Map textures = new HashMap<>(); + protected static final Map ENTRY_CACHE = new HashMap<>(); - public static SpriteShiftEntry get(String originalLocation, String targetLocation) { + public static SpriteShiftEntry get(ResourceLocation originalLocation, ResourceLocation targetLocation) { String key = originalLocation + "->" + targetLocation; - if (textures.containsKey(key)) - return textures.get(key); + if (ENTRY_CACHE.containsKey(key)) + return ENTRY_CACHE.get(key); SpriteShiftEntry entry = new SpriteShiftEntry(); - entry.originalTextureLocation = new ResourceLocation(Create.ID, originalLocation); - entry.targetTextureLocation = new ResourceLocation(Create.ID, targetLocation); - textures.put(key, entry); + entry.set(originalLocation, targetLocation); + ENTRY_CACHE.put(key, entry); return entry; } + public static SpriteShiftEntry get(String originalLocation, String targetLocation) { + return get(Create.asResource(originalLocation), Create.asResource(targetLocation)); + } + public static void reloadUVs() { - textures.values().forEach(SpriteShiftEntry::loadTextures); + ENTRY_CACHE.values().forEach(SpriteShiftEntry::loadTextures); } public static List getAllTargetSprites() { - return textures.values().stream().map(SpriteShiftEntry::getTargetResourceLocation).collect(Collectors.toList()); + return ENTRY_CACHE.values().stream().map(SpriteShiftEntry::getTargetResourceLocation).collect(Collectors.toList()); } } diff --git a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java index be2439fb0..7f837a738 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java +++ b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java @@ -22,8 +22,8 @@ import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock.Shape; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelItem; import com.simibubi.create.content.logistics.block.inventories.CrateBlock; -import com.simibubi.create.foundation.block.ItemUseOverrides; import com.simibubi.create.foundation.block.BlockStressDefaults; +import com.simibubi.create.foundation.block.ItemUseOverrides; import com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry; import com.tterrag.registrate.builders.BlockBuilder; import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; diff --git a/src/main/java/com/simibubi/create/foundation/data/ModelGen.java b/src/main/java/com/simibubi/create/foundation/data/ModelGen.java index ff8cf6679..b99a63bb1 100644 --- a/src/main/java/com/simibubi/create/foundation/data/ModelGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/ModelGen.java @@ -21,7 +21,7 @@ public class ModelGen { public static ModelFile createOvergrown(DataGenContext ctx, BlockStateProvider prov, ResourceLocation side, ResourceLocation top, ResourceLocation bottom, ResourceLocation overlay) { return prov.models() - .withExistingParent(ctx.getName(), new ResourceLocation(Create.ID, "block/overgrown")) + .withExistingParent(ctx.getName(), Create.asResource("block/overgrown")) .texture("particle", side) .texture("side", side) .texture("top", top) diff --git a/src/main/java/com/simibubi/create/foundation/data/WindowGen.java b/src/main/java/com/simibubi/create/foundation/data/WindowGen.java index 8139a6f9b..2e3c6dbc6 100644 --- a/src/main/java/com/simibubi/create/foundation/data/WindowGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/WindowGen.java @@ -213,7 +213,7 @@ public class WindowGen { .loot((t, g) -> t.dropWhenSilkTouch(g)) .item() .tag(Tags.Items.GLASS_PANES) - .model((c, p) -> p.withExistingParent(c.getName(), new ResourceLocation(Create.ID, "item/pane")) + .model((c, p) -> p.withExistingParent(c.getName(), Create.asResource("item/pane")) .texture("pane", sideTexture) .texture("edge", topTexture)) .build() diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java index 3998c7258..9ff757fdf 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java @@ -120,7 +120,7 @@ public enum AllGuiTextures implements IScreenRenderable { } private AllGuiTextures(String location, int startX, int startY, int width, int height) { - this.location = new ResourceLocation(Create.ID, "textures/gui/" + location); + this.location = Create.asResource("textures/gui/" + location); this.width = width; this.height = height; this.startX = startX; diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java index 571838583..2b8bac433 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.IRotate.SpeedLevel; diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index 81c9a9a2a..06add7c5e 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -25,8 +25,8 @@ import com.simibubi.create.content.curiosities.bell.SoulPulseEffectPacket; import com.simibubi.create.content.curiosities.symmetry.SymmetryEffectPacket; import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket; import com.simibubi.create.content.curiosities.tools.ExtendoGripInteractionPacket; -import com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; import com.simibubi.create.content.curiosities.weapons.PotatoCannonPacket; +import com.simibubi.create.content.curiosities.weapons.PotatoProjectileTypeManager; import com.simibubi.create.content.curiosities.zapper.ZapperBeamPacket; import com.simibubi.create.content.logistics.block.depot.EjectorElytraPacket; import com.simibubi.create.content.logistics.block.depot.EjectorPlacementPacket; @@ -122,8 +122,8 @@ public enum AllPackets { ; - public static final ResourceLocation CHANNEL_NAME = new ResourceLocation(Create.ID, "network"); - public static final String NETWORK_VERSION = new ResourceLocation(Create.ID, "1").toString(); + public static final ResourceLocation CHANNEL_NAME = Create.asResource("network"); + public static final String NETWORK_VERSION = Create.asResource("1").toString(); public static SimpleChannel channel; private LoadedPacket packet; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java index 8b5bb3d97..9201555e2 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderLocalization.java @@ -34,6 +34,10 @@ public class PonderLocalization { TAG.put(key, Couple.create(enUS, description)); } + public static void registerChapter(ResourceLocation key, String enUS) { + CHAPTER.put(key, enUS); + } + public static void registerSpecific(ResourceLocation sceneId, String key, String enUS) { SPECIFIC.computeIfAbsent(sceneId, $ -> new HashMap<>()) .put(key, enUS); diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java index b91839fd8..c6a644f22 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderScene.java @@ -13,6 +13,8 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; +import javax.annotation.Nullable; + import org.apache.commons.lang3.mutable.MutableDouble; import org.apache.commons.lang3.mutable.MutableObject; @@ -52,8 +54,6 @@ import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3i; import net.minecraft.util.math.vector.Vector4f; -import javax.annotation.Nullable; - public class PonderScene { public static final String TITLE_KEY = "header"; diff --git a/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java b/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java index 82e1a5928..4017777fc 100644 --- a/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java +++ b/src/main/java/com/simibubi/create/foundation/render/AllMaterialSpecs.java @@ -32,9 +32,9 @@ public class AllMaterialSpecs { } public static class Locations { - public static final ResourceLocation ROTATING = new ResourceLocation(Create.ID, "rotating"); - public static final ResourceLocation BELTS = new ResourceLocation(Create.ID, "belts"); - public static final ResourceLocation ACTORS = new ResourceLocation(Create.ID, "actors"); - public static final ResourceLocation FLAPS = new ResourceLocation(Create.ID, "flaps"); + public static final ResourceLocation ROTATING = Create.asResource("rotating"); + public static final ResourceLocation BELTS = Create.asResource("belts"); + public static final ResourceLocation ACTORS = Create.asResource("actors"); + public static final ResourceLocation FLAPS = Create.asResource("flaps"); } } diff --git a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java index 6df22f622..5dd47e831 100644 --- a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java +++ b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java @@ -1,19 +1,16 @@ package com.simibubi.create.foundation.render; -import com.simibubi.create.Create; +import static com.simibubi.create.Create.asResource; import net.minecraft.util.ResourceLocation; public class AllProgramSpecs { - public static final ResourceLocation ROTATING = loc("rotating"); - public static final ResourceLocation CHROMATIC = loc("chromatic"); - public static final ResourceLocation BELT = loc("belt"); - public static final ResourceLocation FLAPS = loc("flap"); - public static final ResourceLocation STRUCTURE = loc("contraption_structure"); - public static final ResourceLocation ACTOR = loc("contraption_actor"); + public static final ResourceLocation ROTATING = asResource("rotating"); + public static final ResourceLocation CHROMATIC = asResource("chromatic"); + public static final ResourceLocation BELT = asResource("belt"); + public static final ResourceLocation FLAPS = asResource("flap"); + public static final ResourceLocation STRUCTURE = asResource("contraption_structure"); + public static final ResourceLocation ACTOR = asResource("contraption_actor"); - private static ResourceLocation loc(String name) { - return new ResourceLocation(Create.ID, name); - } } diff --git a/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java b/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java index 59aa3eb15..9c925cd74 100644 --- a/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java +++ b/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java @@ -9,7 +9,7 @@ import net.minecraft.util.ResourceLocation; public class RainbowDebugStateProvider implements IBooleanStateProvider { public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider(); - public static final ResourceLocation NAME = new ResourceLocation(Create.ID, "rainbow_debug"); + public static final ResourceLocation NAME = Create.asResource("rainbow_debug"); protected RainbowDebugStateProvider() { diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java index 0483e85e5..7eb8241ac 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java @@ -1,5 +1,7 @@ package com.simibubi.create.foundation.tileEntity; +import java.util.ConcurrentModificationException; + import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; @@ -10,8 +12,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; -import java.util.ConcurrentModificationException; - public abstract class TileEntityBehaviour { public SmartTileEntity tileEntity; diff --git a/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java b/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java index 04c4645e6..20555bdb3 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java +++ b/src/main/java/com/simibubi/create/foundation/utility/WorldAttached.java @@ -4,10 +4,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import net.minecraft.world.IWorld; import net.minecraftforge.common.util.NonNullFunction;