Hard-working Registrate

- Deprecate CreateRegistrate#lazy, add CreateRegistrate#create, and call
registerEventListeners manually
- Remove Create#registrate and use Create.REGISTRATE instead
- Move tag datagen code and methods to TagGen
- Pass event busses directly to Curios#init
- Update logging to use SLF4J
- Update Flywheel to 0.6.8-95
- Increment version to 0.5.0.g
This commit is contained in:
PepperCode1 2022-11-17 13:50:15 -08:00
parent cf87508276
commit 131c9a5479
42 changed files with 509 additions and 447 deletions

View file

@ -49,6 +49,7 @@ body:
label: Mod Version
description: The version of the mod you were using when the bug occured
options:
- "0.5.0g"
- "0.5.0f"
- "0.5.0e"
- "0.5.0d"

View file

@ -144,7 +144,7 @@ dependencies {
jarJar.pin(it, project.registrate_version)
}
// Uncomment once Forge fixes mixins for included jars
//jarJar(group: 'com.jozufozu.flywheel', name: "flywheel-forge-${flywheel_minecraft_version}", version: '[0.6.4,0.6.5)') {
//jarJar(group: 'com.jozufozu.flywheel', name: "flywheel-forge-${flywheel_minecraft_version}", version: '[0.6.8,0.6.9)') {
// jarJar.pin(it, project.flywheel_version)
//}

View file

@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false
# mod version info
mod_version = 0.5.0.e
mod_version = 0.5.0.g
artifact_minecraft_version = 1.18.2
minecraft_version = 1.18.2
@ -16,12 +16,12 @@ mixingradle_version = 0.7-SNAPSHOT
mixin_version = 0.8.5
librarian_version = 1.+
cursegradle_version = 1.4.0
parchment_version = 2022.07.10
parchment_version = 2022.11.06
# dependency versions
registrate_version = MC1.18.2-1.1.3
flywheel_minecraft_version = 1.18.2
flywheel_version = 0.6.5-91
flywheel_version = 0.6.8-95
jei_minecraft_version = 1.18.2
jei_version = 9.7.0.209
curios_minecraft_version = 1.18.2

View file

@ -5624,20 +5624,19 @@ d79c82bc6cf59b073b2f51f5fea9c98e81d14b68 data/create/recipes/weathered_copper_ti
452d480dd50b97fce72e0c89429cf68db534c6b2 data/create/recipes/weathered_copper_tile_slab_from_weathered_copper_tiles_stonecutting.json
ac265a674626e0e832330086fd18fe0be37fc327 data/create/recipes/weathered_copper_tile_stairs.json
5942a571f79c40524bbf408775cf91de4715f2b6 data/create/recipes/weathered_copper_tile_stairs_from_weathered_copper_tiles_stonecutting.json
2d549ea56fb226c0e31e66c0391996093f8bece9 data/create/tags/blocks/brittle.json
2a2700b43614f86d3294726595cb28ed7dca4387 data/create/tags/blocks/brittle.json
d99d5c67bdffff60789a19bd51a5c5267c75e0a4 data/create/tags/blocks/casing.json
443f75adbf3d2f6fb0aad4b344372669470065b8 data/create/tags/blocks/fan_transparent.json
ecdd4e6acda027a01b41d6d2d431f9675cd29b93 data/create/tags/blocks/fan_transparent.json
6e5d3b2123fbb00e7f439c091623619502551bca data/create/tags/blocks/non_movable.json
10781e8cfcbb3486327aace3aa00e437fb44b331 data/create/tags/blocks/ore_override_stone.json
418c6da531d6206e3cbe4049dce3db23c4270bed data/create/tags/blocks/passive_boiler_heaters.json
74f4ba5f6f61c30e27947c6fb4557e888d018285 data/create/tags/blocks/safe_nbt.json
760adb521c2e475a6414f97291f46c02d294fa74 data/create/tags/blocks/passive_boiler_heaters.json
23eb7cf8abff36f85320c35c69b98fdb775c8ec9 data/create/tags/blocks/safe_nbt.json
6cdeeac1689f7b5bfd9bc40b462143d8eaf3ad0b data/create/tags/blocks/seats.json
d063e12c9ef75f39518c6d129ea35d833464d547 data/create/tags/blocks/toolboxes.json
8861f982c335a1f17796df4af53a7d5dc91fc85a data/create/tags/blocks/tree_attachments.json
9460e92c8e483446318b849abe7e6f52dcd4a269 data/create/tags/blocks/tree_attachments.json
50936b211d94167a35ec78c89954082a336b6269 data/create/tags/blocks/valve_handles.json
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/blocks/windowable.json
c71f8ee0103d0c1b0d1b0727f1ecdc4d1999f1f6 data/create/tags/blocks/wrench_pickup.json
96671fd75d4209280940ef774c4185f33610a64d data/create/tags/blocks/wrench_pickup.json
a8bdc387cfa6296ebcc4af14323e2ddb632234dc data/create/tags/fluids/bottomless/allow.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/fluids/bottomless/deny.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_fuel/regular.json
@ -5684,7 +5683,6 @@ ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/blocks/storage_blocks/b
6b73c57912934d09233ad2966110968a6109f2c9 data/forge/tags/fluids/chocolate.json
391c9b2be5740aea943a8a5fe27eb327e2d973b0 data/forge/tags/fluids/honey.json
d6a4e4fe1204b718010543a28a9b9ec4e0977bd7 data/forge/tags/fluids/tea.json
d9ffc62a496946fc4848934e7c0a6e917337f8be data/forge/tags/items/beacon_payment.json
5af3164b14c92d2d6e235b5d4eebd93cbee37c0a data/forge/tags/items/buckets/honey.json
2f7cf5a2d485f25d451da9771ed466591cfa5204 data/forge/tags/items/dough.json
2f7cf5a2d485f25d451da9771ed466591cfa5204 data/forge/tags/items/dough/wheat.json
@ -5737,6 +5735,7 @@ d622e97373b1e96632ffb0a312ef04696da0ed4d data/minecraft/tags/blocks/trapdoors.js
0ec220675cbf8a6eeb47d42b7409395a0cb6ae6e data/minecraft/tags/blocks/walls.json
e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/minecraft/tags/blocks/wooden_doors.json
09d26bcd0f94459f945219997277c4fbf14adeb7 data/minecraft/tags/fluids/water.json
d9ffc62a496946fc4848934e7c0a6e917337f8be data/minecraft/tags/items/beacon_payment_items.json
e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/minecraft/tags/items/doors.json
49cadea86f6b63d5065b859a0d0e7ad772cf51d6 data/minecraft/tags/items/piglin_loved.json
49a043b38ca8d4e2fa8cba9ceee3b69715a8476e data/minecraft/tags/items/slabs.json

View file

@ -25,10 +25,10 @@
"create:redstone_link",
"create:peculiar_bell",
"create:haunted_bell",
"#minecraft:doors",
"#minecraft:beds",
"minecraft:flower_pot",
"minecraft:bell",
"minecraft:cocoa"
"minecraft:cocoa",
"minecraft:flower_pot",
"#minecraft:beds",
"#minecraft:doors"
]
}

View file

@ -4,8 +4,8 @@
"create:blaze_burner",
"create:lit_blaze_burner",
"create:sail_frame",
"#minecraft:fences",
"minecraft:iron_bars",
"#minecraft:campfires",
"minecraft:iron_bars"
"#minecraft:fences"
]
}

View file

@ -3,9 +3,9 @@
"values": [
"create:blaze_burner",
"create:lit_blaze_burner",
"#minecraft:fire",
"#minecraft:campfires",
"minecraft:magma_block",
"minecraft:lava"
"minecraft:lava",
"#minecraft:campfires",
"#minecraft:fire"
]
}

View file

@ -25,7 +25,7 @@
"create:placard",
"create:pulse_repeater",
"create:pulse_extender",
"#minecraft:signs",
"#minecraft:banners"
"#minecraft:banners",
"#minecraft:signs"
]
}

View file

@ -2,9 +2,9 @@
"replace": false,
"values": [
"minecraft:bee_nest",
"minecraft:vine",
"minecraft:cocoa",
"minecraft:moss_carpet",
"minecraft:shroomlight",
"minecraft:cocoa"
"minecraft:vine"
]
}

View file

@ -1,4 +0,0 @@
{
"replace": false,
"values": []
}

View file

@ -1,9 +1,6 @@
{
"replace": false,
"values": [
"#minecraft:rails",
"#minecraft:buttons",
"#minecraft:pressure_plates",
"minecraft:redstone_wire",
"minecraft:redstone_torch",
"minecraft:repeater",
@ -17,6 +14,9 @@
"minecraft:tripwire_hook",
"minecraft:daylight_detector",
"minecraft:target",
"minecraft:hopper"
"minecraft:hopper",
"#minecraft:buttons",
"#minecraft:pressure_plates",
"#minecraft:rails"
]
}

View file

@ -2,16 +2,17 @@ package com.simibubi.create;
import static com.simibubi.create.AllInteractionBehaviours.interactionBehaviour;
import static com.simibubi.create.AllMovementBehaviours.movementBehaviour;
import static com.simibubi.create.AllTags.axeOnly;
import static com.simibubi.create.AllTags.axeOrPickaxe;
import static com.simibubi.create.AllTags.pickaxeOnly;
import static com.simibubi.create.AllTags.tagBlockAndItem;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.content.AllSections.SCHEMATICS;
import static com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours.assignDataBehaviour;
import static com.simibubi.create.foundation.data.BlockStateGen.axisBlock;
import static com.simibubi.create.foundation.data.BlockStateGen.simpleCubeAll;
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
import static com.simibubi.create.foundation.data.TagGen.axeOnly;
import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe;
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
import static com.simibubi.create.foundation.data.TagGen.tagBlockAndItem;
import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.AllTags.AllItemTags;
@ -275,8 +276,9 @@ import net.minecraftforge.common.Tags;
public class AllBlocks {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
static {
REGISTRATE.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
}
// Schematics

View file

@ -53,7 +53,7 @@ public class AllContainerTypes {
private static <C extends AbstractContainerMenu, S extends Screen & MenuAccess<C>> MenuEntry<C> register(
String name, ForgeMenuFactory<C> factory, NonNullSupplier<ScreenFactory<C, S>> screenFactory) {
return Create.registrate()
return Create.REGISTRATE
.menu(name, factory, screenFactory)
.register();
}

View file

@ -1,8 +1,9 @@
package com.simibubi.create;
import static com.simibubi.create.Create.REGISTRATE;
import com.simibubi.create.content.curiosities.armor.CapacityEnchantment;
import com.simibubi.create.content.curiosities.weapons.PotatoRecoveryEnchantment;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.tterrag.registrate.util.entry.RegistryEntry;
import net.minecraft.world.entity.EquipmentSlot;
@ -11,8 +12,6 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory;
public class AllEnchantments {
private static final CreateRegistrate REGISTRATE = Create.registrate();
public static final RegistryEntry<PotatoRecoveryEnchantment> POTATO_RECOVERY = REGISTRATE.object("potato_recovery")
.enchantment(EnchantmentCategory.BOW, PotatoRecoveryEnchantment::new)
.addSlots(EquipmentSlot.MAINHAND, EquipmentSlot.OFFHAND)

View file

@ -73,7 +73,7 @@ public class AllEntityTypes {
MobCategory group, int range, int updateFrequency, boolean sendVelocity, boolean immuneToFire,
NonNullConsumer<EntityType.Builder<T>> propertyBuilder) {
String id = Lang.asId(name);
return (CreateEntityBuilder<T, ?>) Create.registrate()
return (CreateEntityBuilder<T, ?>) Create.REGISTRATE
.entity(id, factory, group)
.properties(b -> b.setTrackingRange(range)
.setUpdateInterval(updateFrequency)

View file

@ -1,5 +1,7 @@
package com.simibubi.create;
import static com.simibubi.create.Create.REGISTRATE;
import javax.annotation.Nullable;
import com.simibubi.create.AllTags.AllFluidTags;
@ -7,7 +9,6 @@ import com.simibubi.create.content.contraptions.fluids.VirtualFluid;
import com.simibubi.create.content.contraptions.fluids.potion.PotionFluid;
import com.simibubi.create.content.contraptions.fluids.potion.PotionFluid.PotionFluidAttributes;
import com.simibubi.create.content.palettes.AllPaletteStoneTypes;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.tterrag.registrate.util.entry.FluidEntry;
import net.minecraft.core.BlockPos;
@ -20,8 +21,6 @@ import net.minecraftforge.fluids.ForgeFlowingFluid;
public class AllFluids {
private static final CreateRegistrate REGISTRATE = Create.registrate();
public static final FluidEntry<PotionFluid> POTION =
REGISTRATE.virtualFluid("potion", PotionFluidAttributes::new, PotionFluid::new)
.lang("Potion")

View file

@ -4,6 +4,7 @@ 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.PLATES;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.content.AllSections.CURIOSITIES;
import static com.simibubi.create.content.AllSections.KINETICS;
import static com.simibubi.create.content.AllSections.LOGISTICS;
@ -71,8 +72,9 @@ import net.minecraftforge.common.Tags;
public class AllItems {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
static {
REGISTRATE.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
}
// Schematics

View file

@ -2,19 +2,17 @@ package com.simibubi.create;
import static com.simibubi.create.AllTags.NameSpace.FORGE;
import static com.simibubi.create.AllTags.NameSpace.MOD;
import static com.simibubi.create.AllTags.NameSpace.QUARK;
import static com.simibubi.create.AllTags.NameSpace.TIC;
import java.util.Collections;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.data.recipe.Mods;
import com.simibubi.create.foundation.data.TagGen;
import com.simibubi.create.foundation.utility.Lang;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.builders.ItemBuilder;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.util.nullness.NonNullFunction;
import net.minecraft.data.tags.TagsProvider.TagAppender;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags;
@ -23,23 +21,15 @@ import net.minecraft.tags.TagKey;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.common.Tags;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.registries.IForgeRegistryEntry;
public class AllTags {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
public static <T extends IForgeRegistryEntry<T>> TagKey<T> optionalTag(IForgeRegistry<T> registry,
ResourceLocation id) {
return registry.tags()
@ -62,34 +52,32 @@ public class AllTags {
return forgeTag(ForgeRegistries.FLUIDS, path);
}
@Deprecated(forRemoval = true)
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> axeOrPickaxe() {
return b -> b.tag(BlockTags.MINEABLE_WITH_AXE)
.tag(BlockTags.MINEABLE_WITH_PICKAXE);
return TagGen.axeOrPickaxe();
}
@Deprecated(forRemoval = true)
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> axeOnly() {
return b -> b.tag(BlockTags.MINEABLE_WITH_AXE);
return TagGen.axeOnly();
}
@Deprecated(forRemoval = true)
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> pickaxeOnly() {
return b -> b.tag(BlockTags.MINEABLE_WITH_PICKAXE);
return TagGen.pickaxeOnly();
}
@Deprecated(forRemoval = true)
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, ItemBuilder<BlockItem, BlockBuilder<T, P>>> tagBlockAndItem(
String... path) {
return b -> {
for (String p : path)
b.tag(forgeBlockTag(p));
ItemBuilder<BlockItem, BlockBuilder<T, P>> item = b.item();
for (String p : path)
item.tag(forgeItemTag(p));
return item;
};
return TagGen.tagBlockAndItem(path);
}
public enum NameSpace {
MOD(Create.ID, false, true), FORGE("forge"), TIC("tconstruct"), QUARK("quark")
MOD(Create.ID, false, true),
FORGE("forge"),
TIC("tconstruct"),
QUARK("quark")
;
@ -106,11 +94,9 @@ public class AllTags {
this.optionalDefault = optionalDefault;
this.alwaysDatagenDefault = alwaysDatagenDefault;
}
}
public enum AllBlockTags {
BRITTLE,
CASING,
FAN_TRANSPARENT,
@ -120,21 +106,21 @@ public class AllTags {
SAFE_NBT,
SEATS,
TOOLBOXES,
TREE_ATTACHMENTS,
VALVE_HANDLES,
WINDMILL_SAILS,
WINDOWABLE,
WRENCH_PICKUP,
TREE_ATTACHMENTS,
RELOCATION_NOT_SUPPORTED(FORGE),
WG_STONE(FORGE),
SLIMY_LOGS(TIC),
NON_DOUBLE_DOOR(NameSpace.QUARK),
NON_DOUBLE_DOOR(QUARK),
;
public final TagKey<Block> tag;
public final boolean alwaysDatagen;
AllBlockTags() {
this(MOD);
@ -159,9 +145,7 @@ public class AllTags {
} else {
tag = BlockTags.create(id);
}
if (alwaysDatagen) {
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag));
}
this.alwaysDatagen = alwaysDatagen;
}
@SuppressWarnings("deprecation")
@ -174,42 +158,18 @@ public class AllTags {
return state.is(tag);
}
public void add(Block... values) {
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag)
.add(values));
private static void init() {
}
public void addOptional(Mods mod, String... ids) {
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> {
TagAppender<Block> builder = prov.tag(tag);
for (String id : ids)
builder.addOptional(mod.asResource(id));
});
}
public void includeIn(TagKey<Block> parent) {
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(parent)
.addTag(tag));
}
public void includeIn(AllBlockTags parent) {
includeIn(parent.tag);
}
public void includeAll(TagKey<Block> child) {
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag)
.addTag(child));
}
}
public enum AllItemTags {
BLAZE_BURNER_FUEL_REGULAR(MOD, "blaze_burner_fuel/regular"),
BLAZE_BURNER_FUEL_SPECIAL(MOD, "blaze_burner_fuel/special"),
CASING,
CREATE_INGOTS,
CRUSHED_ORES,
MODDED_STRIPPED_LOGS,
MODDED_STRIPPED_WOOD,
PRESSURIZED_AIR_SOURCES,
SANDPAPER,
SEATS,
@ -219,18 +179,16 @@ public class AllTags {
VALVE_HANDLES,
VANILLA_STRIPPED_LOGS,
VANILLA_STRIPPED_WOOD,
MODDED_STRIPPED_LOGS,
MODDED_STRIPPED_WOOD,
STRIPPED_LOGS(FORGE),
STRIPPED_WOOD(FORGE),
BEACON_PAYMENT(FORGE),
PLATES(FORGE),
WRENCH(FORGE, "tools/wrench")
;
public final TagKey<Item> tag;
public final boolean alwaysDatagen;
AllItemTags() {
this(MOD);
@ -255,9 +213,7 @@ public class AllTags {
} else {
tag = ItemTags.create(id);
}
if (alwaysDatagen) {
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag));
}
this.alwaysDatagen = alwaysDatagen;
}
@SuppressWarnings("deprecation")
@ -270,37 +226,11 @@ public class AllTags {
return stack.is(tag);
}
public void add(Item... values) {
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)
.add(values));
private static void init() {
}
public void addOptional(Mods mod, String... ids) {
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> {
TagAppender<Item> builder = prov.tag(tag);
for (String id : ids)
builder.addOptional(mod.asResource(id));
});
}
public void includeIn(TagKey<Item> parent) {
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(parent)
.addTag(tag));
}
public void includeIn(AllItemTags parent) {
includeIn(parent.tag);
}
public void includeAll(TagKey<Item> child) {
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)
.addTag(child));
}
}
public enum AllFluidTags {
BOTTOMLESS_ALLOW(MOD, "bottomless/allow"),
BOTTOMLESS_DENY(MOD, "bottomless/deny"),
@ -309,6 +239,7 @@ public class AllTags {
;
public final TagKey<Fluid> tag;
public final boolean alwaysDatagen;
AllFluidTags() {
this(MOD);
@ -333,9 +264,7 @@ public class AllTags {
} else {
tag = FluidTags.create(id);
}
if (alwaysDatagen) {
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag));
}
this.alwaysDatagen = alwaysDatagen;
}
@SuppressWarnings("deprecation")
@ -347,123 +276,13 @@ public class AllTags {
return state.is(tag);
}
public void add(Fluid... values) {
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag)
.add(values));
}
public void includeIn(TagKey<Fluid> parent) {
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(parent)
.addTag(tag));
}
public void includeIn(AllFluidTags parent) {
includeIn(parent.tag);
}
public void includeAll(TagKey<Fluid> child) {
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag)
.addTag(child));
}
}
public static void register() {
AllFluidTags.BOTTOMLESS_ALLOW.add(Fluids.WATER, Fluids.LAVA);
AllItemTags.VANILLA_STRIPPED_LOGS.add(Items.STRIPPED_ACACIA_LOG, Items.STRIPPED_BIRCH_LOG,
Items.STRIPPED_CRIMSON_STEM, Items.STRIPPED_DARK_OAK_LOG, Items.STRIPPED_JUNGLE_LOG, Items.STRIPPED_OAK_LOG,
Items.STRIPPED_SPRUCE_LOG, Items.STRIPPED_WARPED_STEM);
AllItemTags.VANILLA_STRIPPED_LOGS.includeIn(AllItemTags.STRIPPED_LOGS);
AllItemTags.VANILLA_STRIPPED_WOOD.add(Items.STRIPPED_ACACIA_WOOD, Items.STRIPPED_BIRCH_WOOD,
Items.STRIPPED_CRIMSON_HYPHAE, Items.STRIPPED_DARK_OAK_WOOD, Items.STRIPPED_JUNGLE_WOOD,
Items.STRIPPED_OAK_WOOD, Items.STRIPPED_SPRUCE_WOOD, Items.STRIPPED_WARPED_HYPHAE);
AllItemTags.VANILLA_STRIPPED_WOOD.includeIn(AllItemTags.STRIPPED_WOOD);
AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT);
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);
AllItemTags.SLEEPERS.add(Items.STONE_SLAB, Items.SMOOTH_STONE_SLAB, Items.ANDESITE_SLAB);
AllBlockTags.WINDMILL_SAILS.includeAll(BlockTags.WOOL);
AllBlockTags.BRITTLE.includeAll(BlockTags.DOORS);
AllBlockTags.BRITTLE.includeAll(BlockTags.BEDS);
AllBlockTags.BRITTLE.add(Blocks.FLOWER_POT, Blocks.BELL, Blocks.COCOA);
AllBlockTags.FAN_TRANSPARENT.includeAll(BlockTags.FENCES);
AllBlockTags.FAN_TRANSPARENT.includeAll(BlockTags.CAMPFIRES);
AllBlockTags.FAN_TRANSPARENT.add(Blocks.IRON_BARS);
AllBlockTags.PASSIVE_BOILER_HEATERS.includeAll(BlockTags.FIRE);
AllBlockTags.PASSIVE_BOILER_HEATERS.includeAll(BlockTags.CAMPFIRES);
AllBlockTags.PASSIVE_BOILER_HEATERS.add(Blocks.MAGMA_BLOCK, Blocks.LAVA);
AllBlockTags.SAFE_NBT.includeAll(BlockTags.SIGNS);
AllBlockTags.SAFE_NBT.includeAll(BlockTags.BANNERS);
AllBlockTags.WRENCH_PICKUP.includeAll(BlockTags.RAILS);
AllBlockTags.WRENCH_PICKUP.includeAll(BlockTags.BUTTONS);
AllBlockTags.WRENCH_PICKUP.includeAll(BlockTags.PRESSURE_PLATES);
AllBlockTags.WRENCH_PICKUP.add(Blocks.REDSTONE_WIRE, Blocks.REDSTONE_TORCH, Blocks.REPEATER, Blocks.LEVER,
Blocks.COMPARATOR, Blocks.OBSERVER, Blocks.REDSTONE_WALL_TORCH, Blocks.PISTON, Blocks.STICKY_PISTON,
Blocks.TRIPWIRE, Blocks.TRIPWIRE_HOOK, Blocks.DAYLIGHT_DETECTOR, Blocks.TARGET, Blocks.HOPPER);
AllBlockTags.TREE_ATTACHMENTS.add(Blocks.BEE_NEST, Blocks.VINE, Blocks.MOSS_CARPET, Blocks.SHROOMLIGHT,
Blocks.COCOA);
AllBlockTags.ORE_OVERRIDE_STONE.includeAll(BlockTags.STONE_ORE_REPLACEABLES);
registerCompat();
}
private static void registerCompat() {
AllBlockTags.NON_MOVABLE.addOptional(Mods.IE, "connector_lv", "connector_lv_relay", "connector_mv",
"connector_mv_relay", "connector_hv", "connector_hv_relay", "connector_bundled", "connector_structural",
"connector_redstone", "connector_probe", "breaker_switch");
strippedWoodCompat(Mods.ARS_N, "blue_archwood", "purple_archwood", "green_archwood", "red_archwood");
strippedWoodCompat(Mods.BTN, "livingwood", "dreamwood");
strippedWoodCompat(Mods.FA, "cherrywood", "mysterywood");
strippedWoodCompat(Mods.HEX, "akashic");
strippedWoodCompat(Mods.ID, "menril");
strippedWoodCompat(Mods.BYG, "aspen", "baobab", "enchanted", "cherry", "cika", "cypress", "ebony", "ether",
"fir", "green_enchanted", "holly", "jacaranda", "lament", "mahogany", "mangrove", "maple", "nightshade",
"palm", "palo_verde", "pine", "rainbow_eucalyptus", "redwood", "skyris", "willow", "witch_hazel",
"zelkova");
strippedWoodCompat(Mods.SG, "netherwood");
strippedWoodCompat(Mods.TF, "twilight_oak", "canopy", "mangrove", "dark", "time", "transformation", "mining",
"sorting");
strippedWoodCompat(Mods.TIC, "greenheart", "skyroot", "bloodshroom");
strippedWoodCompat(Mods.AP, "twisted");
strippedWoodCompat(Mods.Q, "azalea", "blossom");
strippedWoodCompat(Mods.ECO, "coconut", "walnut", "azalea");
strippedWoodCompat(Mods.BOP, "fir", "redwood", "cherry", "mahogany", "jacaranda", "palm", "willow", "dead",
"magic", "umbran", "hellbark");
strippedWoodCompat(Mods.BSK, "bluebright", "starlit", "frostbright", "lunar", "dusk", "maple", "cherry");
AllItemTags.MODDED_STRIPPED_LOGS.addOptional(Mods.BYG, "stripped_bulbis_stem");
AllItemTags.MODDED_STRIPPED_WOOD.addOptional(Mods.BYG, "stripped_bulbis_wood");
AllItemTags.MODDED_STRIPPED_LOGS.includeIn(AllItemTags.STRIPPED_LOGS);
AllItemTags.MODDED_STRIPPED_WOOD.includeIn(AllItemTags.STRIPPED_WOOD);
}
private static void strippedWoodCompat(Mods mod, String... woodtypes) {
for (int i = 0; i < woodtypes.length; i++) {
String type = woodtypes[i];
String strippedPre = mod.strippedIsSuffix ? "" : "stripped_";
String strippedPost = mod.strippedIsSuffix ? "_stripped" : "";
AllItemTags.MODDED_STRIPPED_LOGS.addOptional(mod, strippedPre + type + "_log" + strippedPost);
AllItemTags.MODDED_STRIPPED_WOOD.addOptional(mod,
strippedPre + type + (mod.omitWoodSuffix ? "" : "_wood") + strippedPost);
private static void init() {
}
}
public static void init() {
AllBlockTags.init();
AllItemTags.init();
AllFluidTags.init();
}
}

View file

@ -1,5 +1,6 @@
package com.simibubi.create;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours.assignDataBehaviourTE;
import com.simibubi.create.content.contraptions.base.CutoutRotatingInstance;
@ -203,41 +204,41 @@ import com.tterrag.registrate.util.entry.BlockEntityEntry;
public class AllTileEntities {
// Schematics
public static final BlockEntityEntry<SchematicannonTileEntity> SCHEMATICANNON = Create.registrate()
public static final BlockEntityEntry<SchematicannonTileEntity> SCHEMATICANNON = REGISTRATE
.tileEntity("schematicannon", SchematicannonTileEntity::new)
.instance(() -> SchematicannonInstance::new)
.validBlocks(AllBlocks.SCHEMATICANNON)
.renderer(() -> SchematicannonRenderer::new)
.register();
public static final BlockEntityEntry<SchematicTableTileEntity> SCHEMATIC_TABLE = Create.registrate()
public static final BlockEntityEntry<SchematicTableTileEntity> SCHEMATIC_TABLE = REGISTRATE
.tileEntity("schematic_table", SchematicTableTileEntity::new)
.validBlocks(AllBlocks.SCHEMATIC_TABLE)
.register();
// Kinetics
public static final BlockEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = Create.registrate()
public static final BlockEntityEntry<BracketedKineticTileEntity> BRACKETED_KINETIC = REGISTRATE
.tileEntity("simple_kinetic", BracketedKineticTileEntity::new)
.instance(() -> BracketedKineticTileInstance::new, false)
.validBlocks(AllBlocks.SHAFT, AllBlocks.COGWHEEL, AllBlocks.LARGE_COGWHEEL)
.renderer(() -> BracketedKineticTileRenderer::new)
.register();
public static final BlockEntityEntry<CreativeMotorTileEntity> MOTOR = Create.registrate()
public static final BlockEntityEntry<CreativeMotorTileEntity> MOTOR = REGISTRATE
.tileEntity("motor", CreativeMotorTileEntity::new)
.instance(() -> HalfShaftInstance::new, false)
.validBlocks(AllBlocks.CREATIVE_MOTOR)
.renderer(() -> CreativeMotorRenderer::new)
.register();
public static final BlockEntityEntry<GearboxTileEntity> GEARBOX = Create.registrate()
public static final BlockEntityEntry<GearboxTileEntity> GEARBOX = REGISTRATE
.tileEntity("gearbox", GearboxTileEntity::new)
.instance(() -> GearboxInstance::new, false)
.validBlocks(AllBlocks.GEARBOX)
.renderer(() -> GearboxRenderer::new)
.register();
public static final BlockEntityEntry<KineticTileEntity> ENCASED_SHAFT = Create.registrate()
public static final BlockEntityEntry<KineticTileEntity> ENCASED_SHAFT = REGISTRATE
.tileEntity("encased_shaft", KineticTileEntity::new)
.instance(() -> ShaftInstance::new, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_SHAFT, AllBlocks.BRASS_ENCASED_SHAFT, AllBlocks.ENCASED_CHAIN_DRIVE,
@ -245,62 +246,62 @@ public class AllTileEntities {
.renderer(() -> ShaftRenderer::new)
.register();
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = Create.registrate()
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_COGWHEEL = REGISTRATE
.tileEntity("encased_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::small, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_COGWHEEL, AllBlocks.BRASS_ENCASED_COGWHEEL)
.renderer(() -> EncasedCogRenderer::small)
.register();
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_LARGE_COGWHEEL = Create.registrate()
public static final BlockEntityEntry<SimpleKineticTileEntity> ENCASED_LARGE_COGWHEEL = REGISTRATE
.tileEntity("encased_large_cogwheel", SimpleKineticTileEntity::new)
.instance(() -> EncasedCogInstance::large, false)
.validBlocks(AllBlocks.ANDESITE_ENCASED_LARGE_COGWHEEL, AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL)
.renderer(() -> EncasedCogRenderer::large)
.register();
public static final BlockEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = Create.registrate()
public static final BlockEntityEntry<AdjustablePulleyTileEntity> ADJUSTABLE_PULLEY = REGISTRATE
.tileEntity("adjustable_pulley", AdjustablePulleyTileEntity::new)
.instance(() -> ShaftInstance::new, false)
.validBlocks(AllBlocks.ADJUSTABLE_CHAIN_GEARSHIFT)
.renderer(() -> ShaftRenderer::new)
.register();
public static final BlockEntityEntry<EncasedFanTileEntity> ENCASED_FAN = Create.registrate()
public static final BlockEntityEntry<EncasedFanTileEntity> ENCASED_FAN = REGISTRATE
.tileEntity("encased_fan", EncasedFanTileEntity::new)
.instance(() -> FanInstance::new, false)
.validBlocks(AllBlocks.ENCASED_FAN)
.renderer(() -> EncasedFanRenderer::new)
.register();
public static final BlockEntityEntry<NozzleTileEntity> NOZZLE = Create.registrate()
public static final BlockEntityEntry<NozzleTileEntity> NOZZLE = REGISTRATE
.tileEntity("nozzle", NozzleTileEntity::new)
.validBlocks(AllBlocks.NOZZLE)
// .renderer(() -> renderer)
.register();
public static final BlockEntityEntry<ClutchTileEntity> CLUTCH = Create.registrate()
public static final BlockEntityEntry<ClutchTileEntity> CLUTCH = REGISTRATE
.tileEntity("clutch", ClutchTileEntity::new)
.instance(() -> SplitShaftInstance::new, false)
.validBlocks(AllBlocks.CLUTCH)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final BlockEntityEntry<GearshiftTileEntity> GEARSHIFT = Create.registrate()
public static final BlockEntityEntry<GearshiftTileEntity> GEARSHIFT = REGISTRATE
.tileEntity("gearshift", GearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new, false)
.validBlocks(AllBlocks.GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final BlockEntityEntry<TurntableTileEntity> TURNTABLE = Create.registrate()
public static final BlockEntityEntry<TurntableTileEntity> TURNTABLE = REGISTRATE
.tileEntity("turntable", TurntableTileEntity::new)
.instance(() -> SingleRotatingInstance::new, false)
.validBlocks(AllBlocks.TURNTABLE)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<HandCrankTileEntity> HAND_CRANK = Create.registrate()
public static final BlockEntityEntry<HandCrankTileEntity> HAND_CRANK = REGISTRATE
.tileEntity("hand_crank", HandCrankTileEntity::new)
.instance(() -> HandCrankInstance::new)
.validBlocks(AllBlocks.HAND_CRANK, AllBlocks.COPPER_VALVE_HANDLE)
@ -308,209 +309,209 @@ public class AllTileEntities {
.renderer(() -> HandCrankRenderer::new)
.register();
public static final BlockEntityEntry<CuckooClockTileEntity> CUCKOO_CLOCK = Create.registrate()
public static final BlockEntityEntry<CuckooClockTileEntity> CUCKOO_CLOCK = REGISTRATE
.tileEntity("cuckoo_clock", CuckooClockTileEntity::new)
.instance(() -> HorizontalHalfShaftInstance::new)
.validBlocks(AllBlocks.CUCKOO_CLOCK, AllBlocks.MYSTERIOUS_CUCKOO_CLOCK)
.renderer(() -> CuckooClockRenderer::new)
.register();
public static final BlockEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = Create.registrate()
public static final BlockEntityEntry<GantryShaftTileEntity> GANTRY_SHAFT = REGISTRATE
.tileEntity("gantry_shaft", GantryShaftTileEntity::new)
.instance(() -> SingleRotatingInstance::new, false)
.validBlocks(AllBlocks.GANTRY_SHAFT)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<GantryCarriageTileEntity> GANTRY_PINION = Create.registrate()
public static final BlockEntityEntry<GantryCarriageTileEntity> GANTRY_PINION = REGISTRATE
.tileEntity("gantry_pinion", GantryCarriageTileEntity::new)
.instance(() -> GantryCarriageInstance::new)
.validBlocks(AllBlocks.GANTRY_CARRIAGE)
.renderer(() -> GantryCarriageRenderer::new)
.register();
public static final BlockEntityEntry<PumpTileEntity> MECHANICAL_PUMP = Create.registrate()
public static final BlockEntityEntry<PumpTileEntity> MECHANICAL_PUMP = REGISTRATE
.tileEntity("mechanical_pump", PumpTileEntity::new)
.instance(() -> PumpCogInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PUMP)
.renderer(() -> PumpRenderer::new)
.register();
public static final BlockEntityEntry<SmartFluidPipeTileEntity> SMART_FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<SmartFluidPipeTileEntity> SMART_FLUID_PIPE = REGISTRATE
.tileEntity("smart_fluid_pipe", SmartFluidPipeTileEntity::new)
.validBlocks(AllBlocks.SMART_FLUID_PIPE)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<FluidPipeTileEntity> FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<FluidPipeTileEntity> FLUID_PIPE = REGISTRATE
.tileEntity("fluid_pipe", FluidPipeTileEntity::new)
.validBlocks(AllBlocks.FLUID_PIPE)
.register();
public static final BlockEntityEntry<FluidPipeTileEntity> ENCASED_FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<FluidPipeTileEntity> ENCASED_FLUID_PIPE = REGISTRATE
.tileEntity("encased_fluid_pipe", FluidPipeTileEntity::new)
.validBlocks(AllBlocks.ENCASED_FLUID_PIPE)
.register();
public static final BlockEntityEntry<StraightPipeTileEntity> GLASS_FLUID_PIPE = Create.registrate()
public static final BlockEntityEntry<StraightPipeTileEntity> GLASS_FLUID_PIPE = REGISTRATE
.tileEntity("glass_fluid_pipe", StraightPipeTileEntity::new)
.validBlocks(AllBlocks.GLASS_FLUID_PIPE)
.renderer(() -> TransparentStraightPipeRenderer::new)
.register();
public static final BlockEntityEntry<FluidValveTileEntity> FLUID_VALVE = Create.registrate()
public static final BlockEntityEntry<FluidValveTileEntity> FLUID_VALVE = REGISTRATE
.tileEntity("fluid_valve", FluidValveTileEntity::new)
.instance(() -> FluidValveInstance::new)
.validBlocks(AllBlocks.FLUID_VALVE)
.renderer(() -> FluidValveRenderer::new)
.register();
public static final BlockEntityEntry<FluidTankTileEntity> FLUID_TANK = Create.registrate()
public static final BlockEntityEntry<FluidTankTileEntity> FLUID_TANK = REGISTRATE
.tileEntity("fluid_tank", FluidTankTileEntity::new)
.validBlocks(AllBlocks.FLUID_TANK)
.renderer(() -> FluidTankRenderer::new)
.register();
public static final BlockEntityEntry<CreativeFluidTankTileEntity> CREATIVE_FLUID_TANK = Create.registrate()
public static final BlockEntityEntry<CreativeFluidTankTileEntity> CREATIVE_FLUID_TANK = REGISTRATE
.tileEntity("creative_fluid_tank", CreativeFluidTankTileEntity::new)
.validBlocks(AllBlocks.CREATIVE_FLUID_TANK)
.renderer(() -> FluidTankRenderer::new)
.register();
public static final BlockEntityEntry<HosePulleyTileEntity> HOSE_PULLEY = Create.registrate()
public static final BlockEntityEntry<HosePulleyTileEntity> HOSE_PULLEY = REGISTRATE
.tileEntity("hose_pulley", HosePulleyTileEntity::new)
.instance(() -> HosePulleyInstance::new)
.validBlocks(AllBlocks.HOSE_PULLEY)
.renderer(() -> HosePulleyRenderer::new)
.register();
public static final BlockEntityEntry<SpoutTileEntity> SPOUT = Create.registrate()
public static final BlockEntityEntry<SpoutTileEntity> SPOUT = REGISTRATE
.tileEntity("spout", SpoutTileEntity::new)
.validBlocks(AllBlocks.SPOUT)
.renderer(() -> SpoutRenderer::new)
.register();
public static final BlockEntityEntry<ItemDrainTileEntity> ITEM_DRAIN = Create.registrate()
public static final BlockEntityEntry<ItemDrainTileEntity> ITEM_DRAIN = REGISTRATE
.tileEntity("item_drain", ItemDrainTileEntity::new)
.validBlocks(AllBlocks.ITEM_DRAIN)
.renderer(() -> ItemDrainRenderer::new)
.register();
public static final BlockEntityEntry<BeltTileEntity> BELT = Create.registrate()
public static final BlockEntityEntry<BeltTileEntity> BELT = REGISTRATE
.tileEntity("belt", BeltTileEntity::new)
.instance(() -> BeltInstance::new, BeltTileEntity::shouldRenderNormally)
.validBlocks(AllBlocks.BELT)
.renderer(() -> BeltRenderer::new)
.register();
public static final BlockEntityEntry<ChuteTileEntity> CHUTE = Create.registrate()
public static final BlockEntityEntry<ChuteTileEntity> CHUTE = REGISTRATE
.tileEntity("chute", ChuteTileEntity::new)
.validBlocks(AllBlocks.CHUTE)
.renderer(() -> ChuteRenderer::new)
.register();
public static final BlockEntityEntry<SmartChuteTileEntity> SMART_CHUTE = Create.registrate()
public static final BlockEntityEntry<SmartChuteTileEntity> SMART_CHUTE = REGISTRATE
.tileEntity("smart_chute", SmartChuteTileEntity::new)
.validBlocks(AllBlocks.SMART_CHUTE)
.renderer(() -> SmartChuteRenderer::new)
.register();
public static final BlockEntityEntry<BeltTunnelTileEntity> ANDESITE_TUNNEL = Create.registrate()
public static final BlockEntityEntry<BeltTunnelTileEntity> ANDESITE_TUNNEL = REGISTRATE
.tileEntity("andesite_tunnel", BeltTunnelTileEntity::new)
.instance(() -> BeltTunnelInstance::new)
.validBlocks(AllBlocks.ANDESITE_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new)
.register();
public static final BlockEntityEntry<BrassTunnelTileEntity> BRASS_TUNNEL = Create.registrate()
public static final BlockEntityEntry<BrassTunnelTileEntity> BRASS_TUNNEL = REGISTRATE
.tileEntity("brass_tunnel", BrassTunnelTileEntity::new)
.instance(() -> BeltTunnelInstance::new)
.validBlocks(AllBlocks.BRASS_TUNNEL)
.renderer(() -> BeltTunnelRenderer::new)
.register();
public static final BlockEntityEntry<ArmTileEntity> MECHANICAL_ARM = Create.registrate()
public static final BlockEntityEntry<ArmTileEntity> MECHANICAL_ARM = REGISTRATE
.tileEntity("mechanical_arm", ArmTileEntity::new)
.instance(() -> ArmInstance::new)
.validBlocks(AllBlocks.MECHANICAL_ARM)
.renderer(() -> ArmRenderer::new)
.register();
public static final BlockEntityEntry<ItemVaultTileEntity> ITEM_VAULT = Create.registrate()
public static final BlockEntityEntry<ItemVaultTileEntity> ITEM_VAULT = REGISTRATE
.tileEntity("item_vault", ItemVaultTileEntity::new)
.validBlocks(AllBlocks.ITEM_VAULT)
.register();
public static final BlockEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = Create.registrate()
public static final BlockEntityEntry<MechanicalPistonTileEntity> MECHANICAL_PISTON = REGISTRATE
.tileEntity("mechanical_piston", MechanicalPistonTileEntity::new)
.instance(() -> ShaftInstance::new, false)
.validBlocks(AllBlocks.MECHANICAL_PISTON, AllBlocks.STICKY_MECHANICAL_PISTON)
.renderer(() -> MechanicalPistonRenderer::new)
.register();
public static final BlockEntityEntry<WindmillBearingTileEntity> WINDMILL_BEARING = Create.registrate()
public static final BlockEntityEntry<WindmillBearingTileEntity> WINDMILL_BEARING = REGISTRATE
.tileEntity("windmill_bearing", WindmillBearingTileEntity::new)
.instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.WINDMILL_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final BlockEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = Create.registrate()
public static final BlockEntityEntry<MechanicalBearingTileEntity> MECHANICAL_BEARING = REGISTRATE
.tileEntity("mechanical_bearing", MechanicalBearingTileEntity::new)
.instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.MECHANICAL_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final BlockEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = Create.registrate()
public static final BlockEntityEntry<ClockworkBearingTileEntity> CLOCKWORK_BEARING = REGISTRATE
.tileEntity("clockwork_bearing", ClockworkBearingTileEntity::new)
.instance(() -> BearingInstance::new)
.validBlocks(AllBlocks.CLOCKWORK_BEARING)
.renderer(() -> BearingRenderer::new)
.register();
public static final BlockEntityEntry<PulleyTileEntity> ROPE_PULLEY = Create.registrate()
public static final BlockEntityEntry<PulleyTileEntity> ROPE_PULLEY = REGISTRATE
.tileEntity("rope_pulley", PulleyTileEntity::new)
.instance(() -> RopePulleyInstance::new, false)
.validBlocks(AllBlocks.ROPE_PULLEY)
.renderer(() -> PulleyRenderer::new)
.register();
public static final BlockEntityEntry<ChassisTileEntity> CHASSIS = Create.registrate()
public static final BlockEntityEntry<ChassisTileEntity> CHASSIS = REGISTRATE
.tileEntity("chassis", ChassisTileEntity::new)
.validBlocks(AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS)
// .renderer(() -> renderer)
.register();
public static final BlockEntityEntry<StickerTileEntity> STICKER = Create.registrate()
public static final BlockEntityEntry<StickerTileEntity> STICKER = REGISTRATE
.tileEntity("sticker", StickerTileEntity::new)
.instance(() -> StickerInstance::new, false)
.validBlocks(AllBlocks.STICKER)
.renderer(() -> StickerRenderer::new)
.register();
public static final BlockEntityEntry<DrillTileEntity> DRILL = Create.registrate()
public static final BlockEntityEntry<DrillTileEntity> DRILL = REGISTRATE
.tileEntity("drill", DrillTileEntity::new)
.instance(() -> DrillInstance::new, false)
.validBlocks(AllBlocks.MECHANICAL_DRILL)
.renderer(() -> DrillRenderer::new)
.register();
public static final BlockEntityEntry<SawTileEntity> SAW = Create.registrate()
public static final BlockEntityEntry<SawTileEntity> SAW = REGISTRATE
.tileEntity("saw", SawTileEntity::new)
.instance(() -> SawInstance::new)
.validBlocks(AllBlocks.MECHANICAL_SAW)
.renderer(() -> SawRenderer::new)
.register();
public static final BlockEntityEntry<HarvesterTileEntity> HARVESTER = Create.registrate()
public static final BlockEntityEntry<HarvesterTileEntity> HARVESTER = REGISTRATE
.tileEntity("harvester", HarvesterTileEntity::new)
.validBlocks(AllBlocks.MECHANICAL_HARVESTER)
.renderer(() -> HarvesterRenderer::new)
.register();
public static final BlockEntityEntry<PortableItemInterfaceTileEntity> PORTABLE_STORAGE_INTERFACE =
Create.registrate()
REGISTRATE
.tileEntity("portable_storage_interface", PortableItemInterfaceTileEntity::new)
.instance(() -> PSIInstance::new)
.validBlocks(AllBlocks.PORTABLE_STORAGE_INTERFACE)
@ -518,47 +519,47 @@ public class AllTileEntities {
.register();
public static final BlockEntityEntry<PortableFluidInterfaceTileEntity> PORTABLE_FLUID_INTERFACE =
Create.registrate()
REGISTRATE
.tileEntity("portable_fluid_interface", PortableFluidInterfaceTileEntity::new)
.instance(() -> PSIInstance::new)
.validBlocks(AllBlocks.PORTABLE_FLUID_INTERFACE)
.renderer(() -> PortableStorageInterfaceRenderer::new)
.register();
public static final BlockEntityEntry<SteamEngineTileEntity> STEAM_ENGINE = Create.registrate()
public static final BlockEntityEntry<SteamEngineTileEntity> STEAM_ENGINE = REGISTRATE
.tileEntity("steam_engine", SteamEngineTileEntity::new)
.validBlocks(AllBlocks.STEAM_ENGINE)
.renderer(() -> SteamEngineRenderer::new)
.register();
public static final BlockEntityEntry<WhistleTileEntity> STEAM_WHISTLE = Create.registrate()
public static final BlockEntityEntry<WhistleTileEntity> STEAM_WHISTLE = REGISTRATE
.tileEntity("steam_whistle", WhistleTileEntity::new)
.validBlocks(AllBlocks.STEAM_WHISTLE)
.renderer(() -> WhistleRenderer::new)
.register();
public static final BlockEntityEntry<PoweredShaftTileEntity> POWERED_SHAFT = Create.registrate()
public static final BlockEntityEntry<PoweredShaftTileEntity> POWERED_SHAFT = REGISTRATE
.tileEntity("powered_shaft", PoweredShaftTileEntity::new)
.instance(() -> SingleRotatingInstance::new, false)
.validBlocks(AllBlocks.POWERED_SHAFT)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<FlywheelTileEntity> FLYWHEEL = Create.registrate()
public static final BlockEntityEntry<FlywheelTileEntity> FLYWHEEL = REGISTRATE
.tileEntity("flywheel", FlywheelTileEntity::new)
.instance(() -> FlyWheelInstance::new, false)
.validBlocks(AllBlocks.FLYWHEEL)
.renderer(() -> FlywheelRenderer::new)
.register();
public static final BlockEntityEntry<MillstoneTileEntity> MILLSTONE = Create.registrate()
public static final BlockEntityEntry<MillstoneTileEntity> MILLSTONE = REGISTRATE
.tileEntity("millstone", MillstoneTileEntity::new)
.instance(() -> MillStoneCogInstance::new, false)
.validBlocks(AllBlocks.MILLSTONE)
.renderer(() -> MillstoneRenderer::new)
.register();
public static final BlockEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = Create.registrate()
public static final BlockEntityEntry<CrushingWheelTileEntity> CRUSHING_WHEEL = REGISTRATE
.tileEntity("crushing_wheel", CrushingWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new, false)
.validBlocks(AllBlocks.CRUSHING_WHEEL)
@ -566,114 +567,114 @@ public class AllTileEntities {
.register();
public static final BlockEntityEntry<CrushingWheelControllerTileEntity> CRUSHING_WHEEL_CONTROLLER =
Create.registrate()
REGISTRATE
.tileEntity("crushing_wheel_controller", CrushingWheelControllerTileEntity::new)
.validBlocks(AllBlocks.CRUSHING_WHEEL_CONTROLLER)
// .renderer(() -> renderer)
.register();
public static final BlockEntityEntry<WaterWheelTileEntity> WATER_WHEEL = Create.registrate()
public static final BlockEntityEntry<WaterWheelTileEntity> WATER_WHEEL = REGISTRATE
.tileEntity("water_wheel", WaterWheelTileEntity::new)
.instance(() -> CutoutRotatingInstance::new, false)
.validBlocks(AllBlocks.WATER_WHEEL)
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = Create.registrate()
public static final BlockEntityEntry<MechanicalPressTileEntity> MECHANICAL_PRESS = REGISTRATE
.tileEntity("mechanical_press", MechanicalPressTileEntity::new)
.instance(() -> PressInstance::new)
.validBlocks(AllBlocks.MECHANICAL_PRESS)
.renderer(() -> MechanicalPressRenderer::new)
.register();
public static final BlockEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = Create.registrate()
public static final BlockEntityEntry<MechanicalMixerTileEntity> MECHANICAL_MIXER = REGISTRATE
.tileEntity("mechanical_mixer", MechanicalMixerTileEntity::new)
.instance(() -> MixerInstance::new)
.validBlocks(AllBlocks.MECHANICAL_MIXER)
.renderer(() -> MechanicalMixerRenderer::new)
.register();
public static final BlockEntityEntry<DeployerTileEntity> DEPLOYER = Create.registrate()
public static final BlockEntityEntry<DeployerTileEntity> DEPLOYER = REGISTRATE
.tileEntity("deployer", DeployerTileEntity::new)
.instance(() -> DeployerInstance::new)
.validBlocks(AllBlocks.DEPLOYER)
.renderer(() -> DeployerRenderer::new)
.register();
public static final BlockEntityEntry<BasinTileEntity> BASIN = Create.registrate()
public static final BlockEntityEntry<BasinTileEntity> BASIN = REGISTRATE
.tileEntity("basin", BasinTileEntity::new)
.validBlocks(AllBlocks.BASIN)
.renderer(() -> BasinRenderer::new)
.register();
public static final BlockEntityEntry<BlazeBurnerTileEntity> HEATER = Create.registrate()
public static final BlockEntityEntry<BlazeBurnerTileEntity> HEATER = REGISTRATE
.tileEntity("blaze_heater", BlazeBurnerTileEntity::new)
.validBlocks(AllBlocks.BLAZE_BURNER)
.renderer(() -> BlazeBurnerRenderer::new)
.register();
public static final BlockEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = Create.registrate()
public static final BlockEntityEntry<MechanicalCrafterTileEntity> MECHANICAL_CRAFTER = REGISTRATE
.tileEntity("mechanical_crafter", MechanicalCrafterTileEntity::new)
.instance(() -> MechanicalCrafterInstance::new)
.validBlocks(AllBlocks.MECHANICAL_CRAFTER)
.renderer(() -> MechanicalCrafterRenderer::new)
.register();
public static final BlockEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = Create.registrate()
public static final BlockEntityEntry<SequencedGearshiftTileEntity> SEQUENCED_GEARSHIFT = REGISTRATE
.tileEntity("sequenced_gearshift", SequencedGearshiftTileEntity::new)
.instance(() -> SplitShaftInstance::new, false)
.validBlocks(AllBlocks.SEQUENCED_GEARSHIFT)
.renderer(() -> SplitShaftRenderer::new)
.register();
public static final BlockEntityEntry<SpeedControllerTileEntity> ROTATION_SPEED_CONTROLLER = Create.registrate()
public static final BlockEntityEntry<SpeedControllerTileEntity> ROTATION_SPEED_CONTROLLER = REGISTRATE
.tileEntity("rotation_speed_controller", SpeedControllerTileEntity::new)
.instance(() -> ShaftInstance::new)
.validBlocks(AllBlocks.ROTATION_SPEED_CONTROLLER)
.renderer(() -> SpeedControllerRenderer::new)
.register();
public static final BlockEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = Create.registrate()
public static final BlockEntityEntry<SpeedGaugeTileEntity> SPEEDOMETER = REGISTRATE
.tileEntity("speedometer", SpeedGaugeTileEntity::new)
.instance(() -> GaugeInstance.Speed::new)
.validBlocks(AllBlocks.SPEEDOMETER)
.renderer(() -> GaugeRenderer::speed)
.register();
public static final BlockEntityEntry<StressGaugeTileEntity> STRESSOMETER = Create.registrate()
public static final BlockEntityEntry<StressGaugeTileEntity> STRESSOMETER = REGISTRATE
.tileEntity("stressometer", StressGaugeTileEntity::new)
.instance(() -> GaugeInstance.Stress::new)
.validBlocks(AllBlocks.STRESSOMETER)
.renderer(() -> GaugeRenderer::stress)
.register();
public static final BlockEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = Create.registrate()
public static final BlockEntityEntry<AnalogLeverTileEntity> ANALOG_LEVER = REGISTRATE
.tileEntity("analog_lever", AnalogLeverTileEntity::new)
.instance(() -> AnalogLeverInstance::new, false)
.validBlocks(AllBlocks.ANALOG_LEVER)
.renderer(() -> AnalogLeverRenderer::new)
.register();
public static final BlockEntityEntry<PlacardTileEntity> PLACARD = Create.registrate()
public static final BlockEntityEntry<PlacardTileEntity> PLACARD = REGISTRATE
.tileEntity("placard", PlacardTileEntity::new)
.validBlocks(AllBlocks.PLACARD)
.renderer(() -> PlacardRenderer::new)
.register();
public static final BlockEntityEntry<CartAssemblerTileEntity> CART_ASSEMBLER = Create.registrate()
public static final BlockEntityEntry<CartAssemblerTileEntity> CART_ASSEMBLER = REGISTRATE
.tileEntity("cart_assembler", CartAssemblerTileEntity::new)
.validBlocks(AllBlocks.CART_ASSEMBLER)
// .renderer(() -> renderer)
.register();
// Logistics
public static final BlockEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = Create.registrate()
public static final BlockEntityEntry<RedstoneLinkTileEntity> REDSTONE_LINK = REGISTRATE
.tileEntity("redstone_link", RedstoneLinkTileEntity::new)
.validBlocks(AllBlocks.REDSTONE_LINK)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<NixieTubeTileEntity> NIXIE_TUBE = Create.registrate()
public static final BlockEntityEntry<NixieTubeTileEntity> NIXIE_TUBE = REGISTRATE
.tileEntity("nixie_tube", NixieTubeTileEntity::new)
.validBlocks(AllBlocks.ORANGE_NIXIE_TUBE)
.validBlocks(AllBlocks.NIXIE_TUBES.toArray())
@ -682,38 +683,38 @@ public class AllTileEntities {
.onRegister(assignDataBehaviourTE(new NixieTubeDisplaySource()))
.register();
public static final BlockEntityEntry<DisplayLinkTileEntity> DISPLAY_LINK = Create.registrate()
public static final BlockEntityEntry<DisplayLinkTileEntity> DISPLAY_LINK = REGISTRATE
.tileEntity("display_link", DisplayLinkTileEntity::new)
.validBlocks(AllBlocks.DISPLAY_LINK)
.renderer(() -> DisplayLinkRenderer::new)
.register();
public static final BlockEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = Create.registrate()
public static final BlockEntityEntry<StockpileSwitchTileEntity> STOCKPILE_SWITCH = REGISTRATE
.tileEntity("stockpile_switch", StockpileSwitchTileEntity::new)
.validBlocks(AllBlocks.STOCKPILE_SWITCH)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = Create.registrate()
public static final BlockEntityEntry<CreativeCrateTileEntity> CREATIVE_CRATE = REGISTRATE
.tileEntity("creative_crate", CreativeCrateTileEntity::new)
.validBlocks(AllBlocks.CREATIVE_CRATE)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<DepotTileEntity> DEPOT = Create.registrate()
public static final BlockEntityEntry<DepotTileEntity> DEPOT = REGISTRATE
.tileEntity("depot", DepotTileEntity::new)
.validBlocks(AllBlocks.DEPOT)
.renderer(() -> DepotRenderer::new)
.register();
public static final BlockEntityEntry<EjectorTileEntity> WEIGHTED_EJECTOR = Create.registrate()
public static final BlockEntityEntry<EjectorTileEntity> WEIGHTED_EJECTOR = REGISTRATE
.tileEntity("weighted_ejector", EjectorTileEntity::new)
.instance(() -> EjectorInstance::new)
.validBlocks(AllBlocks.WEIGHTED_EJECTOR)
.renderer(() -> EjectorRenderer::new)
.register();
public static final BlockEntityEntry<FunnelTileEntity> FUNNEL = Create.registrate()
public static final BlockEntityEntry<FunnelTileEntity> FUNNEL = REGISTRATE
.tileEntity("funnel", FunnelTileEntity::new)
.instance(() -> FunnelInstance::new)
.validBlocks(AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.ANDESITE_FUNNEL,
@ -721,103 +722,103 @@ public class AllTileEntities {
.renderer(() -> FunnelRenderer::new)
.register();
public static final BlockEntityEntry<ContentObserverTileEntity> CONTENT_OBSERVER = Create.registrate()
public static final BlockEntityEntry<ContentObserverTileEntity> CONTENT_OBSERVER = REGISTRATE
.tileEntity("content_observer", ContentObserverTileEntity::new)
.validBlocks(AllBlocks.CONTENT_OBSERVER)
.renderer(() -> SmartTileEntityRenderer::new)
.register();
public static final BlockEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = Create.registrate()
public static final BlockEntityEntry<PulseExtenderTileEntity> PULSE_EXTENDER = REGISTRATE
.tileEntity("pulse_extender", PulseExtenderTileEntity::new)
.instance(() -> BrassDiodeInstance::new, false)
.validBlocks(AllBlocks.PULSE_EXTENDER)
.renderer(() -> BrassDiodeRenderer::new)
.register();
public static final BlockEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER = Create.registrate()
public static final BlockEntityEntry<PulseRepeaterTileEntity> PULSE_REPEATER = REGISTRATE
.tileEntity("pulse_repeater", PulseRepeaterTileEntity::new)
.instance(() -> BrassDiodeInstance::new, false)
.validBlocks(AllBlocks.PULSE_REPEATER)
.renderer(() -> BrassDiodeRenderer::new)
.register();
public static final BlockEntityEntry<LecternControllerTileEntity> LECTERN_CONTROLLER = Create.registrate()
public static final BlockEntityEntry<LecternControllerTileEntity> LECTERN_CONTROLLER = REGISTRATE
.tileEntity("lectern_controller", LecternControllerTileEntity::new)
.validBlocks(AllBlocks.LECTERN_CONTROLLER)
.renderer(() -> LecternControllerRenderer::new)
.register();
// Curiosities
public static final BlockEntityEntry<CopperBacktankTileEntity> COPPER_BACKTANK = Create.registrate()
public static final BlockEntityEntry<CopperBacktankTileEntity> COPPER_BACKTANK = REGISTRATE
.tileEntity("copper_backtank", CopperBacktankTileEntity::new)
.instance(() -> CopperBacktankInstance::new)
.validBlocks(AllBlocks.COPPER_BACKTANK)
.renderer(() -> CopperBacktankRenderer::new)
.register();
public static final BlockEntityEntry<PeculiarBellTileEntity> PECULIAR_BELL = Create.registrate()
public static final BlockEntityEntry<PeculiarBellTileEntity> PECULIAR_BELL = REGISTRATE
.tileEntity("peculiar_bell", PeculiarBellTileEntity::new)
.validBlocks(AllBlocks.PECULIAR_BELL)
.renderer(() -> BellRenderer::new)
.register();
public static final BlockEntityEntry<HauntedBellTileEntity> HAUNTED_BELL = Create.registrate()
public static final BlockEntityEntry<HauntedBellTileEntity> HAUNTED_BELL = REGISTRATE
.tileEntity("cursed_bell", HauntedBellTileEntity::new)
.validBlocks(AllBlocks.HAUNTED_BELL)
.renderer(() -> BellRenderer::new)
.register();
public static final BlockEntityEntry<ToolboxTileEntity> TOOLBOX = Create.registrate()
public static final BlockEntityEntry<ToolboxTileEntity> TOOLBOX = REGISTRATE
.tileEntity("toolbox", ToolboxTileEntity::new)
.instance(() -> ToolBoxInstance::new, false)
.validBlocks(AllBlocks.TOOLBOXES.toArray())
.renderer(() -> ToolboxRenderer::new)
.register();
public static final BlockEntityEntry<TrackTileEntity> TRACK = Create.registrate()
public static final BlockEntityEntry<TrackTileEntity> TRACK = REGISTRATE
.tileEntity("track", TrackTileEntity::new)
.instance(() -> TrackInstance::new)
.renderer(() -> TrackRenderer::new)
.validBlocks(AllBlocks.TRACK)
.register();
public static final BlockEntityEntry<FakeTrackTileEntity> FAKE_TRACK = Create.registrate()
public static final BlockEntityEntry<FakeTrackTileEntity> FAKE_TRACK = REGISTRATE
.tileEntity("fake_track", FakeTrackTileEntity::new)
.validBlocks(AllBlocks.FAKE_TRACK)
.register();
public static final BlockEntityEntry<StandardBogeyTileEntity> BOGEY = Create.registrate()
public static final BlockEntityEntry<StandardBogeyTileEntity> BOGEY = REGISTRATE
.tileEntity("bogey", StandardBogeyTileEntity::new)
.renderer(() -> BogeyTileEntityRenderer::new)
.validBlocks(AllBlocks.SMALL_BOGEY, AllBlocks.LARGE_BOGEY)
.register();
public static final BlockEntityEntry<StationTileEntity> TRACK_STATION = Create.registrate()
public static final BlockEntityEntry<StationTileEntity> TRACK_STATION = REGISTRATE
.tileEntity("track_station", StationTileEntity::new)
.renderer(() -> StationRenderer::new)
.validBlocks(AllBlocks.TRACK_STATION)
.register();
public static final BlockEntityEntry<SlidingDoorTileEntity> SLIDING_DOOR = Create.registrate()
public static final BlockEntityEntry<SlidingDoorTileEntity> SLIDING_DOOR = REGISTRATE
.tileEntity("sliding_door", SlidingDoorTileEntity::new)
.renderer(() -> SlidingDoorRenderer::new)
.validBlocks(AllBlocks.TRAIN_DOOR, AllBlocks.FRAMED_GLASS_DOOR)
.register();
public static final BlockEntityEntry<FlapDisplayTileEntity> FLAP_DISPLAY = Create.registrate()
public static final BlockEntityEntry<FlapDisplayTileEntity> FLAP_DISPLAY = REGISTRATE
.tileEntity("flap_display", FlapDisplayTileEntity::new)
.instance(() -> MechanicalCrafterInstance::new)
.renderer(() -> FlapDisplayRenderer::new)
.validBlocks(AllBlocks.DISPLAY_BOARD)
.register();
public static final BlockEntityEntry<SignalTileEntity> TRACK_SIGNAL = Create.registrate()
public static final BlockEntityEntry<SignalTileEntity> TRACK_SIGNAL = REGISTRATE
.tileEntity("track_signal", SignalTileEntity::new)
.renderer(() -> SignalRenderer::new)
.validBlocks(AllBlocks.TRACK_SIGNAL)
.register();
public static final BlockEntityEntry<TrackObserverTileEntity> TRACK_OBSERVER = Create.registrate()
public static final BlockEntityEntry<TrackObserverTileEntity> TRACK_OBSERVER = REGISTRATE
.tileEntity("track_observer", TrackObserverTileEntity::new)
.renderer(() -> TrackObserverRenderer::new)
.validBlocks(AllBlocks.TRACK_OBSERVER)

View file

@ -2,11 +2,11 @@ package com.simibubi.create;
import java.util.Random;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mojang.logging.LogUtils;
import com.simibubi.create.api.behaviour.BlockSpoutingBehaviour;
import com.simibubi.create.compat.Mods;
import com.simibubi.create.compat.curios.Curios;
@ -31,6 +31,7 @@ import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.config.ContraptionMovementSetting;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.data.LangMerger;
import com.simibubi.create.foundation.data.TagGen;
import com.simibubi.create.foundation.data.recipe.MechanicalCraftingRecipeGen;
import com.simibubi.create.foundation.data.recipe.ProcessingRecipeGen;
import com.simibubi.create.foundation.data.recipe.SequencedAssemblyRecipeGen;
@ -41,7 +42,6 @@ import com.simibubi.create.foundation.worldgen.AllFeatures;
import com.simibubi.create.foundation.worldgen.AllOreFeatureConfigEntries;
import com.simibubi.create.foundation.worldgen.AllPlacementModifiers;
import com.simibubi.create.foundation.worldgen.BuiltinRegistration;
import com.tterrag.registrate.util.nullness.NonNullSupplier;
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
@ -66,14 +66,20 @@ public class Create {
public static final String ID = "create";
public static final String NAME = "Create";
public static final String VERSION = "0.5e";
public static final String VERSION = "0.5g";
public static final Logger LOGGER = LogManager.getLogger();
public static final Logger LOGGER = LogUtils.getLogger();
public static final Gson GSON = new GsonBuilder().setPrettyPrinting()
.disableHtmlEscaping()
.create();
/** Use the {@link Random} of a local {@link Level} or {@link Entity} or create one */
@Deprecated
public static final Random RANDOM = new Random();
public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(ID);
public static final CreativeModeTab BASE_CREATIVE_TAB = new CreateItemGroup();
public static final CreativeModeTab PALETTES_CREATIVE_TAB = new PalettesItemGroup();
@ -82,11 +88,6 @@ public class Create {
public static final TorquePropagator TORQUE_PROPAGATOR = new TorquePropagator();
public static final GlobalRailwayManager RAILWAYS = new GlobalRailwayManager();
public static final ServerLagger LAGGER = new ServerLagger();
/** Use the {@link Random} of a local {@link Level} or {@link Entity} or create one */
@Deprecated
public static final Random RANDOM = new Random();
private static final NonNullSupplier<CreateRegistrate> REGISTRATE = CreateRegistrate.lazy(ID);
public Create() {
onCtor();
@ -99,11 +100,13 @@ public class Create {
.getModEventBus();
IEventBus forgeEventBus = MinecraftForge.EVENT_BUS;
REGISTRATE.registerEventListeners(modEventBus);
AllSoundEvents.prepare();
AllTags.init();
AllBlocks.register();
AllItems.register();
AllFluids.register();
AllTags.register();
AllPaletteBlocks.register();
AllContainerTypes.register();
AllEntityTypes.register();
@ -138,7 +141,7 @@ public class Create {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.onCtorClient(modEventBus, forgeEventBus));
Mods.CURIOS.executeIfInstalled(() -> Curios::init);
Mods.CURIOS.executeIfInstalled(() -> () -> Curios.init(modEventBus, forgeEventBus));
}
public static void init(final FMLCommonSetupEvent event) {
@ -155,6 +158,7 @@ public class Create {
}
public static void gatherData(GatherDataEvent event) {
TagGen.datagen();
DataGenerator gen = event.getGenerator();
if (event.includeClient()) {
gen.addProvider(new LangMerger(gen));
@ -170,10 +174,6 @@ public class Create {
}
}
public static CreateRegistrate registrate() {
return REGISTRATE.get();
}
public static ResourceLocation asResource(String path) {
return new ResourceLocation(ID, path);
}

View file

@ -1,36 +1,33 @@
package com.simibubi.create.compat.curios;
import java.util.concurrent.atomic.AtomicBoolean;
import com.simibubi.create.AllItems;
import com.simibubi.create.content.contraptions.goggles.GogglesItem;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import top.theillusivec4.curios.api.CuriosCapability;
import top.theillusivec4.curios.api.SlotTypeMessage;
import top.theillusivec4.curios.api.SlotTypePreset;
import top.theillusivec4.curios.api.type.inventory.ICurioStacksHandler;
public class Curios {
public static void init() {
FMLJavaModLoadingContext.get().getModEventBus().addListener(Curios::onInterModEnqueue);
FMLJavaModLoadingContext.get().getModEventBus().addListener(Curios::onClientSetup);
public static void init(IEventBus modEventBus, IEventBus forgeEventBus) {
modEventBus.addListener(Curios::onInterModEnqueue);
modEventBus.addListener(Curios::onClientSetup);
GogglesItem.addIsWearingPredicate(player -> {
AtomicBoolean hasGoggles = new AtomicBoolean(false);
player.getCapability(CuriosCapability.INVENTORY).ifPresent(handler -> {
ICurioStacksHandler stacksHandler = handler.getCurios().get("head");
if(stacksHandler != null) hasGoggles.set(stacksHandler.getStacks().getStackInSlot(0).getItem() == AllItems.GOGGLES.get());
});
return hasGoggles.get();
});
GogglesItem.addIsWearingPredicate(player -> player.getCapability(CuriosCapability.INVENTORY).map(handler -> {
ICurioStacksHandler stacksHandler = handler.getCurios().get("head");
if (stacksHandler != null) {
return AllItems.GOGGLES.isIn(stacksHandler.getStacks().getStackInSlot(0));
}
return false;
}).orElse(false));
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> FMLJavaModLoadingContext.get().getModEventBus().addListener(CuriosRenderers::onLayerRegister));
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(CuriosRenderers::onLayerRegister));
}
private static void onInterModEnqueue(final InterModEnqueueEvent event) {

View file

@ -16,12 +16,12 @@ public enum AllSections {
/** Item transport and other Utility */
LOGISTICS(Palette.Yellow),
/** Tools for strucuture movement and replication */
/** Tools for structure movement and replication */
SCHEMATICS(Palette.Blue),
/** Decorative blocks */
PALETTES(Palette.Green),
/** Helpful gadgets and other shenanigans */
CURIOSITIES(Palette.Purple),
@ -33,7 +33,7 @@ public enum AllSections {
;
private Palette tooltipPalette;
private final Palette tooltipPalette;
private AllSections(Palette tooltipPalette) {
this.tooltipPalette = tooltipPalette;
@ -51,12 +51,12 @@ public enum AllSections {
}
static AllSections ofItem(Item item) {
return Create.registrate()
return Create.REGISTRATE
.getSection(item);
}
static AllSections ofBlock(Block block) {
return Create.registrate()
return Create.REGISTRATE
.getSection(block);
}

View file

@ -15,7 +15,6 @@ import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.AllTags;
import com.simibubi.create.content.contraptions.components.actors.BlockBreakingKineticTileEntity;
import com.simibubi.create.content.contraptions.itemAssembly.SequencedAssemblyRecipe;
import com.simibubi.create.content.contraptions.processing.ProcessingInventory;

View file

@ -21,8 +21,6 @@ import java.util.function.BiConsumer;
import javax.annotation.Nullable;
import net.minecraft.world.level.block.DoorBlock;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
@ -95,6 +93,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.ButtonBlock;
import net.minecraft.world.level.block.ChestBlock;
import net.minecraft.world.level.block.DoorBlock;
import net.minecraft.world.level.block.PressurePlateBlock;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;

View file

@ -7,7 +7,7 @@ import java.util.stream.Collectors;
import javax.annotation.ParametersAreNonnullByDefault;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import com.google.gson.JsonObject;
import com.simibubi.create.Create;

View file

@ -1,5 +1,6 @@
package com.simibubi.create.content.palettes;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.foundation.data.WindowGen.customWindowBlock;
import static com.simibubi.create.foundation.data.WindowGen.customWindowPane;
import static com.simibubi.create.foundation.data.WindowGen.framedGlass;
@ -13,7 +14,6 @@ import com.simibubi.create.content.AllSections;
import com.simibubi.create.foundation.block.connected.HorizontalCTBehaviour;
import com.simibubi.create.foundation.block.connected.SimpleCTBehaviour;
import com.simibubi.create.foundation.data.BlockStateGen;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.data.WindowGen;
import com.tterrag.registrate.util.DataIngredient;
import com.tterrag.registrate.util.entry.BlockEntry;
@ -30,9 +30,11 @@ import net.minecraftforge.common.Tags;
public class AllPaletteBlocks {
private static final CreateRegistrate REGISTRATE = Create.registrate()
.creativeModeTab(() -> Create.PALETTES_CREATIVE_TAB)
.startSection(AllSections.PALETTES);
static {
REGISTRATE
.creativeModeTab(() -> Create.PALETTES_CREATIVE_TAB)
.startSection(AllSections.PALETTES);
}
// Windows and Glass

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.palettes;
import static com.simibubi.create.AllTags.pickaxeOnly;
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
import java.util.Arrays;
import java.util.function.Supplier;
@ -54,7 +54,7 @@ public abstract class PaletteBlockPartial<B extends Block> {
String patternName = Lang.nonPluralId(pattern.createName(variantName));
String blockName = patternName + "_" + this.name;
BlockBuilder<B, CreateRegistrate> blockBuilder = Create.registrate()
BlockBuilder<B, CreateRegistrate> blockBuilder = Create.REGISTRATE
.block(blockName, p -> createBlock(block))
.blockstate((c, p) -> generateBlockState(c, p, variantName, pattern, block))
.recipe((c, p) -> createRecipes(variant, block, c, p))

View file

@ -1,10 +1,10 @@
package com.simibubi.create.content.palettes;
import static com.simibubi.create.AllTags.pickaxeOnly;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
import com.google.common.collect.ImmutableList;
import com.simibubi.create.Create;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.builders.ItemBuilder;
@ -26,12 +26,11 @@ public class PalettesVariantEntry {
public PalettesVariantEntry(String name, AllPaletteStoneTypes paletteStoneVariants) {
ImmutableList.Builder<BlockEntry<? extends Block>> registeredBlocks = ImmutableList.builder();
ImmutableList.Builder<BlockEntry<? extends Block>> registeredPartials = ImmutableList.builder();
CreateRegistrate registrate = Create.registrate();
NonNullSupplier<Block> baseBlock = paletteStoneVariants.baseBlock;
for (PaletteBlockPattern pattern : paletteStoneVariants.variantTypes) {
BlockBuilder<? extends Block, CreateRegistrate> builder =
registrate.block(pattern.createName(name), pattern.getBlockFactory())
REGISTRATE.block(pattern.createName(name), pattern.getBlockFactory())
.initialProperties(baseBlock)
.transform(pickaxeOnly())
.blockstate(pattern.getBlockStateGenerator()

View file

@ -59,7 +59,7 @@ public class ClientSchematicLoader {
Path path = Paths.get("schematics", schematic);
if (!Files.exists(path)) {
Create.LOGGER.fatal("Missing Schematic file: " + path.toString());
Create.LOGGER.error("Missing Schematic file: " + path.toString());
return;
}

View file

@ -252,7 +252,7 @@ public class SchematicAndQuillHandler {
if (!convertImmediately)
return;
if (!Files.exists(path)) {
Create.LOGGER.fatal("Missing Schematic file: " + path.toString());
Create.LOGGER.error("Missing Schematic file: " + path.toString());
return;
}
try {
@ -261,7 +261,7 @@ public class SchematicAndQuillHandler {
AllPackets.channel.sendToServer(new InstantSchematicPacket(filename, origin, bounds));
} catch (IOException e) {
Create.LOGGER.fatal("Error finding Schematic file: " + path.toString());
Create.LOGGER.error("Error finding Schematic file: " + path.toString());
e.printStackTrace();
return;
}

View file

@ -12,9 +12,9 @@ import java.util.zip.GZIPInputStream;
import javax.annotation.Nonnull;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import com.mojang.logging.LogUtils;
import com.simibubi.create.AllItems;
import com.simibubi.create.content.schematics.SchematicProcessor;
import com.simibubi.create.content.schematics.client.SchematicEditScreen;
@ -53,7 +53,7 @@ import net.minecraftforge.fml.util.thread.SidedThreadGroups;
public class SchematicItem extends Item {
private static final Logger LOGGER = LogManager.getLogger();
private static final Logger LOGGER = LogUtils.getLogger();
public SchematicItem(Properties properties) {
super(properties);

View file

@ -13,13 +13,13 @@ import java.util.Set;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import com.google.common.collect.Sets;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.mojang.logging.LogUtils;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllFluids;
import com.simibubi.create.AllItems;
@ -618,8 +618,8 @@ public class AllAdvancements implements DataProvider {
// Datagen
private static final Logger LOGGER = LogManager.getLogger();
private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting()
private static final Logger LOGGER = LogUtils.getLogger();
private static final Gson GSON = new GsonBuilder().setPrettyPrinting()
.create();
private final DataGenerator generator;

View file

@ -9,7 +9,7 @@ import java.util.function.Supplier;
import org.apache.commons.lang3.ArrayUtils;
import com.simibubi.create.AllTags;
import com.simibubi.create.foundation.data.TagGen;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.RegisteredObjects;
@ -126,7 +126,7 @@ public class CopperBlockSet {
.loot((lt, block) -> variant.generateLootTable(lt, block, this, state, waxed))
.blockstate((ctx, prov) -> variant.generateBlockState(ctx, prov, this, state, waxed))
.recipe((c, p) -> variant.generateRecipes(entries.get(BlockVariant.INSTANCE)[state.ordinal()], c, p))
.transform(AllTags.pickaxeOnly())
.transform(TagGen.pickaxeOnly())
.tag(BlockTags.NEEDS_STONE_TOOL)
.simpleItem();

View file

@ -3,8 +3,9 @@ package com.simibubi.create.foundation.command;
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.apache.logging.log4j.LogManager;
import org.slf4j.Logger;
import com.mojang.logging.LogUtils;
import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.goggles.GoggleConfigScreen;
import com.simibubi.create.content.logistics.trains.CameraDistanceModifier;
@ -36,6 +37,8 @@ import net.minecraftforge.network.NetworkEvent;
public class SConfigureConfigPacket extends SimplePacketBase {
private static final Logger LOGGER = LogUtils.getLogger();
private final String option;
private final String value;
@ -68,8 +71,7 @@ public class SConfigureConfigPacket extends SimplePacketBase {
Actions.valueOf(option)
.performAction(value);
} catch (IllegalArgumentException e) {
LogManager.getLogger()
.warn("Received ConfigureConfigPacket with invalid Option: " + option);
LOGGER.warn("Received ConfigureConfigPacket with invalid Option: " + option);
}
}));

View file

@ -2,11 +2,11 @@ package com.simibubi.create.foundation.data;
import static com.simibubi.create.AllInteractionBehaviours.interactionBehaviour;
import static com.simibubi.create.AllMovementBehaviours.movementBehaviour;
import static com.simibubi.create.AllTags.axeOrPickaxe;
import static com.simibubi.create.AllTags.pickaxeOnly;
import static com.simibubi.create.foundation.data.BlockStateGen.axisBlock;
import static com.simibubi.create.foundation.data.CreateRegistrate.casingConnectivity;
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe;
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
import java.util.HashMap;
import java.util.Map;

View file

@ -1,6 +1,6 @@
package com.simibubi.create.foundation.data;
import static com.simibubi.create.AllTags.pickaxeOnly;
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
import java.util.Collection;
import java.util.IdentityHashMap;
@ -45,6 +45,7 @@ import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import net.minecraftforge.fml.DistExecutor;
@ -53,29 +54,38 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
import net.minecraftforge.registries.RegistryObject;
public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
protected CreateRegistrate(String modid) {
super(modid);
}
public static CreateRegistrate create(String modid) {
return new CreateRegistrate(modid);
}
@Deprecated(forRemoval = true)
public static NonNullSupplier<CreateRegistrate> lazy(String modid) {
return NonNullSupplier
.lazy(() -> new CreateRegistrate(modid).registerEventListeners(FMLJavaModLoadingContext.get()
.getModEventBus()));
}
@Override
public CreateRegistrate registerEventListeners(IEventBus bus) {
return super.registerEventListeners(bus);
}
/* Section Tracking */
private static Map<RegistryEntry<?>, AllSections> sectionLookup = new IdentityHashMap<>();
private AllSections section;
protected static final Map<RegistryEntry<?>, AllSections> SECTION_LOOKUP = new IdentityHashMap<>();
protected AllSections currentSection;
public CreateRegistrate startSection(AllSections section) {
this.section = section;
this.currentSection = section;
return this;
}
public AllSections currentSection() {
return section;
return currentSection;
}
@Override
@ -83,26 +93,25 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
ResourceKey<? extends Registry<R>> type, Builder<R, T, ?, ?> builder, NonNullSupplier<? extends T> creator,
NonNullFunction<RegistryObject<T>, ? extends RegistryEntry<T>> entryFactory) {
RegistryEntry<T> ret = super.accept(name, type, builder, creator, entryFactory);
sectionLookup.put(ret, currentSection());
SECTION_LOOKUP.put(ret, currentSection());
return ret;
}
public void addToSection(RegistryEntry<?> entry, AllSections section) {
sectionLookup.put(entry, section);
SECTION_LOOKUP.put(entry, section);
}
public AllSections getSection(RegistryEntry<?> entry) {
return sectionLookup.getOrDefault(entry, AllSections.UNASSIGNED);
return SECTION_LOOKUP.getOrDefault(entry, AllSections.UNASSIGNED);
}
public AllSections getSection(IForgeRegistryEntry<?> entry) {
return sectionLookup.entrySet()
.stream()
.filter(e -> e.getKey()
.get() == entry)
.map(Entry::getValue)
.findFirst()
.orElse(AllSections.UNASSIGNED);
for (Entry<RegistryEntry<?>, AllSections> mapEntry : SECTION_LOOKUP.entrySet()) {
if (mapEntry.getKey().get() == entry) {
return mapEntry.getValue();
}
}
return AllSections.UNASSIGNED;
}
public <R extends IForgeRegistryEntry<R>> Collection<RegistryEntry<R>> getAll(AllSections section,
@ -255,5 +264,4 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
CreateClient.MODEL_SWAPPER.getCustomBlockModels()
.register(RegisteredObjects.getKeyOrThrow(entry), model -> new CTModel(model, behavior));
}
}

View file

@ -0,0 +1,229 @@
package com.simibubi.create.foundation.data;
import com.simibubi.create.AllTags;
import com.simibubi.create.AllTags.AllBlockTags;
import com.simibubi.create.AllTags.AllFluidTags;
import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.Create;
import com.simibubi.create.foundation.data.recipe.Mods;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.builders.ItemBuilder;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.providers.RegistrateTagsProvider;
import com.tterrag.registrate.util.nullness.NonNullFunction;
import net.minecraft.data.tags.TagsProvider.TagAppender;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.common.Tags;
public class TagGen {
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> axeOrPickaxe() {
return b -> b.tag(BlockTags.MINEABLE_WITH_AXE)
.tag(BlockTags.MINEABLE_WITH_PICKAXE);
}
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> axeOnly() {
return b -> b.tag(BlockTags.MINEABLE_WITH_AXE);
}
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> pickaxeOnly() {
return b -> b.tag(BlockTags.MINEABLE_WITH_PICKAXE);
}
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, ItemBuilder<BlockItem, BlockBuilder<T, P>>> tagBlockAndItem(
String... path) {
return b -> {
for (String p : path)
b.tag(AllTags.forgeBlockTag(p));
ItemBuilder<BlockItem, BlockBuilder<T, P>> item = b.item();
for (String p : path)
item.tag(AllTags.forgeItemTag(p));
return item;
};
}
public static <T extends TagAppender<?>> T addOptional(T appender, Mods mod, String id) {
appender.addOptional(mod.asResource(id));
return appender;
}
public static <T extends TagAppender<?>> T addOptional(T appender, Mods mod, String... ids) {
for (String id : ids) {
appender.addOptional(mod.asResource(id));
}
return appender;
}
public static void datagen() {
Create.REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, TagGen::genBlockTags);
Create.REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, TagGen::genItemTags);
Create.REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, TagGen::genFluidTags);
}
private static void genBlockTags(RegistrateTagsProvider<Block> prov) {
prov.tag(AllBlockTags.BRITTLE.tag)
.add(Blocks.BELL, Blocks.COCOA, Blocks.FLOWER_POT)
.addTag(BlockTags.BEDS)
.addTag(BlockTags.DOORS);
prov.tag(AllBlockTags.FAN_TRANSPARENT.tag)
.add(Blocks.IRON_BARS)
.addTag(BlockTags.CAMPFIRES)
.addTag(BlockTags.FENCES);
prov.tag(AllBlockTags.ORE_OVERRIDE_STONE.tag)
.addTag(BlockTags.STONE_ORE_REPLACEABLES);
prov.tag(AllBlockTags.PASSIVE_BOILER_HEATERS.tag)
.add(Blocks.MAGMA_BLOCK, Blocks.LAVA)
.addTag(BlockTags.CAMPFIRES)
.addTag(BlockTags.FIRE);
prov.tag(AllBlockTags.SAFE_NBT.tag)
.addTag(BlockTags.BANNERS)
.addTag(BlockTags.SIGNS);
prov.tag(AllBlockTags.TREE_ATTACHMENTS.tag)
.add(Blocks.BEE_NEST, Blocks.COCOA, Blocks.MOSS_CARPET, Blocks.SHROOMLIGHT, Blocks.VINE);
prov.tag(AllBlockTags.WINDMILL_SAILS.tag)
.addTag(BlockTags.WOOL);
prov.tag(AllBlockTags.WRENCH_PICKUP.tag)
.add(Blocks.REDSTONE_WIRE, Blocks.REDSTONE_TORCH, Blocks.REPEATER, Blocks.LEVER,
Blocks.COMPARATOR, Blocks.OBSERVER, Blocks.REDSTONE_WALL_TORCH, Blocks.PISTON, Blocks.STICKY_PISTON,
Blocks.TRIPWIRE, Blocks.TRIPWIRE_HOOK, Blocks.DAYLIGHT_DETECTOR, Blocks.TARGET, Blocks.HOPPER)
.addTag(BlockTags.BUTTONS)
.addTag(BlockTags.PRESSURE_PLATES)
.addTag(BlockTags.RAILS);
// COMPAT
addOptional(prov.tag(AllBlockTags.NON_MOVABLE.tag), Mods.IE,
"connector_lv", "connector_lv_relay", "connector_mv", "connector_mv_relay",
"connector_hv", "connector_hv_relay", "connector_bundled", "connector_structural",
"connector_redstone", "connector_probe", "breaker_switch");
// VALIDATE
for (AllBlockTags tag : AllBlockTags.values()) {
if (tag.alwaysDatagen) {
prov.getOrCreateRawBuilder(tag.tag);
}
}
}
private static void genItemTags(RegistrateTagsProvider<Item> prov) {
prov.tag(AllItemTags.SLEEPERS.tag)
.add(Items.STONE_SLAB, Items.SMOOTH_STONE_SLAB, Items.ANDESITE_SLAB);
prov.tag(AllItemTags.STRIPPED_LOGS.tag)
.addTag(AllItemTags.VANILLA_STRIPPED_LOGS.tag)
.addTag(AllItemTags.MODDED_STRIPPED_LOGS.tag);
prov.tag(AllItemTags.STRIPPED_WOOD.tag)
.addTag(AllItemTags.VANILLA_STRIPPED_WOOD.tag)
.addTag(AllItemTags.MODDED_STRIPPED_WOOD.tag);
prov.tag(AllItemTags.UPRIGHT_ON_BELT.tag)
.add(Items.GLASS_BOTTLE, Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION,
Items.HONEY_BOTTLE, Items.CAKE);
prov.tag(AllItemTags.VANILLA_STRIPPED_LOGS.tag)
.add(Items.STRIPPED_ACACIA_LOG, Items.STRIPPED_BIRCH_LOG, Items.STRIPPED_CRIMSON_STEM,
Items.STRIPPED_DARK_OAK_LOG, Items.STRIPPED_JUNGLE_LOG, Items.STRIPPED_OAK_LOG,
Items.STRIPPED_SPRUCE_LOG, Items.STRIPPED_WARPED_STEM);
prov.tag(AllItemTags.VANILLA_STRIPPED_WOOD.tag)
.add(Items.STRIPPED_ACACIA_WOOD, Items.STRIPPED_BIRCH_WOOD,
Items.STRIPPED_CRIMSON_HYPHAE, Items.STRIPPED_DARK_OAK_WOOD, Items.STRIPPED_JUNGLE_WOOD,
Items.STRIPPED_OAK_WOOD, Items.STRIPPED_SPRUCE_WOOD, Items.STRIPPED_WARPED_HYPHAE);
prov.tag(ItemTags.BEACON_PAYMENT_ITEMS)
.addTag(AllItemTags.CREATE_INGOTS.tag);
prov.tag(Tags.Items.INGOTS)
.addTag(AllItemTags.CREATE_INGOTS.tag);
// COMPAT
genStrippedWood(prov);
// VALIDATE
for (AllItemTags tag : AllItemTags.values()) {
if (tag.alwaysDatagen) {
prov.getOrCreateRawBuilder(tag.tag);
}
}
}
private static void genStrippedWood(RegistrateTagsProvider<Item> prov) {
TagAppender<Item> logAppender = prov.tag(AllItemTags.MODDED_STRIPPED_LOGS.tag);
TagAppender<Item> woodAppender = prov.tag(AllItemTags.MODDED_STRIPPED_WOOD.tag);
StrippedWoodHelper helper = new StrippedWoodHelper(logAppender, woodAppender);
helper.add(Mods.ARS_N, "blue_archwood", "purple_archwood", "green_archwood", "red_archwood");
helper.add(Mods.BTN, "livingwood", "dreamwood");
helper.add(Mods.FA, "cherrywood", "mysterywood");
helper.add(Mods.HEX, "akashic");
helper.add(Mods.ID, "menril");
helper.add(Mods.BYG, "aspen", "baobab", "enchanted", "cherry", "cika", "cypress", "ebony", "ether",
"fir", "green_enchanted", "holly", "jacaranda", "lament", "mahogany", "mangrove", "maple", "nightshade",
"palm", "palo_verde", "pine", "rainbow_eucalyptus", "redwood", "skyris", "willow", "witch_hazel",
"zelkova");
helper.add(Mods.SG, "netherwood");
helper.add(Mods.TF, "twilight_oak", "canopy", "mangrove", "dark", "time", "transformation", "mining",
"sorting");
helper.add(Mods.TIC, "greenheart", "skyroot", "bloodshroom");
helper.add(Mods.AP, "twisted");
helper.add(Mods.Q, "azalea", "blossom");
helper.add(Mods.ECO, "coconut", "walnut", "azalea");
helper.add(Mods.BOP, "fir", "redwood", "cherry", "mahogany", "jacaranda", "palm", "willow", "dead",
"magic", "umbran", "hellbark");
helper.add(Mods.BSK, "bluebright", "starlit", "frostbright", "lunar", "dusk", "maple", "cherry");
addOptional(logAppender, Mods.BYG, "stripped_bulbis_stem");
addOptional(woodAppender, Mods.BYG, "stripped_bulbis_wood");
}
private static void genFluidTags(RegistrateTagsProvider<Fluid> prov) {
prov.tag(AllFluidTags.BOTTOMLESS_ALLOW.tag)
.add(Fluids.WATER, Fluids.LAVA);
// VALIDATE
for (AllFluidTags tag : AllFluidTags.values()) {
if (tag.alwaysDatagen) {
prov.getOrCreateRawBuilder(tag.tag);
}
}
}
private static class StrippedWoodHelper {
protected final TagAppender<Item> logAppender;
protected final TagAppender<Item> woodAppender;
public StrippedWoodHelper(TagAppender<Item> logAppender, TagAppender<Item> woodAppender) {
this.logAppender = logAppender;
this.woodAppender = woodAppender;
}
public void add(Mods mod, String... woodTypes) {
for (String type : woodTypes) {
String strippedPre = mod.strippedIsSuffix ? "" : "stripped_";
String strippedPost = mod.strippedIsSuffix ? "_stripped" : "";
addOptional(logAppender, mod, strippedPre + type + "_log" + strippedPost);
addOptional(woodAppender, mod, strippedPre + type + (mod.omitWoodSuffix ? "" : "_wood") + strippedPost);
}
}
}
}

View file

@ -1,5 +1,6 @@
package com.simibubi.create.foundation.data;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
import java.util.function.Function;
@ -43,8 +44,6 @@ import net.minecraftforge.common.Tags;
public class WindowGen {
private static final CreateRegistrate REGISTRATE = Create.registrate();
private static Properties glassProperties(Properties p) {
return p.isValidSpawn(WindowGen::never)
.isRedstoneConductor(WindowGen::never)

View file

@ -64,7 +64,7 @@ public abstract class CreateItemGroupBase extends CreativeModeTab {
protected Collection<RegistryEntry<Block>> getBlocks() {
return getSections().stream()
.flatMap(s -> Create.registrate()
.flatMap(s -> Create.REGISTRATE
.getAll(s, Registry.BLOCK_REGISTRY)
.stream())
.collect(Collectors.toList());
@ -72,7 +72,7 @@ public abstract class CreateItemGroupBase extends CreativeModeTab {
protected Collection<RegistryEntry<Item>> getItems() {
return getSections().stream()
.flatMap(s -> Create.registrate()
.flatMap(s -> Create.REGISTRATE
.getAll(s, Registry.ITEM_REGISTRY)
.stream())
.collect(Collectors.toList());

View file

@ -1,5 +1,6 @@
package com.simibubi.create.foundation.render;
import java.nio.ByteBuffer;
import java.util.function.IntPredicate;
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
@ -11,8 +12,10 @@ import com.jozufozu.flywheel.util.DiffuseLightCalculator;
import com.jozufozu.flywheel.util.transform.TStack;
import com.jozufozu.flywheel.util.transform.Transform;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.BufferBuilder.DrawState;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.datafixers.util.Pair;
import com.mojang.math.Matrix3f;
import com.mojang.math.Matrix4f;
import com.mojang.math.Quaternion;
@ -67,14 +70,21 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
private static final Long2IntMap WORLD_LIGHT_CACHE = new Long2IntOpenHashMap();
public SuperByteBuffer(BufferBuilder buf) {
Pair<DrawState, ByteBuffer> pair = buf.popNextBuffer();
DrawState drawState = pair.getFirst();
ByteBuffer buffer = pair.getSecond();
int vertexCount = drawState.vertexCount();
int stride = drawState.format().getVertexSize();
if (buf instanceof ShadeSeparatedBufferBuilder separated) {
ShadedVertexList template = new BlockVertexList.Shaded(separated);
ShadedVertexList template = new BlockVertexList.Shaded(buffer, vertexCount, stride, separated.getUnshadedStartVertex());
shadedPredicate = template::isShaded;
this.template = template;
} else {
template = new BlockVertexList(buf);
template = new BlockVertexList(buffer, vertexCount, stride);
shadedPredicate = index -> true;
}
transforms = new PoseStack();
transforms.pushPose();
}

View file

@ -33,6 +33,6 @@ Technology that empowers the player.'''
[[dependencies.create]]
modId="flywheel"
mandatory=true
versionRange="[0.6.5,0.6.7)"
versionRange="[0.6.8,0.6.9)"
ordering="AFTER"
side="CLIENT"