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
This commit is contained in:
PepperBell 2021-10-02 13:02:27 -07:00
parent 4d819b6c9d
commit d72f343fdf
52 changed files with 292 additions and 267 deletions

View file

@ -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

View file

@ -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"
]
}

View file

@ -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;

View file

@ -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<Item> 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),

View file

@ -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() {

View file

@ -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
};

View file

@ -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<Item> 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<Fluid> 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<Block> tag;
public final ITag.INamedTag<Block> 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<Block> 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<Block> 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<Item> 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<Item> 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<Fluid> 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();
}
}

View file

@ -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<CreateRecipeCategory<?>> allCategories = new ArrayList<>();

View file

@ -45,7 +45,7 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
}
public void setCategoryId(String name) {
this.uid = new ResourceLocation(Create.ID, name);
this.uid = Create.asResource(name);
this.name = name;
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -74,7 +74,7 @@ public class BlockMovementChecks {
private static final List<BrittleCheck> BRITTLE_CHECKS = new ArrayList<>();
private static final List<AttachedCheck> ATTACHED_CHECKS = new ArrayList<>();
private static final List<NotSupportiveCheck> 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

View file

@ -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;

View file

@ -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<SuperGlueEntity> 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<OrientedData> model;

View file

@ -30,7 +30,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class SuperGlueRenderer extends EntityRenderer<SuperGlueEntity> {
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;

View file

@ -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;

View file

@ -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;

View file

@ -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) {

View file

@ -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;

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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<? extends DamagingProjectileEntity> type, World world) {
super(type, world);

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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<FlapData> {

View file

@ -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;

View file

@ -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;

View file

@ -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<Block> 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<Block> 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<Block> 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<Block> 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<Block> 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 <T extends Block> NonNullBiConsumer<RegistrateBlockLootTables, T> cobblestoneLoot(PaletteStoneVariants variant) {
return (loot, block) -> loot.add(block, RegistrateBlockLootTables.droppingWithSilkTouch(block,

View file

@ -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<Block>[] blockTags;
private ITag.INamedTag<Item>[] itemTags;
private Optional<Function<PaletteStoneVariants, ConnectedTextureBehaviour>> ctBehaviour;
private IPatternBlockStateGenerator blockStateGenerator;
@ -149,6 +156,14 @@ public class PaletteBlockPattern {
return hasFoliage;
}
public ITag.INamedTag<Block>[] getBlockTags() {
return blockTags;
}
public ITag.INamedTag<Item>[] getItemTags() {
return itemTags;
}
public NonNullFunction<Properties, ? extends Block> getBlockFactory() {
return blockFactory;
}
@ -198,6 +213,18 @@ public class PaletteBlockPattern {
return this;
}
@SafeVarargs
private final PaletteBlockPattern blockTags(ITag.INamedTag<Block>... tags) {
blockTags = tags;
return this;
}
@SafeVarargs
private final PaletteBlockPattern itemTags(ITag.INamedTag<Item>... tags) {
itemTags = tags;
return this;
}
private PaletteBlockPattern connectedTextures(Function<PaletteStoneVariants, ConnectedTextureBehaviour> 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)

View file

@ -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<Supplier<Block>> baseBlock;
private NonNullSupplier<NonNullSupplier<Block>> baseBlock;
private Supplier<PalettesVariantEntry> variants;
private PaletteStoneVariants(Supplier<Supplier<Block>> baseBlock, Supplier<PalettesVariantEntry> variants) {
private PaletteStoneVariants(NonNullSupplier<NonNullSupplier<Block>> baseBlock, Supplier<PalettesVariantEntry> variants) {
this.baseBlock = baseBlock;
this.variants = variants;
}
public Supplier<Block> getBaseBlock() {
public NonNullSupplier<Block> getBaseBlock() {
return baseBlock.get();
}

View file

@ -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<BlockEntry<? extends Block>> registeredBlocks;
public ImmutableList<BlockEntry<? extends Block>> registeredPartials;
public final ImmutableList<BlockEntry<? extends Block>> registeredBlocks;
public final ImmutableList<BlockEntry<? extends Block>> registeredPartials;
public PalettesVariantEntry(PaletteStoneVariants variant, PaletteBlockPattern[] patterns,
NonNullSupplier<? extends Block> initialProperties) {
public PalettesVariantEntry(PaletteStoneVariants variant, PaletteBlockPattern[] patterns) {
String name = Lang.asId(variant.name());
NonNullSupplier<Block> initialProperties = variant.getBaseBlock();
ImmutableList.Builder<BlockEntry<? extends Block>> registeredBlocks = ImmutableList.builder();
ImmutableList.Builder<BlockEntry<? extends Block>> registeredPartials = ImmutableList.builder();
CreateRegistrate registrate = Create.registrate();
for (PaletteBlockPattern pattern : patterns) {
CreateRegistrate registrate = Create.registrate();
BlockBuilder<? extends Block, CreateRegistrate> builder =
registrate.block(pattern.createName(name), pattern.getBlockFactory())
.initialProperties(initialProperties)
@ -36,12 +39,24 @@ public class PalettesVariantEntry {
.apply(pattern)
.apply(name)::accept);
ItemBuilder<BlockItem, ? extends BlockBuilder<? extends Block, CreateRegistrate>> itemBuilder =
builder.item();
ITag.INamedTag<Block>[] blockTags = pattern.getBlockTags();
if (blockTags != null) {
builder.tag(blockTags);
}
ITag.INamedTag<Item>[] 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<? extends Block> block = builder.register();
registeredBlocks.add(block);

View file

@ -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;

View file

@ -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<ITextComponent> itemTooltip = event.getToolTip();
List<ITextComponent> toolTip = new ArrayList<>();

View file

@ -26,10 +26,10 @@ import net.minecraft.util.ResourceLocation;
public abstract class CriterionTriggerBase<T extends CriterionTriggerBase.Instance> implements ICriterionTrigger<T> {
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<PlayerAdvancements, Set<Listener<T>>> listeners = Maps.newHashMap();
@Override
@ -57,7 +57,7 @@ public abstract class CriterionTriggerBase<T extends CriterionTriggerBase.Instan
@Override
public ResourceLocation getId() {
return ID;
return id;
}
protected void trigger(ServerPlayerEntity player, @Nullable List<Supplier<Object>> suppliers) {

View file

@ -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;

View file

@ -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;
}
}

View file

@ -11,26 +11,29 @@ import net.minecraft.util.ResourceLocation;
public class SpriteShifter {
protected static Map<String, SpriteShiftEntry> textures = new HashMap<>();
protected static final Map<String, SpriteShiftEntry> 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<ResourceLocation> getAllTargetSprites() {
return textures.values().stream().map(SpriteShiftEntry::getTargetResourceLocation).collect(Collectors.toList());
return ENTRY_CACHE.values().stream().map(SpriteShiftEntry::getTargetResourceLocation).collect(Collectors.toList());
}
}

View file

@ -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;

View file

@ -21,7 +21,7 @@ public class ModelGen {
public static ModelFile createOvergrown(DataGenContext<Block, ? extends Block> 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)

View file

@ -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()

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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";

View file

@ -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");
}
}

View file

@ -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);
}
}

View file

@ -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() {

View file

@ -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;

View file

@ -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;