Not client enough

- bump version
- actually fix ISTER dist issue
This commit is contained in:
simibubi 2021-10-23 03:50:49 +02:00
parent 140a4a2463
commit 2db2892033
4 changed files with 31 additions and 25 deletions

View File

@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false org.gradle.daemon = false
# mod version info # mod version info
mod_version = 0.3.2e mod_version = 0.3.2f
minecraft_version = 1.16.5 minecraft_version = 1.16.5
forge_version = 36.2.0 forge_version = 36.2.0

View File

@ -60,7 +60,7 @@ public class Create {
public static final String ID = "create"; public static final String ID = "create";
public static final String NAME = "Create"; public static final String NAME = "Create";
public static final String VERSION = "0.3.2e"; public static final String VERSION = "0.3.2f";
public static final Logger LOGGER = LogManager.getLogger(); public static final Logger LOGGER = LogManager.getLogger();

View File

@ -130,11 +130,13 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
} }
@Override @Override
public <T extends Entity> CreateEntityBuilder<T, CreateRegistrate> entity(String name, EntityType.IFactory<T> factory, EntityClassification classification) { public <T extends Entity> CreateEntityBuilder<T, CreateRegistrate> entity(String name,
EntityType.IFactory<T> factory, EntityClassification classification) {
return this.entity(self(), name, factory, classification); return this.entity(self(), name, factory, classification);
} }
public <T extends Entity, P> CreateEntityBuilder<T, P> entity(P parent, String name, EntityType.IFactory<T> factory, EntityClassification classification) { public <T extends Entity, P> CreateEntityBuilder<T, P> entity(P parent, String name, EntityType.IFactory<T> factory,
EntityClassification classification) {
return (CreateEntityBuilder<T, P>) this.entry(name, (callback) -> { return (CreateEntityBuilder<T, P>) this.entry(name, (callback) -> {
return CreateEntityBuilder.create(this, parent, name, callback, factory, classification); return CreateEntityBuilder.create(this, parent, name, callback, factory, classification);
}); });
@ -160,8 +162,8 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
return builder; return builder;
} }
public BlockBuilder<Block, CreateRegistrate> paletteStoneBlock(String name, public BlockBuilder<Block, CreateRegistrate> paletteStoneBlock(String name, NonNullSupplier<Block> propertiesFrom,
NonNullSupplier<Block> propertiesFrom, boolean worldGenStone) { boolean worldGenStone) {
return paletteStoneBlock(name, Block::new, propertiesFrom, worldGenStone); return paletteStoneBlock(name, Block::new, propertiesFrom, worldGenStone);
} }
@ -198,7 +200,7 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
} }
public static <T extends Block> NonNullConsumer<? super T> casingConnectivity( public static <T extends Block> NonNullConsumer<? super T> casingConnectivity(
BiConsumer<T, CasingConnectivity> consumer) { BiConsumer<T, CasingConnectivity> consumer) {
return entry -> onClient(() -> () -> registerCasingConnectivity(entry, consumer)); return entry -> onClient(() -> () -> registerCasingConnectivity(entry, consumer));
} }
@ -207,20 +209,21 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
} }
public static <T extends Block> NonNullConsumer<? super T> blockModel( public static <T extends Block> NonNullConsumer<? super T> blockModel(
Supplier<NonNullFunction<IBakedModel, ? extends IBakedModel>> func) { Supplier<NonNullFunction<IBakedModel, ? extends IBakedModel>> func) {
return entry -> onClient(() -> () -> registerBlockModel(entry, func)); return entry -> onClient(() -> () -> registerBlockModel(entry, func));
} }
public static <T extends Item> NonNullConsumer<? super T> itemModel( public static <T extends Item> NonNullConsumer<? super T> itemModel(
Supplier<NonNullFunction<IBakedModel, ? extends IBakedModel>> func) { Supplier<NonNullFunction<IBakedModel, ? extends IBakedModel>> func) {
return entry -> onClient(() -> () -> registerItemModel(entry, func)); return entry -> onClient(() -> () -> registerItemModel(entry, func));
} }
public static <T extends Item, P> NonNullUnaryOperator<ItemBuilder<T, P>> customRenderedItem( public static <T extends Item, P> NonNullUnaryOperator<ItemBuilder<T, P>> customRenderedItem(
Supplier<Supplier<CustomRenderedItemModelRenderer<?>>> supplier) { Supplier<Supplier<CustomRenderedItemModelRenderer<?>>> supplier) {
return b -> b.properties(p -> p.setISTER(() -> () -> supplier.get() return b -> {
.get())) onClient(() -> () -> customRenderedItem(b, supplier));
.onRegister(entry -> onClient(() -> () -> registerCustomRenderedItem(entry))); return b;
};
} }
protected static void onClient(Supplier<Runnable> toRun) { protected static void onClient(Supplier<Runnable> toRun) {
@ -228,35 +231,39 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
private static void registerCustomRenderedItem(Item entry) { private static <T extends Item, P> void customRenderedItem(ItemBuilder<T, P> b,
ItemStackTileEntityRenderer ister = entry.getItemStackTileEntityRenderer(); Supplier<Supplier<CustomRenderedItemModelRenderer<?>>> supplier) {
if (ister instanceof CustomRenderedItemModelRenderer) b.properties(p -> p.setISTER(() -> supplier.get()::get))
registerCustomRenderedItem(entry, (CustomRenderedItemModelRenderer<?>) ister); .onRegister(entry -> {
ItemStackTileEntityRenderer ister = entry.getItemStackTileEntityRenderer();
if (ister instanceof CustomRenderedItemModelRenderer)
registerCustomRenderedItem(entry, (CustomRenderedItemModelRenderer<?>) ister);
});
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
private static void registerCTBehviour(Block entry, ConnectedTextureBehaviour behavior) { private static void registerCTBehviour(Block entry, ConnectedTextureBehaviour behavior) {
CreateClient.MODEL_SWAPPER.getCustomBlockModels() CreateClient.MODEL_SWAPPER.getCustomBlockModels()
.register(entry.delegate, model -> new CTModel(model, behavior)); .register(entry.delegate, model -> new CTModel(model, behavior));
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
private static <T extends Block> void registerCasingConnectivity(T entry, private static <T extends Block> void registerCasingConnectivity(T entry,
BiConsumer<T, CasingConnectivity> consumer) { BiConsumer<T, CasingConnectivity> consumer) {
consumer.accept(entry, CreateClient.CASING_CONNECTIVITY); consumer.accept(entry, CreateClient.CASING_CONNECTIVITY);
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
private static void registerBlockVertexColor(Block entry, IBlockVertexColor colorFunc) { private static void registerBlockVertexColor(Block entry, IBlockVertexColor colorFunc) {
CreateClient.MODEL_SWAPPER.getCustomBlockModels() CreateClient.MODEL_SWAPPER.getCustomBlockModels()
.register(entry.delegate, model -> new ColoredVertexModel(model, colorFunc)); .register(entry.delegate, model -> new ColoredVertexModel(model, colorFunc));
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
private static void registerBlockModel(Block entry, private static void registerBlockModel(Block entry,
Supplier<NonNullFunction<IBakedModel, ? extends IBakedModel>> func) { Supplier<NonNullFunction<IBakedModel, ? extends IBakedModel>> func) {
CreateClient.MODEL_SWAPPER.getCustomBlockModels() CreateClient.MODEL_SWAPPER.getCustomBlockModels()
.register(entry.delegate, func.get()); .register(entry.delegate, func.get());
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
@ -267,8 +274,7 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
private static void registerCustomRenderedItem(Item entry, private static void registerCustomRenderedItem(Item entry, CustomRenderedItemModelRenderer<?> renderer) {
CustomRenderedItemModelRenderer<?> renderer) {
CreateClient.MODEL_SWAPPER.getCustomRenderedItems() CreateClient.MODEL_SWAPPER.getCustomRenderedItems()
.register(entry.delegate, renderer::createModel); .register(entry.delegate, renderer::createModel);
} }

View File

@ -5,7 +5,7 @@ license="MIT"
[[mods]] [[mods]]
modId="create" modId="create"
version="v0.3.2e" version="v0.3.2f"
displayName="Create" displayName="Create"
#updateJSONURL="" #updateJSONURL=""
displayURL="https://www.curseforge.com/minecraft/mc-mods/create" displayURL="https://www.curseforge.com/minecraft/mc-mods/create"