diff --git a/README.md b/README.md deleted file mode 100644 index b5b221b..0000000 --- a/README.md +++ /dev/null @@ -1,136 +0,0 @@ - - -# Templates 2 - -[>> Downloads <<](https://modrinth.com/mod/templates-2) - -*Slopes?* - -**This mod is open source and under a permissive license.** As such, it can be included in any modpack on any platform without prior permission. I appreciate hearing about people using my mods, but you do not need to ask to use them. See the [LICENSE file](LICENSE) for more details.[^1] - -If a Template block is placed in the world and right-clicked with a full-size block, it will take on the appearance of that block, including whether it emits light and redstone. Adding a *redstone torch* will make them emit redstone power, *glowstone dust* will make them emit light, and *popped chorus fruit* will make them intangible. - -While Templates itself adds a handful of common shapes, it's not too hard for other mods to interface with Templates and add their own templatable blocks. - -# For addon developers - -## Creating a block entity - -All templates need a block entity to store what block they look like. Templates registers one under `templates:slope`[^2], but as an addon developer you can't add additional blocks to my block entity. (Don't try, please.) - -To that end, nothing in Templates relies on the *specific* block entity ID, so just re-register the `TemplateEntity` class under your own name. You are free to extend `TemplateEntity` as well. - -The only hard requirement on the block entity is that it `implements ThemeableBlockEntity`. (This implies it returns a `BlockEntity` from `getRenderAttachmentData`.) - -## Creating your block - -There are various block interactions in Templates, like adding redstone to make the block emit power. To make your block fit with the other Templates, you'll want those behaviors to apply to your block as well. There's a couple options, depending on the complexity of the block you'd like to "template-ify". - -If you simply registered a `Block` or a simple vanilla class like `WallBlock`, use the corresponding class in `io.github.cottonmc.templates.block`. - -If you registered something different (like a `MyFancyBlock`), the simplest approach is to leverage `TemplateInteractionUtil`, which is where all of the interaction code lives in a mildly "pluggable" form. Here are the suggested steps: - -* Create a `TemplateMyFancyBlock` class that extends your block class. -* Copy-paste the body of `TemplateBlock` into it; adjust the constructor as needed. (It was designed to be copy-pasted in this way; this is how i filled out most of the other classes.) -* Make sure it instantiates your block entity type. -* Check that the methods are implemented the way you'd like. - * Particularly you might want to look at the redstone emission methods; the default ones don't call `super`. - -And if all else fails, just reimplement whatever interactions you'd like, or simply don't bother. None of this is important for the actual *retexturing* part of the mod, apart from returning a suitable block entity. - -## Creating the custom model - -(TL;DR look at `assets/templates/blockstates` and the bottom of `TemplatesClient`) - -Of course Templates leverages custom baked models. All of Templates's baked model implementations find and retexture quads from an upstream source that you will need to provide. - -Templates needs three pieces of information to perform retexturing: - -* the quad to be retextured -* whether you actually want to retexture it or just pass it through unchanged (see the Lever Template, which doesn't change the lever arm); -* what face of the block it corresponds to (which is sometimes different from "the direction it points" - see the Door Template, the textures "stick" when you open the door) - -The last piece of information is important because Templates tries hard to retain the orientation of blocks placed inside of them - you can place specifically an *east-facing* log into a Template, for example, and some faces get the cut wood while other faces get the bark. (Some other mods just use the same texture on all faces of the block, like the particle texture.) - -Pick a model implementation that suits your needs: - -### Auto retexturing - -* the quad: Sourced from a JSON model. -* whether you want to retexture it: "Yes". All quads will be retextured. -* what face of the block: Automatically determined by facing direction. - -Construct with `TemplatesClientApi.getInstance().auto`. Pass the ID of the model you want to source quads from. - -There's no way to configure this, so if you want to skip retexturing a face, try the next model implementation instead. - -**TODO**: this does not work well with `multipart` models with differently-rotated parts, like the fence model (consisting of 1 fence post and 1 fence-side model that gets rotated around to fill all 4 sides) - -### Special texture-based retexturing - -* the quad: Sourced from a JSON model. -* whether you want to retexture it: Determined from the texture applied to the quad. -* what face of the block: Determined via the texture applied to the quad. - -Construct with `TemplatesClientApi.getInstance().json`. Pass the ID of the model you want to source quads from. All quads textured with the *special textures* `templates:templates_special/east` will be textured with the east side of the theme, all quads textured with `templates:templates_special/up` will be retextured with the top side of the theme, etc. Quads textured with any other texture will be passed through unaltered. - -
Regarding texture variables: - -On the off-chance your blockmodel already has texture variables for `north`, `south`, etc, you can simply apply Templates's special textures to it: - -```json -{ - "parent": "mymod:block/my_model", - "textures": { - "north": "templates:templates_special/north", - "east": "templates:templates_special/east", - "south": "templates:templates_special/south", - "west": "templates:templates_special/west", - "up": "templates:templates_special/up", - "down": "templates:templates_special/down", - } -} -``` - -Sadly, many models don't specify *completely* separate textures for all six sides. If you have a setup like an "ends" variable which gets applied to "the top and bottom" or something, please don't use the texture-variables approach. Instead, see if the `UnbakedAutoRetexturedModel` suits your needs, or make a second copy of the json model that does separately fill in all faces. -
- -(This one works better with multipart models.) - -### Mesh retexturing - -* the quad: Sourced from a `Mesh`. -* whether you want to retexture it: Quads with a nonzero `tag`. -* what face of the block: Determined from the `tag`. - -Construct with `TemplatesClientApi.getInstance().mesh`, passing a `Supplier`. To mark a face "retexture this with the EAST side of the block", call `.tag(Direction.EAST.ordinal() + 1)` on it; same for the other directions. (So, the valid tags are 1, 2, 3, 4, 5, and 6, corresponding to down, up, north, south, west, east.) Give these faces UV coordinates ranging from 0 to 1. - -A `.tag` of 0 (the default) will be passed through unchanged. This is a little useless since you still need to provide UV coordinates, so instead of passing a `Supplier` you can also pass a `Function, Mesh>`; you will be provided with a `Function` that you can query for sprite information, including their UVs. - -(To construct this type, you will also need to pass the identifier of a "base model", which can be a regular JSON model. Miscellaneous `BakedModel` properties like rotations, AO, `isSideLit`, etc will be sourced from it. See Template's `models/block/slope_base`. You may need to set `"gui_light": "front"` to avoid a flat look in the ui.) - -### A secret, fourth thing - -Templates doesn't actually care about the implementation of the UnbakedModel you pass in. It won't *work* unless you reimplement the retexturing, but if you have your needs I won't stop you. - -All the models are supposed to be extensible (if i left a stray `private` let me know). All the `UnbakedModels` are backed by the same abstract class called `RetexturingBakedModel` which actually does the retexturing; feel free to extend it. - -## Registering your model - -After you've decided on and constructed your special model, you should tell Templates about it. Pick an ID that's different from the base model. (If your base model is `mymod:block/awesome_template`, a good name might be `mymod:awesome_template_special`). Register your special model under that ID using `TemplatesClientApi.getInstance().addTemplateModel`. - -To assign the block model, using a vanilla blockstate file, simply point your block at that model ID as normal. (See this mod's `blockstates` folder.) You may also use the `x`, `y`, and `uvlock` properties. - -To assign the item model, since items don't have the "blockstate file" level of indirection, call `TemplatesClientApi.getInstance().assignItemModel`, passing your special model's ID and the items it should be assigned to. Or if you'd rather use a vanilla json model (that won't be retextured) just make one the vanilla way. - -# Most important attribution in the whole wide world - -COOL RIVULET is by mev, this is the most important block in the mod & perhaps the most important block in any mod ever since `incorporeal:clearly` - -# License - -MIT, which is unusual for me (usually i write LGPL). It's the upstream project's license. - -[^1]: This is inherited from a [CottonMC project](https://github.com/CottonMC/Templates), which inherited [the ElytraDev template](https://github.com/elytra/Concrete), which might explain if the readme layout looks familiar. - -[^2]: Yes, even the blocks other than slopes use `templates:slope`. The slope was the first block added to Templates and I forgot to change the block entity ID, and now I can't change it without breaking worlds. At least it demonstrates how the block entity can be used for more than one template? \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 31f14bf..0009bf7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,8 +10,8 @@ loader_version=0.15.6 # Mod Properties mod_version = 1.0-SNAPSHOT maven_group = fr.adrien1106 -archives_base_name = ReFramedTemplates -mod_id = reframedtemplates +archives_base_name = ReFramed +mod_id = reframed # Dependencies # check this on https://modmuss50.me/fabric.html diff --git a/icon.png b/icon.png deleted file mode 100644 index 82a03b3..0000000 Binary files a/icon.png and /dev/null differ diff --git a/src/main/java/fr/adrien1106/reframed/ReFramed.java b/src/main/java/fr/adrien1106/reframed/ReFramed.java new file mode 100644 index 0000000..d6c6019 --- /dev/null +++ b/src/main/java/fr/adrien1106/reframed/ReFramed.java @@ -0,0 +1,92 @@ +package fr.adrien1106.reframed; + +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; +import fr.adrien1106.reframed.block.*; +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; +import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; +import net.minecraft.block.AbstractBlock; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSetType; +import net.minecraft.block.Blocks; +import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.function.BiConsumer; +import java.util.stream.Collectors; + +/** + * TODO handle grass side, multiple camos + */ +public class ReFramed implements ModInitializer { + public static final String MODID = "reframed"; + + public static final ArrayList BLOCKS = new ArrayList<>(); + public static Block CUBE, STAIRS, SLAB, POST, FENCE, FENCE_GATE, DOOR, TRAPDOOR, IRON_DOOR, IRON_TRAPDOOR, PRESSURE_PLATE, BUTTON, LEVER, WALL, CARPET, PANE, CANDLE; + + public static BlockEntityType REFRAMED_BLOCK_ENTITY; + + public static BiConsumer chunkRerenderProxy = (world, pos) -> {}; + + @Override + public void onInitialize() { + //registerReFramed mutates FRAMES as a side effect, which is a List, so order is preserved + //the ordering is used in the creative tab, so they're roughly sorted by encounter order of the + //corresponding vanilla block in the "search" creative tab... with the non-vanilla "post" and + //"vertical slab" inserted where they fit ...and i moved the lever way up next to the pressureplate + //and button, because they're redstoney... hopefully this ordering makes sense lol + CUBE = registerReFramed("cube" , new ReFramedBlock(ReFramedInteractionUtil.makeSettings())); + STAIRS = registerReFramed("stairs" , new ReFramedStairsBlock(cp(Blocks.OAK_STAIRS))); + SLAB = registerReFramed("slab" , new ReFramedSlabBlock(cp(Blocks.OAK_SLAB))); + POST = registerReFramed("post" , new ReFramedPostBlock(cp(Blocks.OAK_FENCE))); + FENCE = registerReFramed("fence" , new ReFramedFenceBlock(cp(Blocks.OAK_FENCE))); + FENCE_GATE = registerReFramed("fence_gate" , new ReFramedFenceGateBlock(cp(Blocks.OAK_FENCE_GATE))); + DOOR = registerReFramed("door" , new ReFramedDoorBlock(cp(Blocks.OAK_DOOR), BlockSetType.OAK)); + TRAPDOOR = registerReFramed("trapdoor" , new ReFramedTrapdoorBlock(cp(Blocks.OAK_TRAPDOOR), BlockSetType.OAK)); + IRON_DOOR = registerReFramed("iron_door" , new ReFramedDoorBlock(cp(Blocks.IRON_DOOR), BlockSetType.IRON)); + IRON_TRAPDOOR = registerReFramed("iron_trapdoor" , new ReFramedTrapdoorBlock(cp(Blocks.IRON_TRAPDOOR), BlockSetType.IRON)); + PRESSURE_PLATE = registerReFramed("pressure_plate", new ReFramedPressurePlateBlock(cp(Blocks.OAK_PRESSURE_PLATE))); + BUTTON = registerReFramed("button" , new ReFramedButtonBlock(cp(Blocks.OAK_BUTTON))); + LEVER = registerReFramed("lever" , new ReFramedLeverBlock(cp(Blocks.LEVER))); + WALL = registerReFramed("wall" , new ReFramedWallBlock(ReFramedInteractionUtil.makeSettings())); + CARPET = registerReFramed("carpet" , new ReFramedCarpetBlock(cp(Blocks.WHITE_CARPET))); + PANE = registerReFramed("pane" , new ReFramedPaneBlock(cp(Blocks.GLASS_PANE))); + CANDLE = registerReFramed("candle" , new ReFramedCandleBlock(ReFramedCandleBlock.configureSettings(cp(Blocks.CANDLE)))); + + REFRAMED_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, id("camo"), + FabricBlockEntityTypeBuilder.create((pos, state) -> new ReFramedEntity(REFRAMED_BLOCK_ENTITY, pos, state), BLOCKS.toArray(new Block[0])).build(null) + ); + + Registry.register(Registries.ITEM_GROUP, id("tab"), FabricItemGroup.builder() + .displayName(Text.translatable("itemGroup.reframed.tab")) + .icon(() -> new ItemStack(SLAB)) + .entries((ctx, e) -> e.addAll(BLOCKS.stream().map(ItemStack::new).collect(Collectors.toList()))).build() + ); + } + + private static AbstractBlock.Settings cp(Block base) { + return ReFramedInteractionUtil.configureSettings(AbstractBlock.Settings.copy(base)); + } + + private static B registerReFramed(String path, B block) { + Identifier id = id(path); + + Registry.register(Registries.BLOCK, id, block); + Registry.register(Registries.ITEM, id, new BlockItem(block, new Item.Settings())); + BLOCKS.add(block); + return block; + } + + public static Identifier id(String path) { + return new Identifier(MODID, path); + } +} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedBlock.java similarity index 72% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedBlock.java index e0a9710..9444e11 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -23,66 +23,66 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateBlock extends Block implements BlockEntityProvider { - public TemplateBlock(Settings settings) { +public class ReFramedBlock extends Block implements BlockEntityProvider { + public ReFramedBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } //For addon devs: override this so your blocks don't end up trying to place my block entity, my BlockEntityType only handles blocks internal to the mod - //Just make your own BlockEntityType, it's fine, you can even use the same TemplateEntity class + //Just make your own BlockEntityType, it's fine, you can even use the same ReFramedEntity class @Override public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); super.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateButtonBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedButtonBlock.java similarity index 73% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateButtonBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedButtonBlock.java index b5aaef1..2dca7cd 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateButtonBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedButtonBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockSetType; @@ -25,66 +25,65 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateButtonBlock extends ButtonBlock implements BlockEntityProvider { - public TemplateButtonBlock(Settings settings) { +public class ReFramedButtonBlock extends ButtonBlock implements BlockEntityProvider { + public ReFramedButtonBlock(Settings settings) { this(settings, BlockSetType.OAK, 30); } - public TemplateButtonBlock(Settings settings, BlockSetType blockSetType, int i) { + public ReFramedButtonBlock(Settings settings, BlockSetType blockSetType, int i) { super(blockSetType, i, settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - //return TemplateInteractionUtil.emitsRedstonePower(state); return super.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { boolean a = 0 != super.getWeakRedstonePower(state, view, pos, dir); - boolean b = 0 != TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + boolean b = 0 != ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); return (a ^ b) ? 15 : 0; } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateCandleBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedCandleBlock.java similarity index 71% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateCandleBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedCandleBlock.java index 830d43f..2726ae5 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateCandleBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedCandleBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; @@ -25,68 +25,68 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateCandleBlock extends CandleBlock implements BlockEntityProvider { - public TemplateCandleBlock(Settings settings) { +public class ReFramedCandleBlock extends CandleBlock implements BlockEntityProvider { + public ReFramedCandleBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } public static AbstractBlock.Settings configureSettings(AbstractBlock.Settings in) { - return in.luminance(state -> Math.max(TemplateInteractionUtil.luminance(state), CandleBlock.STATE_TO_LUMINANCE.applyAsInt(state))); + return in.luminance(state -> Math.max(ReFramedInteractionUtil.luminance(state), CandleBlock.STATE_TO_LUMINANCE.applyAsInt(state))); } @Override public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); super.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateCarpetBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedCarpetBlock.java similarity index 70% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateCarpetBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedCarpetBlock.java index c2d13d7..6c89239 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateCarpetBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedCarpetBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -24,64 +24,64 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateCarpetBlock extends CarpetBlock implements BlockEntityProvider { - public TemplateCarpetBlock(Settings settings) { +public class ReFramedCarpetBlock extends CarpetBlock implements BlockEntityProvider { + public ReFramedCarpetBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateDoorBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedDoorBlock.java similarity index 71% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateDoorBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedDoorBlock.java index 5a50641..2bea1d6 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateDoorBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedDoorBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockSetType; @@ -25,65 +25,65 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateDoorBlock extends DoorBlock implements BlockEntityProvider { - public TemplateDoorBlock(Settings settings, BlockSetType blockSetType) { +public class ReFramedDoorBlock extends DoorBlock implements BlockEntityProvider { + public ReFramedDoorBlock(Settings settings, BlockSetType blockSetType) { super(blockSetType, settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); super.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } } \ No newline at end of file diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/FramedEntity.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedEntity.java similarity index 92% rename from src/main/java/fr/adrien1106/reframedtemplates/block/FramedEntity.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedEntity.java index 1db358c..5f179a5 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/FramedEntity.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedEntity.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; -import fr.adrien1106.reframedtemplates.api.ThemeableBlockEntity; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; +import fr.adrien1106.reframed.util.ThemeableBlockEntity; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.entity.BlockEntity; @@ -26,7 +26,7 @@ import java.util.Objects; //Keeping the weight of this block entity down, both in terms of memory consumption and NBT sync traffic, //is pretty important since players might place a lot of them. There were tons and tons of these at Blanketcon. //To that end, most of the state has been crammed into a bitfield. -public class FramedEntity extends BlockEntity implements ThemeableBlockEntity { +public class ReFramedEntity extends BlockEntity implements ThemeableBlockEntity { protected BlockState renderedState = Blocks.AIR.getDefaultState(); protected byte bitfield = DEFAULT_BITFIELD; @@ -35,7 +35,7 @@ public class FramedEntity extends BlockEntity implements ThemeableBlockEntity { protected static final int SPENT_POPPED_CHORUS_MASK = 0b00000100; protected static final int EMITS_REDSTONE_MASK = 0b00001000; protected static final int IS_SOLID_MASK = 0b00010000; - protected static final byte DEFAULT_BITFIELD = IS_SOLID_MASK; //brand-new templates shall be solid + protected static final byte DEFAULT_BITFIELD = IS_SOLID_MASK; //brand-new frames shall be solid //Using one-character names is a little brash, like, what if there's a mod that adds crap to the NBT of every //block entity, and uses short names for the same reason I am (because there are lots and lots of block entities)? @@ -43,7 +43,7 @@ public class FramedEntity extends BlockEntity implements ThemeableBlockEntity { protected static final String BLOCKSTATE_KEY = "s"; protected static final String BITFIELD_KEY = "b"; - public FramedEntity(BlockEntityType type, BlockPos pos, BlockState state) { + public ReFramedEntity(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state); } @@ -68,7 +68,7 @@ public class FramedEntity extends BlockEntity implements ThemeableBlockEntity { //Force a chunk remesh on the client if the displayed blockstate has changed if(world != null && world.isClient && !Objects.equals(lastRenderedState, renderedState)) { - Templates.chunkRerenderProxy.accept(world, pos); + ReFramed.chunkRerenderProxy.accept(world, pos); } } @@ -105,8 +105,8 @@ public class FramedEntity extends BlockEntity implements ThemeableBlockEntity { NbtCompound blockEntityTag = BlockItem.getBlockEntityNbt(stack); if(blockEntityTag == null) return state; - if(state.contains(TemplateInteractionUtil.LIGHT)) { - state = state.with(TemplateInteractionUtil.LIGHT, + if(state.contains(ReFramedInteractionUtil.LIGHT)) { + state = state.with(ReFramedInteractionUtil.LIGHT, blockEntityTag.getBoolean("spentglow") || //2.0.4 ((blockEntityTag.contains(BITFIELD_KEY) ? blockEntityTag.getByte(BITFIELD_KEY) : DEFAULT_BITFIELD) & SPENT_GLOWSTONE_DUST_MASK) != 0 || //2.0.5 readStateFromItem(stack).getLuminance() != 0 //glowstone dust wasn't manually added, the block just emits light diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateFenceBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedFenceBlock.java similarity index 70% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateFenceBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedFenceBlock.java index 7080e49..b258831 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateFenceBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedFenceBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -24,64 +24,64 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateFenceBlock extends FenceBlock implements BlockEntityProvider { - public TemplateFenceBlock(Settings settings) { +public class ReFramedFenceBlock extends FenceBlock implements BlockEntityProvider { + public ReFramedFenceBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateFenceGateBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedFenceGateBlock.java similarity index 66% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateFenceGateBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedFenceGateBlock.java index e342bc5..1e02fdb 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateFenceGateBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedFenceGateBlock.java @@ -1,9 +1,9 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtilExt; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; +import fr.adrien1106.reframed.util.ReframedInteractible; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -26,73 +26,73 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateFenceGateBlock extends FenceGateBlock implements BlockEntityProvider, TemplateInteractionUtilExt { - public TemplateFenceGateBlock(Settings settings, WoodType woodType) { +public class ReFramedFenceGateBlock extends FenceGateBlock implements BlockEntityProvider, ReframedInteractible { + public ReFramedFenceGateBlock(Settings settings, WoodType woodType) { super(woodType, settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } - public TemplateFenceGateBlock(Settings settings) { + public ReFramedFenceGateBlock(Settings settings) { this(settings, WoodType.OAK); } @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } @Override - public boolean templatesPlayerCanAddRedstoneEmission(BlockState state, BlockView view, BlockPos pos) { + public boolean canAddRedstoneEmission(BlockState state, BlockView view, BlockPos pos) { return false; } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateLeverBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedLeverBlock.java similarity index 74% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateLeverBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedLeverBlock.java index ce629ac..8d749f2 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateLeverBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedLeverBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -24,62 +24,61 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateLeverBlock extends LeverBlock implements BlockEntityProvider { - public TemplateLeverBlock(Settings settings) { +public class ReFramedLeverBlock extends LeverBlock implements BlockEntityProvider { + public ReFramedLeverBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - //return TemplateInteractionUtil.emitsRedstonePower(state); return super.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { boolean a = 0 != super.getWeakRedstonePower(state, view, pos, dir); - boolean b = 0 != TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + boolean b = 0 != ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); return (a ^ b) ? 15 : 0; } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePaneBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedPaneBlock.java similarity index 71% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePaneBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedPaneBlock.java index 9ea03ea..927100a 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePaneBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedPaneBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -24,64 +24,64 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplatePaneBlock extends PaneBlock implements BlockEntityProvider { - public TemplatePaneBlock(Settings settings) { +public class ReFramedPaneBlock extends PaneBlock implements BlockEntityProvider { + public ReFramedPaneBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Override public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); super.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePostBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedPostBlock.java similarity index 80% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePostBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedPostBlock.java index 1d092e1..63443b3 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePostBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedPostBlock.java @@ -1,7 +1,7 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.ShapeContext; @@ -14,8 +14,8 @@ import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; import org.jetbrains.annotations.Nullable; -public class TemplatePostBlock extends WaterloggableTemplateBlock { - public TemplatePostBlock(Settings settings) { +public class ReFramedPostBlock extends WaterloggableReFramedBlock { + public ReFramedPostBlock(Settings settings) { super(settings); setDefaultState(getDefaultState().with(Properties.AXIS, Direction.Axis.Y)); @@ -28,7 +28,6 @@ public class TemplatePostBlock extends WaterloggableTemplateBlock { @Override public @Nullable BlockState getPlacementState(ItemPlacementContext ctx) { - //not calling TemplateInteractionUtil.modifyPlacementState because we extend WaterloggableTemplateBlock which already does BlockState sup = super.getPlacementState(ctx); if(sup != null) sup = sup.with(Properties.AXIS, ctx.getSide().getAxis()); return sup; @@ -48,7 +47,7 @@ public class TemplatePostBlock extends WaterloggableTemplateBlock { @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), shap(state)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), shap(state)); } @Override diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePressurePlateBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedPressurePlateBlock.java similarity index 72% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePressurePlateBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedPressurePlateBlock.java index 347b46d..38b02e5 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplatePressurePlateBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedPressurePlateBlock.java @@ -1,8 +1,8 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.LivingEntity; @@ -20,66 +20,65 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplatePressurePlateBlock extends PressurePlateBlock implements BlockEntityProvider { - public TemplatePressurePlateBlock(Settings settings, BlockSetType blockSetType) { +public class ReFramedPressurePlateBlock extends PressurePlateBlock implements BlockEntityProvider { + public ReFramedPressurePlateBlock(Settings settings, BlockSetType blockSetType) { super(blockSetType, settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } - public TemplatePressurePlateBlock(Settings settings) { + public ReFramedPressurePlateBlock(Settings settings) { this(settings, BlockSetType.OAK); } @Override public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); super.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - //return TemplateInteractionUtil.emitsRedstonePower(state); return super.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { boolean a = 0 != super.getWeakRedstonePower(state, view, pos, dir); - boolean b = 0 != TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + boolean b = 0 != ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); return (a ^ b) ? 15 : 0; } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateSlabBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java similarity index 88% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateSlabBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java index e7bd7fc..4782cf1 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateSlabBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedSlabBlock.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; -import fr.adrien1106.reframedtemplates.generator.MultipartBlockStateProvider; +import fr.adrien1106.reframed.generator.MultipartBlockStateProvider; import net.minecraft.block.*; import net.minecraft.data.client.MultipartBlockStateSupplier; import net.minecraft.item.ItemPlacementContext; @@ -13,7 +13,7 @@ import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import org.jetbrains.annotations.Nullable; -public class TemplateSlabBlock extends WaterloggableTemplateBlock implements MultipartBlockStateProvider { +public class ReFramedSlabBlock extends WaterloggableReFramedBlock implements MultipartBlockStateProvider { private static final VoxelShape DOWN = VoxelShapes.cuboid(0f, 0f, 0f, 1f, 0.5f, 1f); private static final VoxelShape UP = VoxelShapes.cuboid(0f, 0.5f, 0f, 1f, 1f, 1f); @@ -22,7 +22,7 @@ public class TemplateSlabBlock extends WaterloggableTemplateBlock implements Mul private static final VoxelShape EAST = VoxelShapes.cuboid(0.5f, 0f, 0f, 1f, 1f, 1f); private static final VoxelShape WEST = VoxelShapes.cuboid(0f, 0f, 0f, 0.5f, 1f, 1f); - public TemplateSlabBlock(Settings settings) { + public ReFramedSlabBlock(Settings settings) { super(settings); setDefaultState(getDefaultState().with(Properties.FACING, Direction.DOWN)); } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateStairsBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java similarity index 95% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateStairsBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java index d51b411..1c05e6b 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateStairsBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java @@ -1,11 +1,11 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.generator.GBlockstate; -import fr.adrien1106.reframedtemplates.generator.MultipartBlockStateProvider; -import fr.adrien1106.reframedtemplates.util.VoxelHelper; -import fr.adrien1106.reframedtemplates.util.property.StairDirection; -import fr.adrien1106.reframedtemplates.util.property.StairShape; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.generator.GBlockstate; +import fr.adrien1106.reframed.generator.MultipartBlockStateProvider; +import fr.adrien1106.reframed.util.VoxelHelper; +import fr.adrien1106.reframed.util.property.StairDirection; +import fr.adrien1106.reframed.util.property.StairShape; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.ShapeContext; @@ -30,17 +30,17 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -import static fr.adrien1106.reframedtemplates.util.property.StairShape.*; +import static fr.adrien1106.reframed.util.property.StairShape.*; import static net.minecraft.data.client.VariantSettings.Rotation.*; -import static fr.adrien1106.reframedtemplates.util.property.StairDirection.*; +import static fr.adrien1106.reframed.util.property.StairDirection.*; -public class TemplateStairsBlock extends WaterloggableTemplateBlock implements MultipartBlockStateProvider { +public class ReFramedStairsBlock extends WaterloggableReFramedBlock implements MultipartBlockStateProvider { public static final EnumProperty FACING = EnumProperty.of("facing", StairDirection.class); public static final EnumProperty SHAPE = EnumProperty.of("shape", StairShape.class); private static final List VOXEL_LIST= new ArrayList<>(); - public TemplateStairsBlock(Settings settings) { + public ReFramedStairsBlock(Settings settings) { super(settings); setDefaultState(getDefaultState().with(FACING, StairDirection.NORTH_DOWN).with(SHAPE, STRAIGHT)); } @@ -215,7 +215,7 @@ public class TemplateStairsBlock extends WaterloggableTemplateBlock implements M pos.offset(reverse ? direction.getOpposite() : direction) ); - if (block_state.getBlock() instanceof TemplateStairsBlock && block_state.get(FACING).hasDirection(reference)) { + if (block_state.getBlock() instanceof ReFramedStairsBlock && block_state.get(FACING).hasDirection(reference)) { if (block_state.get(FACING).hasDirection(face.getLeftDirection())) return "left"; else if (block_state.get(FACING).hasDirection(face.getRightDirection())) return "right"; } @@ -260,10 +260,10 @@ public class TemplateStairsBlock extends WaterloggableTemplateBlock implements M @Override public MultipartBlockStateSupplier getMultipart() { - Identifier straight_id = Templates.id("stairs_special"); - Identifier double_outer_id = Templates.id("double_outer_stairs_special"); - Identifier inner_id = Templates.id("inner_stairs_special"); - Identifier outer_id = Templates.id("outer_stairs_special"); + Identifier straight_id = ReFramed.id("stairs_special"); + Identifier double_outer_id = ReFramed.id("double_outer_stairs_special"); + Identifier inner_id = ReFramed.id("inner_stairs_special"); + Identifier outer_id = ReFramed.id("outer_stairs_special"); return MultipartBlockStateSupplier.create(this) /* STRAIGHT X AXIS */ .with(GBlockstate.when(FACING, DOWN_EAST, SHAPE, STRAIGHT), diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateTrapdoorBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedTrapdoorBlock.java similarity index 65% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateTrapdoorBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedTrapdoorBlock.java index 3809cd5..f496cc0 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateTrapdoorBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedTrapdoorBlock.java @@ -1,9 +1,9 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtilExt; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; +import fr.adrien1106.reframed.util.ReframedInteractible; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockSetType; @@ -26,73 +26,69 @@ import net.minecraft.world.BlockView; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -public class TemplateTrapdoorBlock extends TrapdoorBlock implements BlockEntityProvider, TemplateInteractionUtilExt { - public TemplateTrapdoorBlock(Settings settings, BlockSetType woodType) { +public class ReFramedTrapdoorBlock extends TrapdoorBlock implements BlockEntityProvider, ReframedInteractible { + public ReFramedTrapdoorBlock(Settings settings, BlockSetType woodType) { super(woodType, settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); - } - - public TemplateTrapdoorBlock(Settings settings) { - this(settings, BlockSetType.OAK); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); } @Override public @Nullable BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); super.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), super.getCollisionShape(state, view, pos, ctx)); } @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } @Override - public boolean templatesPlayerCanAddRedstoneEmission(BlockState state, BlockView view, BlockPos pos) { + public boolean canAddRedstoneEmission(BlockState state, BlockView view, BlockPos pos) { return false; } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateWallBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedWallBlock.java similarity index 75% rename from src/main/java/fr/adrien1106/reframedtemplates/block/TemplateWallBlock.java rename to src/main/java/fr/adrien1106/reframed/block/ReFramedWallBlock.java index c614a58..3a32db0 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/TemplateWallBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedWallBlock.java @@ -1,9 +1,9 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import com.google.common.base.MoreObjects; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; -import fr.adrien1106.reframedtemplates.mixin.WallBlockAccessor; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.util.ReFramedInteractionUtil; +import fr.adrien1106.reframed.mixin.WallBlockAccessor; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; import net.minecraft.block.BlockState; @@ -30,10 +30,10 @@ import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.Map; -public class TemplateWallBlock extends WallBlock implements BlockEntityProvider { - public TemplateWallBlock(Settings settings) { +public class ReFramedWallBlock extends WallBlock implements BlockEntityProvider { + public ReFramedWallBlock(Settings settings) { super(settings); - setDefaultState(TemplateInteractionUtil.setDefaultStates(getDefaultState())); + setDefaultState(ReFramedInteractionUtil.setDefaultStates(getDefaultState())); initNewShapemaps(); //WallBlock specific haxx } @@ -41,41 +41,41 @@ public class TemplateWallBlock extends WallBlock implements BlockEntityProvider @Nullable @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return Templates.TEMPLATE_BLOCK_ENTITY.instantiate(pos, state); + return ReFramed.REFRAMED_BLOCK_ENTITY.instantiate(pos, state); } @Override protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(TemplateInteractionUtil.appendProperties(builder)); + super.appendProperties(ReFramedInteractionUtil.appendProperties(builder)); } @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - return TemplateInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); + return ReFramedInteractionUtil.modifyPlacementState(super.getPlacementState(ctx), ctx); } @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - ActionResult r = TemplateInteractionUtil.onUse(state, world, pos, player, hand, hit); + ActionResult r = ReFramedInteractionUtil.onUse(state, world, pos, player, hand, hit); if(!r.isAccepted()) r = super.onUse(state, world, pos, player, hand, hit); return r; } @Override public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { - TemplateInteractionUtil.onStateReplaced(state, world, pos, newState, moved); + ReFramedInteractionUtil.onStateReplaced(state, world, pos, newState, moved); super.onStateReplaced(state, world, pos, newState, moved); } @Override public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - TemplateInteractionUtil.onPlaced(world, pos, state, placer, stack); + ReFramedInteractionUtil.onPlaced(world, pos, state, placer, stack); } @Override public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return MoreObjects.firstNonNull(TemplateInteractionUtil.getCollisionShape(state, view, pos, ctx), getNewShape(state, newCollisionShapeMap)); + return MoreObjects.firstNonNull(ReFramedInteractionUtil.getCollisionShape(state, view, pos, ctx), getNewShape(state, newCollisionShapeMap)); } @Override @@ -85,17 +85,17 @@ public class TemplateWallBlock extends WallBlock implements BlockEntityProvider @Override public boolean emitsRedstonePower(BlockState state) { - return TemplateInteractionUtil.emitsRedstonePower(state); + return ReFramedInteractionUtil.emitsRedstonePower(state); } @Override public int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getWeakRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getWeakRedstonePower(state, view, pos, dir); } @Override public int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return TemplateInteractionUtil.getStrongRedstonePower(state, view, pos, dir); + return ReFramedInteractionUtil.getStrongRedstonePower(state, view, pos, dir); } //Shapemap heck (WallBlock has a map keyed on BlockState, but since we add more blockstates most of those map lookups fail) @@ -116,8 +116,8 @@ public class TemplateWallBlock extends WallBlock implements BlockEntityProvider protected final Map newCollisionShapeMap = new HashMap<>(); protected void initNewShapemaps() { - initNewShapemap(((WallBlockAccessor) this).templates$getShapeMap(), newShapeMap); - initNewShapemap(((WallBlockAccessor) this).templates$getCollisionShapeMap(), newCollisionShapeMap); + initNewShapemap(((WallBlockAccessor) this).getShapeMap(), newShapeMap); + initNewShapemap(((WallBlockAccessor) this).getCollisionShapeMap(), newCollisionShapeMap); } protected void initNewShapemap(Map oldShapeMap, Map newShapeMap) { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/block/WaterloggableTemplateBlock.java b/src/main/java/fr/adrien1106/reframed/block/WaterloggableReFramedBlock.java similarity index 85% rename from src/main/java/fr/adrien1106/reframedtemplates/block/WaterloggableTemplateBlock.java rename to src/main/java/fr/adrien1106/reframed/block/WaterloggableReFramedBlock.java index 7d20cb6..319d59a 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/block/WaterloggableTemplateBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/WaterloggableReFramedBlock.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.block; +package fr.adrien1106.reframed.block; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -13,8 +13,8 @@ import net.minecraft.util.math.Direction; import net.minecraft.world.WorldAccess; import org.jetbrains.annotations.Nullable; -public class WaterloggableTemplateBlock extends TemplateBlock implements Waterloggable { - public WaterloggableTemplateBlock(Settings settings) { +public class WaterloggableReFramedBlock extends ReFramedBlock implements Waterloggable { + public WaterloggableReFramedBlock(Settings settings) { super(settings); setDefaultState(getDefaultState().with(Properties.WATERLOGGED, false)); @@ -28,7 +28,6 @@ public class WaterloggableTemplateBlock extends TemplateBlock implements Waterlo @Nullable @Override public BlockState getPlacementState(ItemPlacementContext ctx) { - //not calling TemplateInteractionUtil.modifyPlacementState because we extend TemplateBlock which already does BlockState sup = super.getPlacementState(ctx); if(sup != null) sup = sup.with(Properties.WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).isOf(Fluids.WATER)); return sup; diff --git a/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java b/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java new file mode 100644 index 0000000..eb5980b --- /dev/null +++ b/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java @@ -0,0 +1,117 @@ +package fr.adrien1106.reframed.client; + +import fr.adrien1106.reframed.ReFramed; +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; +import net.fabricmc.fabric.api.resource.ResourceManagerHelper; +import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener; +import net.minecraft.block.Block; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.resource.ResourceManager; +import net.minecraft.resource.ResourceType; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.ChunkSectionPos; + +public class ReFramedClient implements ClientModInitializer { + public static final ReFramedModelProvider PROVIDER = new ReFramedModelProvider(); + + public static final ReFramedClientHelper HELPER = new ReFramedClientHelper(PROVIDER); + + @Override + public void onInitializeClient() { + privateInit(); //<- Stuff you shouldn't replicate in any addon mods ;) + + //all frames mustn't be on the SOLID layer because they are not opaque! + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), ReFramed.BLOCKS.toArray(new Block[0])); + + HELPER.addReFramedModel(ReFramed.id("button_special") , HELPER.auto(new Identifier("block/button"))); + HELPER.addReFramedModel(ReFramed.id("button_pressed_special") , HELPER.auto(new Identifier("block/button_pressed"))); + HELPER.addReFramedModel(ReFramed.id("one_candle_special") , HELPER.auto(new Identifier("block/template_candle"))); + HELPER.addReFramedModel(ReFramed.id("two_candles_special") , HELPER.auto(new Identifier("block/template_two_candles"))); + HELPER.addReFramedModel(ReFramed.id("three_candles_special") , HELPER.auto(new Identifier("block/template_three_candles"))); + HELPER.addReFramedModel(ReFramed.id("four_candles_special") , HELPER.auto(new Identifier("block/template_four_candles"))); + HELPER.addReFramedModel(ReFramed.id("carpet_special") , HELPER.auto(new Identifier("block/carpet"))); + HELPER.addReFramedModel(ReFramed.id("cube_special") , HELPER.auto(new Identifier("block/cube"))); + HELPER.addReFramedModel(ReFramed.id("door_bottom_left_special") , HELPER.auto(new Identifier("block/door_bottom_left"))); + HELPER.addReFramedModel(ReFramed.id("door_bottom_right_special") , HELPER.auto(new Identifier("block/door_bottom_right"))); + HELPER.addReFramedModel(ReFramed.id("door_top_left_special") , HELPER.auto(new Identifier("block/door_top_left"))); + HELPER.addReFramedModel(ReFramed.id("door_top_right_special") , HELPER.auto(new Identifier("block/door_top_right"))); + HELPER.addReFramedModel(ReFramed.id("door_bottom_left_open_special"), HELPER.auto(new Identifier("block/door_bottom_left_open"))); + HELPER.addReFramedModel(ReFramed.id("door_bottom_right_open_special"), HELPER.auto(new Identifier("block/door_bottom_right_open"))); //This is why we dont format code as tables kids + HELPER.addReFramedModel(ReFramed.id("door_top_left_open_special") , HELPER.auto(new Identifier("block/door_top_left_open"))); + HELPER.addReFramedModel(ReFramed.id("door_top_right_open_special") , HELPER.auto(new Identifier("block/door_top_right_open"))); + HELPER.addReFramedModel(ReFramed.id("fence_post_special") , HELPER.auto(new Identifier("block/fence_post"))); + HELPER.addReFramedModel(ReFramed.id("fence_gate_special") , HELPER.auto(new Identifier("block/template_fence_gate"))); + HELPER.addReFramedModel(ReFramed.id("fence_gate_open_special") , HELPER.auto(new Identifier("block/template_fence_gate_open"))); + HELPER.addReFramedModel(ReFramed.id("fence_gate_wall_special") , HELPER.auto(new Identifier("block/template_fence_gate_wall"))); + HELPER.addReFramedModel(ReFramed.id("fence_gate_wall_open_special") , HELPER.auto(new Identifier("block/template_fence_gate_wall_open"))); + HELPER.addReFramedModel(ReFramed.id("glass_pane_post_special") , HELPER.auto(new Identifier("block/glass_pane_post"))); + HELPER.addReFramedModel(ReFramed.id("glass_pane_noside_special") , HELPER.auto(new Identifier("block/glass_pane_noside"))); + HELPER.addReFramedModel(ReFramed.id("glass_pane_noside_alt_special"), HELPER.auto(new Identifier("block/glass_pane_noside_alt"))); + HELPER.addReFramedModel(ReFramed.id("pressure_plate_up_special") , HELPER.auto(new Identifier("block/pressure_plate_up"))); + HELPER.addReFramedModel(ReFramed.id("pressure_plate_down_special") , HELPER.auto(new Identifier("block/pressure_plate_down"))); + HELPER.addReFramedModel(ReFramed.id("slab_special") , HELPER.auto(new Identifier("block/slab"))); + HELPER.addReFramedModel(ReFramed.id("stairs_special") , HELPER.auto(new Identifier("block/stairs"))); + HELPER.addReFramedModel(ReFramed.id("double_outer_stairs_special") , HELPER.auto(ReFramed.id("block/double_outer_stairs"))); + HELPER.addReFramedModel(ReFramed.id("inner_stairs_special") , HELPER.auto(new Identifier("block/inner_stairs"))); + HELPER.addReFramedModel(ReFramed.id("outer_stairs_special") , HELPER.auto(new Identifier("block/outer_stairs"))); + HELPER.addReFramedModel(ReFramed.id("trapdoor_bottom_special") , HELPER.auto(new Identifier("block/template_trapdoor_bottom"))); + HELPER.addReFramedModel(ReFramed.id("trapdoor_top_special") , HELPER.auto(new Identifier("block/template_trapdoor_top"))); + HELPER.addReFramedModel(ReFramed.id("wall_post_special") , HELPER.auto(new Identifier("block/template_wall_post"))); + + //vanilla style models (using "special-sprite replacement" method) + HELPER.addReFramedModel(ReFramed.id("lever_special") , HELPER.json(ReFramed.id("block/lever"))); + HELPER.addReFramedModel(ReFramed.id("trapdoor_open_special") , HELPER.json(ReFramed.id("block/trapdoor_open"))); + HELPER.addReFramedModel(ReFramed.id("lever_on_special") , HELPER.json(ReFramed.id("block/lever_on"))); + //these next five only exist because AutoRetexturedModels don't seem to rotate their textures the right way when rotated from a multipart blockstate + HELPER.addReFramedModel(ReFramed.id("fence_side_special") , HELPER.json(ReFramed.id("block/fence_side"))); + HELPER.addReFramedModel(ReFramed.id("glass_pane_side_special") , HELPER.json(ReFramed.id("block/glass_pane_side"))); + HELPER.addReFramedModel(ReFramed.id("glass_pane_side_alt_special") , HELPER.json(ReFramed.id("block/glass_pane_side_alt"))); + HELPER.addReFramedModel(ReFramed.id("wall_side_special") , HELPER.json(ReFramed.id("block/wall_side"))); + HELPER.addReFramedModel(ReFramed.id("wall_side_tall_special") , HELPER.json(ReFramed.id("block/wall_side_tall"))); + + //item only models + HELPER.addReFramedModel(ReFramed.id("button_inventory_special") , HELPER.auto(new Identifier("block/button_inventory"))); + HELPER.addReFramedModel(ReFramed.id("fence_inventory_special") , HELPER.auto(new Identifier("block/fence_inventory"))); + HELPER.addReFramedModel(ReFramed.id("fence_post_inventory_special") , HELPER.auto(ReFramed.id("block/fence_post_inventory"))); + HELPER.addReFramedModel(ReFramed.id("wall_inventory_special") , HELPER.auto(new Identifier("block/wall_inventory"))); + + //item model assignments (in lieu of models/item/___.json) + HELPER.assignItemModel(ReFramed.id("button_inventory_special") , ReFramed.BUTTON); + HELPER.assignItemModel(ReFramed.id("carpet_special") , ReFramed.CARPET); + HELPER.assignItemModel(ReFramed.id("cube_special") , ReFramed.CUBE); + HELPER.assignItemModel(ReFramed.id("fence_inventory_special") , ReFramed.FENCE); + HELPER.assignItemModel(ReFramed.id("fence_gate_special") , ReFramed.FENCE_GATE); + HELPER.assignItemModel(ReFramed.id("trapdoor_bottom_special") , ReFramed.IRON_TRAPDOOR); + HELPER.assignItemModel(ReFramed.id("fence_post_inventory_special") , ReFramed.POST); + HELPER.assignItemModel(ReFramed.id("pressure_plate_up_special") , ReFramed.PRESSURE_PLATE); + HELPER.assignItemModel(ReFramed.id("slab_special") , ReFramed.SLAB); + HELPER.assignItemModel(ReFramed.id("stairs_special") , ReFramed.STAIRS); + HELPER.assignItemModel(ReFramed.id("trapdoor_bottom_special") , ReFramed.TRAPDOOR); + HELPER.assignItemModel(ReFramed.id("wall_inventory_special") , ReFramed.WALL); + } + + private void privateInit() { + //set up some magic to force chunk rerenders when you change a template (see TemplateEntity) + ReFramed.chunkRerenderProxy = (world, pos) -> { + if(world == MinecraftClient.getInstance().world) { + MinecraftClient.getInstance().worldRenderer.scheduleBlockRender( + ChunkSectionPos.getSectionCoord(pos.getX()), + ChunkSectionPos.getSectionCoord(pos.getY()), + ChunkSectionPos.getSectionCoord(pos.getZ()) + ); + } + }; + + //supporting code for the TemplatesModelProvider + ModelLoadingRegistry.INSTANCE.registerResourceProvider(rm -> PROVIDER); //block models + ModelLoadingRegistry.INSTANCE.registerVariantProvider(rm -> PROVIDER); //item models + + ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() { + @Override public Identifier getFabricId() { return ReFramed.id("dump-caches"); } + @Override public void reload(ResourceManager blah) { PROVIDER.dumpCache(); } + }); + } +} diff --git a/src/main/java/fr/adrien1106/reframed/client/ReFramedClientHelper.java b/src/main/java/fr/adrien1106/reframed/client/ReFramedClientHelper.java new file mode 100644 index 0000000..87c7591 --- /dev/null +++ b/src/main/java/fr/adrien1106/reframed/client/ReFramedClientHelper.java @@ -0,0 +1,60 @@ +package fr.adrien1106.reframed.client; + +import fr.adrien1106.reframed.client.model.apperance.CamoAppearanceManager; +import fr.adrien1106.reframed.client.model.UnbakedAutoRetexturedModel; +import fr.adrien1106.reframed.client.model.UnbakedJsonRetexturedModel; +import net.fabricmc.fabric.api.renderer.v1.Renderer; +import net.fabricmc.fabric.api.renderer.v1.RendererAccess; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.client.render.model.UnbakedModel; +import net.minecraft.client.texture.Sprite; +import net.minecraft.client.util.SpriteIdentifier; +import net.minecraft.item.ItemConvertible; +import net.minecraft.util.Identifier; +import org.jetbrains.annotations.NotNull; + +import java.util.function.Function; + +public class ReFramedClientHelper { + + public ReFramedClientHelper(ReFramedModelProvider prov) { + this.prov = prov; + } + + private final ReFramedModelProvider prov; + + public UnbakedModel auto(Identifier parent) { + return new UnbakedAutoRetexturedModel(parent); + } + + public UnbakedModel json(Identifier parent) { + return new UnbakedJsonRetexturedModel(parent); + } + + public void addReFramedModel(Identifier id, UnbakedModel unbaked) { + prov.addReFramedModel(id, unbaked); + } + + public void assignItemModel(Identifier model_id, ItemConvertible... item_convertibles) { + prov.assignItemModel(model_id, item_convertibles); + } + + public CamoAppearanceManager getCamoApperanceManager(Function spriteLookup) { + return prov.getCamoApperanceManager(spriteLookup); + } + + public @NotNull Renderer getFabricRenderer() { + Renderer obj = RendererAccess.INSTANCE.getRenderer(); + if(obj != null) return obj; + + //Welp, not much more we can do, this mod heavily relies on frapi + String msg = "A Fabric Rendering API implementation is required to use ReFramed!"; + + if(!FabricLoader.getInstance().isModLoaded("fabric-renderer-indigo")) + msg += "\nI noticed you don't have Indigo installed, which is a part of the complete Fabric API package."; + if(FabricLoader.getInstance().isModLoaded("sodium")) + msg += "\nI noticed you have Sodium installed - consider also installing Indium to provide a compatible renderer implementation."; + + throw new NullPointerException(msg); + } +} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesModelProvider.java b/src/main/java/fr/adrien1106/reframed/client/ReFramedModelProvider.java similarity index 66% rename from src/main/java/fr/adrien1106/reframedtemplates/TemplatesModelProvider.java rename to src/main/java/fr/adrien1106/reframed/client/ReFramedModelProvider.java index 830c2ba..a70a005 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesModelProvider.java +++ b/src/main/java/fr/adrien1106/reframed/client/ReFramedModelProvider.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates; +package fr.adrien1106.reframed.client; -import fr.adrien1106.reframedtemplates.model.apperance.TemplateAppearanceManager; +import fr.adrien1106.reframed.client.model.apperance.CamoAppearanceManager; import net.fabricmc.fabric.api.client.model.ModelProviderContext; import net.fabricmc.fabric.api.client.model.ModelResourceProvider; import net.fabricmc.fabric.api.client.model.ModelVariantProvider; @@ -18,11 +18,11 @@ import java.util.Map; import java.util.Objects; import java.util.function.Function; -public class TemplatesModelProvider implements ModelResourceProvider, ModelVariantProvider { +public class ReFramedModelProvider implements ModelResourceProvider, ModelVariantProvider { private final Map models = new HashMap<>(); private final Map itemAssignments = new HashMap<>(); - private volatile TemplateAppearanceManager appearanceManager; + private volatile CamoAppearanceManager appearanceManager; /// fabric model provider api @@ -34,7 +34,7 @@ public class TemplatesModelProvider implements ModelResourceProvider, ModelVaria //For blocks, you can point the game directly at the custom model in the blockstate json file. //Item models don't have that layer of indirection; it always wants to load the hardcoded "item:id#inventory" model. //You *would* be able to create a model json for it and set the "parent" field to the custom model, - //but json models are never allowed to have non-json models as a parent, and template unbaked models are not json models. Ah well. + //but json models are never allowed to have non-json models as a parent, and frame unbaked models are not json models. Ah well. //So, instead, we use a ModelVariantProvider to redirect attempts to load the item:id#inventory model. @Override public @Nullable UnbakedModel loadModelVariant(ModelIdentifier modelId, ModelProviderContext context) { @@ -42,16 +42,16 @@ public class TemplatesModelProvider implements ModelResourceProvider, ModelVaria return customModelId == null ? null : loadModelResource(customModelId, context); } - /// template appearance manager cache + /// camo appearance manager cache - public TemplateAppearanceManager getOrCreateTemplateApperanceManager(Function spriteLookup) { + public CamoAppearanceManager getCamoApperanceManager(Function spriteLookup) { //This is kind of needlessly sketchy using the "volatile double checked locking" pattern. - //I'd like all template models to use the same TemplateApperanceManager, despite the model + //I'd like all frame models to use the same CamoApperanceManager, despite the model //baking process happening concurrently on several threads, but I also don't want to //hold up the model baking process too long. //Volatile field read: - TemplateAppearanceManager read = appearanceManager; + CamoAppearanceManager read = appearanceManager; if(read == null) { //Acquire a lock: @@ -61,7 +61,7 @@ public class TemplatesModelProvider implements ModelResourceProvider, ModelVaria read = appearanceManager; if(read == null) { //If no-one has initialized it still, I guess it falls to us - read = appearanceManager = new TemplateAppearanceManager(spriteLookup); + read = appearanceManager = new CamoAppearanceManager(spriteLookup); } } } @@ -73,19 +73,15 @@ public class TemplatesModelProvider implements ModelResourceProvider, ModelVaria appearanceManager = null; //volatile write } - public void addTemplateModel(Identifier id, UnbakedModel unbaked) { + public void addReFramedModel(Identifier id, UnbakedModel unbaked) { models.put(id, unbaked); } - public void assignItemModel(Identifier templateModelId, ModelIdentifier... modelIds) { - for(ModelIdentifier modelId : modelIds) itemAssignments.put(modelId, templateModelId); + public void assignItemModel(Identifier model_id, Identifier... itemIds) { + for(Identifier itemId : itemIds) itemAssignments.put(new ModelIdentifier(itemId, "inventory"), model_id); } - public void assignItemModel(Identifier templateModelId, Identifier... itemIds) { - for(Identifier itemId : itemIds) itemAssignments.put(new ModelIdentifier(itemId, "inventory"), templateModelId); - } - - public void assignItemModel(Identifier templateModelId, ItemConvertible... itemConvs) { - for(ItemConvertible itemConv : itemConvs) assignItemModel(templateModelId, Registries.ITEM.getId(itemConv.asItem())); + public void assignItemModel(Identifier model_id, ItemConvertible... itemConvs) { + for(ItemConvertible itemConv : itemConvs) assignItemModel(model_id, Registries.ITEM.getId(itemConv.asItem())); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/MeshTransformUtil.java b/src/main/java/fr/adrien1106/reframed/client/model/MeshTransformUtil.java similarity index 69% rename from src/main/java/fr/adrien1106/reframedtemplates/model/MeshTransformUtil.java rename to src/main/java/fr/adrien1106/reframed/client/model/MeshTransformUtil.java index b512c92..9ea3c07 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/MeshTransformUtil.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/MeshTransformUtil.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.model; +package fr.adrien1106.reframed.client.model; -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; +import fr.adrien1106.reframed.client.ReFramedClient; import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; import net.fabricmc.fabric.api.renderer.v1.mesh.MeshBuilder; import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter; @@ -16,7 +16,7 @@ import java.util.Map; public class MeshTransformUtil { public static Mesh pretransformMesh(Mesh mesh, RenderContext.QuadTransform transform) { - MeshBuilder builder = TemplatesClientApi.getInstance().getFabricRenderer().meshBuilder(); + MeshBuilder builder = ReFramedClient.HELPER.getFabricRenderer().meshBuilder(); QuadEmitter emitter = builder.getEmitter(); mesh.forEach(quad -> { @@ -27,19 +27,6 @@ public class MeshTransformUtil { return builder.build(); } - //Hard to explain what this is for... - //Basically, Templates 1.x manually emitted the north/south/east/west faces all individually. - //This means it was easy to get the orientation of the block correct - to popular the north face of the slope, look at - //the north texture of the theme block. In this version, there is only *one* slope model that is dynamically rotated - //to form the other possible orientations. If I populate the north face of the model using the north face of the theme, - //then rotate the model, it's no longer facing the right way. So I need to "un-rotate" the face assignments first. - // - //This seems to work, but I'm kinda surprised I don't need to invert the transformation here, which is a clue that - //I don't really understand all the math, loool - public static Map facePermutation(ModelBakeSettings aff) { - return facePermutation(aff.getRotation().getMatrix()); - } - public static Map facePermutation(Matrix4f mat) { Map facePermutation = new EnumMap<>(Direction.class); for(Direction input : Direction.values()) { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/QuadUvBounds.java b/src/main/java/fr/adrien1106/reframed/client/model/QuadUvBounds.java similarity index 93% rename from src/main/java/fr/adrien1106/reframedtemplates/model/QuadUvBounds.java rename to src/main/java/fr/adrien1106/reframed/client/model/QuadUvBounds.java index ef18201..e95b3da 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/QuadUvBounds.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/QuadUvBounds.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.model; +package fr.adrien1106.reframed.client.model; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.mesh.QuadView; @@ -21,7 +21,7 @@ record QuadUvBounds(float minU, float maxU, float minV, float maxV) { return sprite.getMinU() <= minU && sprite.getMaxU() >= maxU && sprite.getMinV() <= minV && sprite.getMaxV() >= maxV; } - void normalizeUv(MutableQuadView quad, Sprite sprite) { // TODO find out for sprites rotations and mirroring + void normalizeUv(MutableQuadView quad, Sprite sprite) { float remappedMinU = norm(minU, sprite.getMinU(), sprite.getMaxU()); float remappedMaxU = norm(maxU, sprite.getMinU(), sprite.getMaxU()); float remappedMinV = norm(minV, sprite.getMinV(), sprite.getMaxV()); diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/RetexturingBakedModel.java b/src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java similarity index 76% rename from src/main/java/fr/adrien1106/reframedtemplates/model/RetexturingBakedModel.java rename to src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java index 637578c..d3ab3b0 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/RetexturingBakedModel.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/RetexturingBakedModel.java @@ -1,10 +1,10 @@ -package fr.adrien1106.reframedtemplates.model; +package fr.adrien1106.reframed.client.model; -import fr.adrien1106.reframedtemplates.block.FramedEntity; -import fr.adrien1106.reframedtemplates.mixin.MinecraftAccessor; -import fr.adrien1106.reframedtemplates.model.apperance.TemplateAppearance; -import fr.adrien1106.reframedtemplates.model.apperance.TemplateAppearanceManager; -import fr.adrien1106.reframedtemplates.model.apperance.WeightedComputedAppearance; +import fr.adrien1106.reframed.block.ReFramedEntity; +import fr.adrien1106.reframed.mixin.MinecraftAccessor; +import fr.adrien1106.reframed.client.model.apperance.CamoAppearance; +import fr.adrien1106.reframed.client.model.apperance.CamoAppearanceManager; +import fr.adrien1106.reframed.client.model.apperance.WeightedComputedAppearance; import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.mesh.QuadEmitter; @@ -27,25 +27,23 @@ import java.util.concurrent.ConcurrentMap; import java.util.function.Supplier; public abstract class RetexturingBakedModel extends ForwardingBakedModel { - public RetexturingBakedModel(BakedModel baseModel, TemplateAppearanceManager tam, ModelBakeSettings settings, BlockState itemModelState, boolean ao) { + public RetexturingBakedModel(BakedModel baseModel, CamoAppearanceManager tam, ModelBakeSettings settings, BlockState itemModelState, boolean ao) { this.wrapped = baseModel; //field from the superclass; vanilla getQuads etc. will delegate through to this this.tam = tam; -// this.facePermutation = MeshTransformUtil.facePermutation(settings); this.uvlock = settings.isUvLocked(); this.itemModelState = itemModelState; this.ao = ao; } - protected final TemplateAppearanceManager tam; -// protected final Map facePermutation; + protected final CamoAppearanceManager tam; protected final boolean uvlock; protected final BlockState itemModelState; protected final boolean ao; protected record MeshCacheKey(BlockState state, TransformCacheKey transform) {} protected final ConcurrentMap retextured_meshes = new ConcurrentHashMap<>(); //mutable, append-only cache - protected record TransformCacheKey(TemplateAppearance appearance, int model_id) {} + protected record TransformCacheKey(CamoAppearance appearance, int model_id) {} protected final ConcurrentMap retextured_transforms = new ConcurrentHashMap<>(); protected static final Direction[] DIRECTIONS = Direction.values(); @@ -74,16 +72,16 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { } if(theme.getBlock() == Blocks.BARRIER) return; - TemplateAppearance template_appearance = tam.getTemplateAppearance(theme); + CamoAppearance camo = tam.getCamoAppearance(theme); long seed = theme.getRenderingSeed(pos); int model_id = 0; - if (template_appearance instanceof WeightedComputedAppearance wca) model_id = wca.getAppearanceIndex(seed); + if (camo instanceof WeightedComputedAppearance wca) model_id = wca.getAppearanceIndex(seed); int tint = 0xFF000000 | MinecraftClient.getInstance().getBlockColors().getColor(theme, blockView, pos, 0); Mesh untintedMesh = getUntintedRetexturedMesh( new MeshCacheKey( state, - new TransformCacheKey(template_appearance, model_id) + new TransformCacheKey(camo, model_id) ), seed ); @@ -93,7 +91,7 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { if(tint == 0xFFFFFFFF) { untintedMesh.outputTo(quad_emitter); } else { - context.pushTransform(new TintingTransformer(template_appearance, tint, seed)); + context.pushTransform(new TintingTransformer(camo, tint, seed)); untintedMesh.outputTo(quad_emitter); context.popTransform(); } @@ -103,12 +101,12 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { public void emitItemQuads(ItemStack stack, Supplier randomSupplier, RenderContext context) { //cheeky: if the item has NBT data, pluck out the blockstate from it & look up the item color provider //none of this is accessible unless you're in creative mode doing ctrl-pick btw - TemplateAppearance nbtAppearance; + CamoAppearance nbtAppearance; int tint; - BlockState theme = FramedEntity.readStateFromItem(stack); + BlockState theme = ReFramedEntity.readStateFromItem(stack); if(!theme.isAir()) { - nbtAppearance = tam.getTemplateAppearance(theme); - tint = 0xFF000000 | ((MinecraftAccessor) MinecraftClient.getInstance()).templates$getItemColors().getColor(new ItemStack(theme.getBlock()), 0); + nbtAppearance = tam.getCamoAppearance(theme); + tint = 0xFF000000 | ((MinecraftAccessor) MinecraftClient.getInstance()).getItemColors().getColor(new ItemStack(theme.getBlock()), 0); } else { nbtAppearance = tam.getDefaultAppearance(); tint = 0xFFFFFFFF; @@ -137,12 +135,12 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { protected class RetexturingTransformer implements RenderContext.QuadTransform { private final long seed; - protected RetexturingTransformer(TemplateAppearance ta, long seed) { + protected RetexturingTransformer(CamoAppearance ta, long seed) { this.ta = ta; this.seed = seed; } - protected final TemplateAppearance ta; + protected final CamoAppearance ta; @Override public boolean transform(MutableQuadView quad) { @@ -152,7 +150,7 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { if(tag == 0) return true; //Pass the quad through unmodified. //The quad tag numbers were selected so this magic trick works: - Direction direction = quad.nominalFace(); // facePermutation.get(quad.nominalFace()); + Direction direction = quad.nominalFace(); quad.spriteBake(ta.getSprite(direction, seed), MutableQuadView.BAKE_NORMALIZED | ta.getBakeFlags(direction, seed) | (uvlock ? MutableQuadView.BAKE_LOCK_UV : 0)); return true; } @@ -160,13 +158,13 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { protected class TintingTransformer implements RenderContext.QuadTransform { private final long seed; - protected TintingTransformer(TemplateAppearance ta, int tint, long seed) { + protected TintingTransformer(CamoAppearance ta, int tint, long seed) { this.ta = ta; this.tint = tint; this.seed = seed; } - protected final TemplateAppearance ta; + protected final CamoAppearance ta; protected final int tint; @Override @@ -174,7 +172,6 @@ public abstract class RetexturingBakedModel extends ForwardingBakedModel { int tag = quad.tag(); if(tag == 0) return true; -// Direction dir = facePermutation.get(DIRECTIONS[quad.tag() - 1]); if(ta.hasColor(quad.nominalFace(), seed)) quad.color(tint, tint, tint, tint); return true; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedAutoRetexturedModel.java b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedAutoRetexturedModel.java similarity index 80% rename from src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedAutoRetexturedModel.java rename to src/main/java/fr/adrien1106/reframed/client/model/UnbakedAutoRetexturedModel.java index 8f40007..216da7c 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedAutoRetexturedModel.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedAutoRetexturedModel.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.model; +package fr.adrien1106.reframed.client.model; -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; +import fr.adrien1106.reframed.client.ReFramedClient; import net.fabricmc.fabric.api.renderer.v1.Renderer; import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; @@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.Function; -public class UnbakedAutoRetexturedModel implements UnbakedModel, TemplatesClientApi.TweakableUnbakedModel { +public class UnbakedAutoRetexturedModel implements UnbakedModel { public UnbakedAutoRetexturedModel(Identifier parent) { this.parent = parent; } @@ -35,22 +35,6 @@ public class UnbakedAutoRetexturedModel implements UnbakedModel, TemplatesClient protected BlockState itemModelState = Blocks.AIR.getDefaultState(); protected boolean ao = true; - /// user configuration - - @Override - public UnbakedAutoRetexturedModel disableAo() { - ao = false; - return this; - } - - @Override - public TemplatesClientApi.TweakableUnbakedModel itemModelState(BlockState state) { - this.itemModelState = state; - return this; - } - - /// actual unbakedmodel stuff - @Override public Collection getModelDependencies() { return Collections.singletonList(parent); @@ -66,7 +50,7 @@ public class UnbakedAutoRetexturedModel implements UnbakedModel, TemplatesClient public BakedModel bake(Baker baker, Function spriteLookup, ModelBakeSettings modelBakeSettings, Identifier identifier) { return new RetexturingBakedModel( baker.bake(parent, modelBakeSettings), - TemplatesClientApi.getInstance().getOrCreateTemplateApperanceManager(spriteLookup), + ReFramedClient.HELPER.getCamoApperanceManager(spriteLookup), modelBakeSettings, itemModelState, ao @@ -80,7 +64,7 @@ public class UnbakedAutoRetexturedModel implements UnbakedModel, TemplatesClient } private Mesh convertModel(BlockState state) { - Renderer r = TemplatesClientApi.getInstance().getFabricRenderer(); + Renderer r = ReFramedClient.HELPER.getFabricRenderer(); MeshBuilder builder = r.meshBuilder(); QuadEmitter emitter = builder.getEmitter(); RenderMaterial mat = tam.getCachedMaterial(state, false); diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedJsonRetexturedModel.java b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedJsonRetexturedModel.java similarity index 79% rename from src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedJsonRetexturedModel.java rename to src/main/java/fr/adrien1106/reframed/client/model/UnbakedJsonRetexturedModel.java index 97f5039..b984c3d 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedJsonRetexturedModel.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedJsonRetexturedModel.java @@ -1,7 +1,7 @@ -package fr.adrien1106.reframedtemplates.model; +package fr.adrien1106.reframed.client.model; -import fr.adrien1106.reframedtemplates.Templates; -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.client.ReFramedClient; import net.fabricmc.fabric.api.renderer.v1.Renderer; import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; @@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.Function; -public class UnbakedJsonRetexturedModel implements UnbakedModel, TemplatesClientApi.TweakableUnbakedModel { +public class UnbakedJsonRetexturedModel implements UnbakedModel { public UnbakedJsonRetexturedModel(Identifier parent) { this.parent = parent; } @@ -33,22 +33,6 @@ public class UnbakedJsonRetexturedModel implements UnbakedModel, TemplatesClient protected BlockState itemModelState; protected boolean ao = true; - /// user configuration - - @Override - public UnbakedJsonRetexturedModel disableAo() { - ao = false; - return this; - } - - @Override - public TemplatesClientApi.TweakableUnbakedModel itemModelState(BlockState state) { - this.itemModelState = state; - return this; - } - - /// actual unbakedmodel stuff - @Override public Collection getModelDependencies() { return Collections.singletonList(parent); @@ -66,7 +50,7 @@ public class UnbakedJsonRetexturedModel implements UnbakedModel, TemplatesClient Sprite[] specialSprites = new Sprite[DIRECTIONS.length]; for(int i = 0; i < DIRECTIONS.length; i++) { - SpriteIdentifier id = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, Templates.id("templates_special/" + DIRECTIONS[i].getName())); + SpriteIdentifier id = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, ReFramed.id("reframed_special/" + DIRECTIONS[i].getName())); specialSprites[i] = Objects.requireNonNull(spriteLookup.apply(id), () -> "Couldn't find sprite " + id + " !"); } @@ -74,7 +58,7 @@ public class UnbakedJsonRetexturedModel implements UnbakedModel, TemplatesClient return new RetexturingBakedModel( model, - TemplatesClientApi.getInstance().getOrCreateTemplateApperanceManager(spriteLookup), + ReFramedClient.HELPER.getCamoApperanceManager(spriteLookup), modelBakeSettings, itemModelState, ao @@ -88,7 +72,7 @@ public class UnbakedJsonRetexturedModel implements UnbakedModel, TemplatesClient } private Mesh convertModel(BlockState state) { - Renderer r = TemplatesClientApi.getInstance().getFabricRenderer(); + Renderer r = ReFramedClient.HELPER.getFabricRenderer(); MeshBuilder builder = r.meshBuilder(); QuadEmitter emitter = builder.getEmitter(); RenderMaterial mat = tam.getCachedMaterial(state, false); diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedMeshRetexturedModel.java b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedMeshRetexturedModel.java similarity index 71% rename from src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedMeshRetexturedModel.java rename to src/main/java/fr/adrien1106/reframed/client/model/UnbakedMeshRetexturedModel.java index ad98ed5..8a7efdc 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/UnbakedMeshRetexturedModel.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/UnbakedMeshRetexturedModel.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.model; +package fr.adrien1106.reframed.client.model; -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; +import fr.adrien1106.reframed.client.ReFramedClient; import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Collections; import java.util.function.Function; -public class UnbakedMeshRetexturedModel implements UnbakedModel, TemplatesClientApi.TweakableUnbakedModel { +public class UnbakedMeshRetexturedModel implements UnbakedModel { public UnbakedMeshRetexturedModel(Identifier parent, Function, Mesh> baseMeshFactory) { this.parent = parent; this.baseMeshFactory = baseMeshFactory; @@ -26,21 +26,6 @@ public class UnbakedMeshRetexturedModel implements UnbakedModel, TemplatesClient protected final Function, Mesh> baseMeshFactory; protected boolean ao = true; - /// user configuration - - @Override - public UnbakedMeshRetexturedModel disableAo() { - ao = false; - return this; - } - - @Override - public TemplatesClientApi.TweakableUnbakedModel itemModelState(BlockState state) { - throw new UnsupportedOperationException("UnbakedMeshRetexturedModel does not need an item model state set; it uses meshes"); - } - - /// actual unbakedmodel stuff - @Override public Collection getModelDependencies() { return Collections.singletonList(parent); @@ -57,7 +42,7 @@ public class UnbakedMeshRetexturedModel implements UnbakedModel, TemplatesClient return new RetexturingBakedModel( baker.bake(parent, modelBakeSettings), - TemplatesClientApi.getInstance().getOrCreateTemplateApperanceManager(spriteLookup), + ReFramedClient.HELPER.getCamoApperanceManager(spriteLookup), modelBakeSettings, Blocks.AIR.getDefaultState(), ao diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/Appearance.java b/src/main/java/fr/adrien1106/reframed/client/model/apperance/Appearance.java similarity index 68% rename from src/main/java/fr/adrien1106/reframedtemplates/model/apperance/Appearance.java rename to src/main/java/fr/adrien1106/reframed/client/model/apperance/Appearance.java index 4e8f6e6..88efc63 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/Appearance.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/apperance/Appearance.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.model.apperance; +package fr.adrien1106.reframed.client.model.apperance; import net.minecraft.client.texture.Sprite; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/TemplateAppearance.java b/src/main/java/fr/adrien1106/reframed/client/model/apperance/CamoAppearance.java similarity index 80% rename from src/main/java/fr/adrien1106/reframedtemplates/model/apperance/TemplateAppearance.java rename to src/main/java/fr/adrien1106/reframed/client/model/apperance/CamoAppearance.java index b7d6348..312c9d8 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/TemplateAppearance.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/apperance/CamoAppearance.java @@ -1,11 +1,11 @@ -package fr.adrien1106.reframedtemplates.model.apperance; +package fr.adrien1106.reframed.client.model.apperance; import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; import net.minecraft.client.texture.Sprite; import net.minecraft.util.math.Direction; import org.jetbrains.annotations.NotNull; -public interface TemplateAppearance { +public interface CamoAppearance { @NotNull RenderMaterial getRenderMaterial(boolean ao); @NotNull Sprite getSprite(Direction dir, long seed); int getBakeFlags(Direction dir, long seed); diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/TemplateAppearanceManager.java b/src/main/java/fr/adrien1106/reframed/client/model/apperance/CamoAppearanceManager.java similarity index 79% rename from src/main/java/fr/adrien1106/reframedtemplates/model/apperance/TemplateAppearanceManager.java rename to src/main/java/fr/adrien1106/reframed/client/model/apperance/CamoAppearanceManager.java index 92e0674..8d0384a 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/TemplateAppearanceManager.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/apperance/CamoAppearanceManager.java @@ -1,7 +1,8 @@ -package fr.adrien1106.reframedtemplates.model.apperance; +package fr.adrien1106.reframed.client.model.apperance; -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; -import fr.adrien1106.reframedtemplates.mixin.model.WeightedBakedModelAccessor; +import fr.adrien1106.reframed.ReFramed; +import fr.adrien1106.reframed.client.ReFramedClient; +import fr.adrien1106.reframed.mixin.model.WeightedBakedModelAccessor; import net.fabricmc.fabric.api.renderer.v1.Renderer; import net.fabricmc.fabric.api.renderer.v1.material.BlendMode; import net.fabricmc.fabric.api.renderer.v1.material.MaterialFinder; @@ -31,10 +32,10 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; -public class TemplateAppearanceManager { +public class CamoAppearanceManager { - public TemplateAppearanceManager(Function spriteLookup) { - MaterialFinder finder = TemplatesClientApi.getInstance().getFabricRenderer().materialFinder(); + public CamoAppearanceManager(Function spriteLookup) { + MaterialFinder finder = ReFramedClient.HELPER.getFabricRenderer().materialFinder(); for(BlendMode blend : BlendMode.values()) { finder.clear().disableDiffuse(false).blendMode(blend); @@ -51,23 +52,23 @@ public class TemplateAppearanceManager { this.barrierItemAppearance = new SingleSpriteAppearance(barrier, materialsWithoutAo.get(BlendMode.CUTOUT), serialNumber.getAndIncrement()); } - protected static final SpriteIdentifier DEFAULT_SPRITE_ID = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, new Identifier("reframedtemplates:block/framed_block")); + protected static final SpriteIdentifier DEFAULT_SPRITE_ID = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, new Identifier(ReFramed.MODID, "block/framed_block")); private static final SpriteIdentifier BARRIER_SPRITE_ID = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, new Identifier("minecraft:item/barrier")); - private final TemplateAppearance defaultAppearance; - private final TemplateAppearance barrierItemAppearance; + private final CamoAppearance defaultAppearance; + private final CamoAppearance barrierItemAppearance; - private final ConcurrentHashMap appearanceCache = new ConcurrentHashMap<>(); //Mutable, append-only cache + private final ConcurrentHashMap appearanceCache = new ConcurrentHashMap<>(); //Mutable, append-only cache private final AtomicInteger serialNumber = new AtomicInteger(0); //Mutable private final EnumMap materialsWithAo = new EnumMap<>(BlendMode.class); private final EnumMap materialsWithoutAo = new EnumMap<>(BlendMode.class); //Immutable contents - public TemplateAppearance getDefaultAppearance() { + public CamoAppearance getDefaultAppearance() { return defaultAppearance; } - public TemplateAppearance getTemplateAppearance(BlockState state) { + public CamoAppearance getCamoAppearance(BlockState state) { return appearanceCache.computeIfAbsent(state, this::computeAppearance); } @@ -76,22 +77,11 @@ public class TemplateAppearanceManager { return m.get(BlendMode.fromRenderLayer(RenderLayers.getBlockLayer(state))); } - private static final int[] MAGIC_BAKEFLAGS_SBOX = new int[16]; - static { - //left to right -> u0 v0 u1 v1 - //the bit is set if the coordinate is "high" - MAGIC_BAKEFLAGS_SBOX[0b1110] = 0; - MAGIC_BAKEFLAGS_SBOX[0b1000] = MutableQuadView.BAKE_ROTATE_90; - MAGIC_BAKEFLAGS_SBOX[0b0001] = MutableQuadView.BAKE_ROTATE_180; - MAGIC_BAKEFLAGS_SBOX[0b0111] = MutableQuadView.BAKE_ROTATE_270; - //TODO: handle more cases. Also, it might be possible to drop v1 and still have the table be unambiguous - } - - //I'm pretty sure ConcurrentHashMap semantics allow for this function to be called multiple times on the same key, on different threads. - //The computeIfAbsent map update will work without corrupting the map, but there will be some "wasted effort" computing the value twice. - //The results are going to be the same, apart from their serialNumbers differing (= their equals & hashCode differing). - //Tiny amount of wasted space in some caches if TemplateAppearances are used as a map key, then. IMO it's not a critical issue. - private TemplateAppearance computeAppearance(BlockState state) { + // I'm pretty sure ConcurrentHashMap semantics allow for this function to be called multiple times on the same key, on different threads. + // The computeIfAbsent map update will work without corrupting the map, but there will be some "wasted effort" computing the value twice. + // The results are going to be the same, apart from their serialNumbers differing (= their equals & hashCode differing). + // Tiny amount of wasted space in some caches if CamoAppearances are used as a map key, then. IMO it's not a critical issue. + private CamoAppearance computeAppearance(BlockState state) { if(state.getBlock() == Blocks.BARRIER) return barrierItemAppearance; BakedModel model = MinecraftClient.getInstance().getBlockRenderManager().getModel(state); @@ -116,8 +106,8 @@ public class TemplateAppearanceManager { } private Appearance getAppearance(BakedModel model) { - //Only for parsing vanilla quads: - Renderer r = TemplatesClientApi.getInstance().getFabricRenderer(); + // Only for parsing vanilla quads: + Renderer r = ReFramedClient.HELPER.getFabricRenderer(); QuadEmitter quad_emitter = r.meshBuilder().getEmitter(); RenderMaterial material = r.materialFinder().clear().find(); Random random = Random.create(); @@ -126,7 +116,6 @@ public class TemplateAppearanceManager { int[] flags = new int[6]; byte[] color_mask = {0b000000}; - System.out.println("new mesh"); // TODO remove //Read quads off the model by their `cullface` Arrays.stream(Direction.values()).forEach(direction -> { List quads = model.getQuads(null, direction, random); @@ -161,7 +150,7 @@ public class TemplateAppearanceManager { return new Appearance(sprites, flags, color_mask[0]); } - private static int getBakeFlags(QuadEmitter emitter, Sprite sprite) { // TODO can probably receive tons of improvements + private static int getBakeFlags(QuadEmitter emitter, Sprite sprite) { boolean[][] order_matrix = getOrderMatrix(emitter, sprite); int flag = 0; if (!isClockwise(order_matrix)) { // check if quad has been mirrored on model diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/ComputedAppearance.java b/src/main/java/fr/adrien1106/reframed/client/model/apperance/ComputedAppearance.java similarity index 93% rename from src/main/java/fr/adrien1106/reframedtemplates/model/apperance/ComputedAppearance.java rename to src/main/java/fr/adrien1106/reframed/client/model/apperance/ComputedAppearance.java index 4a6543f..abfd673 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/ComputedAppearance.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/apperance/ComputedAppearance.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.model.apperance; +package fr.adrien1106.reframed.client.model.apperance; import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; import net.minecraft.client.texture.Sprite; @@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull; import java.util.Arrays; -public class ComputedAppearance implements TemplateAppearance { +public class ComputedAppearance implements CamoAppearance { private final Appearance appearance; private final int id; private final RenderMaterial matWithAo; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/SingleSpriteAppearance.java b/src/main/java/fr/adrien1106/reframed/client/model/apperance/SingleSpriteAppearance.java similarity index 91% rename from src/main/java/fr/adrien1106/reframedtemplates/model/apperance/SingleSpriteAppearance.java rename to src/main/java/fr/adrien1106/reframed/client/model/apperance/SingleSpriteAppearance.java index 468d88d..73a3a5b 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/SingleSpriteAppearance.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/apperance/SingleSpriteAppearance.java @@ -1,11 +1,11 @@ -package fr.adrien1106.reframedtemplates.model.apperance; +package fr.adrien1106.reframed.client.model.apperance; import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; import net.minecraft.client.texture.Sprite; import net.minecraft.util.math.Direction; import org.jetbrains.annotations.NotNull; -public class SingleSpriteAppearance implements TemplateAppearance { +public class SingleSpriteAppearance implements CamoAppearance { private final @NotNull Sprite defaultSprite; private final RenderMaterial mat; private final int id; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/WeightedComputedAppearance.java b/src/main/java/fr/adrien1106/reframed/client/model/apperance/WeightedComputedAppearance.java similarity index 95% rename from src/main/java/fr/adrien1106/reframedtemplates/model/apperance/WeightedComputedAppearance.java rename to src/main/java/fr/adrien1106/reframed/client/model/apperance/WeightedComputedAppearance.java index 52a884b..8bd4c4b 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/model/apperance/WeightedComputedAppearance.java +++ b/src/main/java/fr/adrien1106/reframed/client/model/apperance/WeightedComputedAppearance.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.model.apperance; +package fr.adrien1106.reframed.client.model.apperance; import net.fabricmc.fabric.api.renderer.v1.material.RenderMaterial; import net.minecraft.client.texture.Sprite; @@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; -public class WeightedComputedAppearance implements TemplateAppearance { +public class WeightedComputedAppearance implements CamoAppearance { private final List> appearances; private final int total_weight; private final int id; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/generator/GBlockLoot.java b/src/main/java/fr/adrien1106/reframed/generator/GBlockLoot.java similarity index 90% rename from src/main/java/fr/adrien1106/reframedtemplates/generator/GBlockLoot.java rename to src/main/java/fr/adrien1106/reframed/generator/GBlockLoot.java index 258ad83..d173c95 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/generator/GBlockLoot.java +++ b/src/main/java/fr/adrien1106/reframed/generator/GBlockLoot.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.generator; +package fr.adrien1106.reframed.generator; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/generator/GBlockstate.java b/src/main/java/fr/adrien1106/reframed/generator/GBlockstate.java similarity index 95% rename from src/main/java/fr/adrien1106/reframedtemplates/generator/GBlockstate.java rename to src/main/java/fr/adrien1106/reframed/generator/GBlockstate.java index f70949b..283be6d 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/generator/GBlockstate.java +++ b/src/main/java/fr/adrien1106/reframed/generator/GBlockstate.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.generator; +package fr.adrien1106.reframed.generator; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; @@ -15,7 +15,7 @@ public class GBlockstate extends FabricModelProvider { } @Override - public void generateBlockStateModels(BlockStateModelGenerator model_generator) { // TODO Find out smth for items + public void generateBlockStateModels(BlockStateModelGenerator model_generator) { Generator.BLOCKS .forEach(model_generator::excludeFromSimpleItemModelGeneration); Generator.BLOCKS.stream() diff --git a/src/main/java/fr/adrien1106/reframedtemplates/generator/Generator.java b/src/main/java/fr/adrien1106/reframed/generator/Generator.java similarity index 87% rename from src/main/java/fr/adrien1106/reframedtemplates/generator/Generator.java rename to src/main/java/fr/adrien1106/reframed/generator/Generator.java index c89c5ba..902ee3a 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/generator/Generator.java +++ b/src/main/java/fr/adrien1106/reframed/generator/Generator.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.generator; +package fr.adrien1106.reframed.generator; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; @@ -6,7 +6,7 @@ import net.minecraft.block.Block; import java.util.List; -import static fr.adrien1106.reframedtemplates.Templates.*; +import static fr.adrien1106.reframed.ReFramed.*; public class Generator implements DataGeneratorEntrypoint { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/generator/MultipartBlockStateProvider.java b/src/main/java/fr/adrien1106/reframed/generator/MultipartBlockStateProvider.java similarity index 75% rename from src/main/java/fr/adrien1106/reframedtemplates/generator/MultipartBlockStateProvider.java rename to src/main/java/fr/adrien1106/reframed/generator/MultipartBlockStateProvider.java index c347e57..49ea42c 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/generator/MultipartBlockStateProvider.java +++ b/src/main/java/fr/adrien1106/reframed/generator/MultipartBlockStateProvider.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.generator; +package fr.adrien1106.reframed.generator; import net.minecraft.data.client.MultipartBlockStateSupplier; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/MinecraftAccessor.java b/src/main/java/fr/adrien1106/reframed/mixin/MinecraftAccessor.java similarity index 74% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/MinecraftAccessor.java rename to src/main/java/fr/adrien1106/reframed/mixin/MinecraftAccessor.java index 7720ad2..f9510cf 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/MinecraftAccessor.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/MinecraftAccessor.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.mixin; +package fr.adrien1106.reframed.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.color.item.ItemColors; @@ -8,5 +8,5 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(MinecraftClient.class) public interface MinecraftAccessor { //Yeah there's a fabric API for this, but do we really need it, no. - @Accessor("itemColors") ItemColors templates$getItemColors(); + @Accessor("itemColors") ItemColors getItemColors(); } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/WallBlockAccessor.java b/src/main/java/fr/adrien1106/reframed/mixin/WallBlockAccessor.java similarity index 54% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/WallBlockAccessor.java rename to src/main/java/fr/adrien1106/reframed/mixin/WallBlockAccessor.java index 2f8ed36..7d56037 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/WallBlockAccessor.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/WallBlockAccessor.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.mixin; +package fr.adrien1106.reframed.mixin; import net.minecraft.block.BlockState; import net.minecraft.block.WallBlock; @@ -8,9 +8,9 @@ import org.spongepowered.asm.mixin.gen.Accessor; import java.util.Map; -//Used in TemplateWallBlock, since the vanilla wall block code explodes if you add more blockstates. +//Used in ReFramedWallBlock, since the vanilla wall block code explodes if you add more blockstates. @Mixin(WallBlock.class) public interface WallBlockAccessor { - @Accessor("shapeMap") Map templates$getShapeMap(); - @Accessor("collisionShapeMap") Map templates$getCollisionShapeMap(); + @Accessor("shapeMap") Map getShapeMap(); + @Accessor("collisionShapeMap") Map getCollisionShapeMap(); } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/model/WeightedBakedModelAccessor.java b/src/main/java/fr/adrien1106/reframed/mixin/model/WeightedBakedModelAccessor.java similarity index 89% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/model/WeightedBakedModelAccessor.java rename to src/main/java/fr/adrien1106/reframed/mixin/model/WeightedBakedModelAccessor.java index 2706e0b..cf1e09c 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/model/WeightedBakedModelAccessor.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/model/WeightedBakedModelAccessor.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.mixin.model; +package fr.adrien1106.reframed.mixin.model; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.WeightedBakedModel; diff --git a/src/main/java/fr/adrien1106/reframed/mixin/particles/AccessorParticle.java b/src/main/java/fr/adrien1106/reframed/mixin/particles/AccessorParticle.java new file mode 100644 index 0000000..0734648 --- /dev/null +++ b/src/main/java/fr/adrien1106/reframed/mixin/particles/AccessorParticle.java @@ -0,0 +1,15 @@ +package fr.adrien1106.reframed.mixin.particles; + +import net.minecraft.client.particle.Particle; +import net.minecraft.util.math.random.Random; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(Particle.class) +public interface AccessorParticle { + @Accessor("random") Random getRandom(); + + @Accessor("red") void setRed(float red); + @Accessor("green") void setGreen(float green); + @Accessor("blue") void setBlue(float blue); +} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/AccessorSpriteBillboardParticle.java b/src/main/java/fr/adrien1106/reframed/mixin/particles/AccessorSpriteBillboardParticle.java similarity index 70% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/AccessorSpriteBillboardParticle.java rename to src/main/java/fr/adrien1106/reframed/mixin/particles/AccessorSpriteBillboardParticle.java index 73c0ece..3a54bf2 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/AccessorSpriteBillboardParticle.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/particles/AccessorSpriteBillboardParticle.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.mixin.particles; +package fr.adrien1106.reframed.mixin.particles; import net.minecraft.client.particle.SpriteBillboardParticle; import net.minecraft.client.texture.Sprite; @@ -7,5 +7,5 @@ import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(SpriteBillboardParticle.class) public interface AccessorSpriteBillboardParticle { - @Invoker("setSprite") void templates$setSprite(Sprite sprite); + @Invoker("setSprite") void setNewSprite(Sprite sprite); } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinBlockDustParticle.java b/src/main/java/fr/adrien1106/reframed/mixin/particles/MixinBlockDustParticle.java similarity index 63% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinBlockDustParticle.java rename to src/main/java/fr/adrien1106/reframed/mixin/particles/MixinBlockDustParticle.java index 1799c7c..d541d1e 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinBlockDustParticle.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/particles/MixinBlockDustParticle.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.mixin.particles; +package fr.adrien1106.reframed.mixin.particles; -import fr.adrien1106.reframedtemplates.api.ThemeableBlockEntity; +import fr.adrien1106.reframed.util.ThemeableBlockEntity; import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; import net.minecraft.client.particle.BlockDustParticle; @@ -18,23 +18,23 @@ public class MixinBlockDustParticle { method = "(Lnet/minecraft/client/world/ClientWorld;DDDDDDLnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)V", at = @At("TAIL") ) - void templates$init$modifyParticleSprite(ClientWorld clientWorld, double d, double e, double f, double g, double h, double i, BlockState state, BlockPos pos, CallbackInfo ci) { + void modifyParticleSprite(ClientWorld clientWorld, double d, double e, double f, double g, double h, double i, BlockState state, BlockPos pos, CallbackInfo ci) { AccessorParticle a = (AccessorParticle) this; - if(a.templates$getRandom().nextBoolean() && clientWorld.getBlockEntity(pos) instanceof ThemeableBlockEntity themeable) { + if(a.getRandom().nextBoolean() && clientWorld.getBlockEntity(pos) instanceof ThemeableBlockEntity themeable) { BlockState theme = themeable.getThemeState(); if(theme == null || theme.isAir()) return; Sprite replacement = MinecraftClient.getInstance().getBlockRenderManager().getModels().getModelParticleSprite(theme); - ((AccessorSpriteBillboardParticle) this).templates$setSprite(replacement); + ((AccessorSpriteBillboardParticle) this).setNewSprite(replacement); //basically just re-implement what the constructor does - since we mixin at tail, this already ran //some modifyvariable magic on the BlockState wouldn't hurt, i suppose, but, eh //it'd need to capture method arguments but in this version of mixin it requires using threadlocals, - //and 99.9999% of block dust particles are not for template blocks, so it seems like a waste of cpu cycles + //and 99.9999% of block dust particles are not for frame blocks, so it seems like a waste of cpu cycles int color = MinecraftClient.getInstance().getBlockColors().getColor(theme, clientWorld, pos, 0); - a.templates$setRed(0.6f * ((color & 0xFF0000) >> 16) / 255f); - a.templates$setGreen(0.6f * ((color & 0x00FF00) >> 8) / 255f); - a.templates$setBlue(0.6f * (color & 0x0000FF) / 255f); + a.setRed(0.6f * ((color & 0xFF0000) >> 16) / 255f); + a.setGreen(0.6f * ((color & 0x00FF00) >> 8) / 255f); + a.setBlue(0.6f * (color & 0x0000FF) / 255f); } } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinEntity.java b/src/main/java/fr/adrien1106/reframed/mixin/particles/MixinEntity.java similarity index 81% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinEntity.java rename to src/main/java/fr/adrien1106/reframed/mixin/particles/MixinEntity.java index 5b20f03..8e7e6ac 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinEntity.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/particles/MixinEntity.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.mixin.particles; +package fr.adrien1106.reframed.mixin.particles; -import fr.adrien1106.reframedtemplates.api.ThemeableBlockEntity; +import fr.adrien1106.reframed.util.ThemeableBlockEntity; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.util.math.BlockPos; @@ -18,7 +18,7 @@ public abstract class MixinEntity { method = "spawnSprintingParticles", at = @At(value = "INVOKE", target = "Lnet/minecraft/particle/BlockStateParticleEffect;(Lnet/minecraft/particle/ParticleType;Lnet/minecraft/block/BlockState;)V") ) - private BlockState templates$spawnSprintingParticles$modifyParticleState(BlockState origState) { + private BlockState modifyParticleState(BlockState origState) { World world = ((Entity) (Object) this).getWorld(); if(world.getBlockEntity(getLandingPos()) instanceof ThemeableBlockEntity themeable) { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinLivingEntity.java b/src/main/java/fr/adrien1106/reframed/mixin/particles/MixinLivingEntity.java similarity index 79% rename from src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinLivingEntity.java rename to src/main/java/fr/adrien1106/reframed/mixin/particles/MixinLivingEntity.java index d6b0e9d..ec86a44 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/MixinLivingEntity.java +++ b/src/main/java/fr/adrien1106/reframed/mixin/particles/MixinLivingEntity.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.mixin.particles; +package fr.adrien1106.reframed.mixin.particles; -import fr.adrien1106.reframedtemplates.api.ThemeableBlockEntity; +import fr.adrien1106.reframed.util.ThemeableBlockEntity; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; @@ -18,7 +18,7 @@ public class MixinLivingEntity { @Unique private BlockPos lastFallCheckPos; @Inject(method = "fall", at = @At("HEAD")) - private void templates$onFall(double d, boolean bl, BlockState blockState, BlockPos blockPos, CallbackInfo ci) { + private void onFall(double d, boolean bl, BlockState blockState, BlockPos blockPos, CallbackInfo ci) { lastFallCheckPos = blockPos; } @@ -26,7 +26,7 @@ public class MixinLivingEntity { method = "fall", at = @At(value = "INVOKE", target = "Lnet/minecraft/particle/BlockStateParticleEffect;(Lnet/minecraft/particle/ParticleType;Lnet/minecraft/block/BlockState;)V") ) - private BlockState templates$fall$modifyParticleState(BlockState origState) { + private BlockState modifyParticleState(BlockState origState) { World world = ((Entity) (Object) this).getWorld(); if(lastFallCheckPos != null && world.getBlockEntity(lastFallCheckPos) instanceof ThemeableBlockEntity themeable) { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/api/TemplateInteractionUtil.java b/src/main/java/fr/adrien1106/reframed/util/ReFramedInteractionUtil.java similarity index 82% rename from src/main/java/fr/adrien1106/reframedtemplates/api/TemplateInteractionUtil.java rename to src/main/java/fr/adrien1106/reframed/util/ReFramedInteractionUtil.java index 1b4ad5f..14d3f9a 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/api/TemplateInteractionUtil.java +++ b/src/main/java/fr/adrien1106/reframed/util/ReFramedInteractionUtil.java @@ -1,6 +1,6 @@ -package fr.adrien1106.reframedtemplates.api; +package fr.adrien1106.reframed.util; -import fr.adrien1106.reframedtemplates.block.FramedEntity; +import fr.adrien1106.reframed.block.ReFramedEntity; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockEntityProvider; @@ -36,8 +36,8 @@ import org.jetbrains.annotations.Nullable; //For an example of how to use this class, have a look at TemplateBlock. //Basically there are several methods that would like to modify the return value of something. -public class TemplateInteractionUtil { - public static final BooleanProperty LIGHT = BooleanProperty.of("templates_light"); +public class ReFramedInteractionUtil { + public static final BooleanProperty LIGHT = BooleanProperty.of("frame_light"); public static StateManager.Builder appendProperties(StateManager.Builder builder) { return builder.add(LIGHT); @@ -47,7 +47,7 @@ public class TemplateInteractionUtil { //(To complete the look, don't forget to tag your blocks with mineable/axe.) private static final AbstractBlock.ContextPredicate NOPE = (blah, blahdey, blahh) -> false; public static AbstractBlock.Settings configureSettings(AbstractBlock.Settings s) { - return s.luminance(TemplateInteractionUtil::luminance).nonOpaque().sounds(BlockSoundGroup.WOOD).hardness(0.2f).suffocates(NOPE).blockVision(NOPE); + return s.luminance(ReFramedInteractionUtil::luminance).nonOpaque().sounds(BlockSoundGroup.WOOD).hardness(0.2f).suffocates(NOPE).blockVision(NOPE); } //And if you don't have a Block.Settings to copy off of. @@ -61,15 +61,15 @@ public class TemplateInteractionUtil { } public static @Nullable BlockState modifyPlacementState(@Nullable BlockState in, ItemPlacementContext ctx) { - return FramedEntity.weirdNbtLightLevelStuff(in, ctx.getStack()); + return ReFramedEntity.weirdNbtLightLevelStuff(in, ctx.getStack()); } public static ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - if(!(world.getBlockEntity(pos) instanceof FramedEntity be)) return ActionResult.PASS; + if(!(world.getBlockEntity(pos) instanceof ReFramedEntity be)) return ActionResult.PASS; if(!player.canModifyBlocks() || !world.canPlayerModifyAt(player, pos)) return ActionResult.PASS; ItemStack held = player.getStackInHand(hand); - TemplateInteractionUtilExt ext = state.getBlock() instanceof TemplateInteractionUtilExt e ? e : TemplateInteractionUtilExt.Default.INSTANCE; + ReframedInteractible ext = state.getBlock() instanceof ReframedInteractible e ? e : ReframedInteractible.Default.INSTANCE; //Glowstone if(state.contains(LIGHT) && held.getItem() == Items.GLOWSTONE_DUST && !state.get(LIGHT) && !be.hasSpentGlowstoneDust()) { @@ -85,7 +85,7 @@ public class TemplateInteractionUtil { if(held.getItem() == Blocks.REDSTONE_TORCH.asItem() && !be.emitsRedstone() && !be.hasSpentRedstoneTorch() && - ext.templatesPlayerCanAddRedstoneEmission(state, world, pos) + ext.canAddRedstoneEmission(state, world, pos) ) { be.setEmitsRedstone(true); be.spentRedstoneTorch(); @@ -99,7 +99,7 @@ public class TemplateInteractionUtil { if(held.getItem() == Items.POPPED_CHORUS_FRUIT && be.isSolid() && !be.hasSpentPoppedChorus() && - ext.templatesPlayerCanRemoveCollision(state, world, pos) + ext.canRemoveCollision(state, world, pos) ) { be.setSolidity(false); be.spentPoppedChorus(); @@ -132,18 +132,18 @@ public class TemplateInteractionUtil { //Maybe an odd spot to put this logic but it's consistent w/ vanilla chests, barrels, etc public static void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { if(!state.isOf(newState.getBlock()) && - world.getBlockEntity(pos) instanceof FramedEntity template && + world.getBlockEntity(pos) instanceof ReFramedEntity frame && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS) ) { DefaultedList drops = DefaultedList.of(); //TODO: remember the specific ItemStack - Block theme = template.getThemeState().getBlock(); + Block theme = frame.getThemeState().getBlock(); if(theme != Blocks.AIR) drops.add(new ItemStack(theme)); - if(template.hasSpentRedstoneTorch()) drops.add(new ItemStack(Items.REDSTONE_TORCH)); - if(template.hasSpentGlowstoneDust()) drops.add(new ItemStack(Items.GLOWSTONE_DUST)); - if(template.hasSpentPoppedChorus()) drops.add(new ItemStack(Items.POPPED_CHORUS_FRUIT)); + if(frame.hasSpentRedstoneTorch()) drops.add(new ItemStack(Items.REDSTONE_TORCH)); + if(frame.hasSpentGlowstoneDust()) drops.add(new ItemStack(Items.GLOWSTONE_DUST)); + if(frame.hasSpentPoppedChorus()) drops.add(new ItemStack(Items.POPPED_CHORUS_FRUIT)); ItemScatterer.spawn(world, pos, drops); } @@ -152,7 +152,7 @@ public class TemplateInteractionUtil { public static void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { //Load the BlockEntityTag clientside, which fixes the template briefly showing its default state when placing it. //I'm surprised this doesn't happen by default; the BlockEntityTag stuff is only done serverside. - if(world.isClient && world.getBlockEntity(pos) instanceof FramedEntity be) { + if(world.isClient && world.getBlockEntity(pos) instanceof ReFramedEntity be) { NbtCompound tag = BlockItem.getBlockEntityNbt(stack); if(tag != null) be.readNbt(tag); } @@ -160,7 +160,7 @@ public class TemplateInteractionUtil { //Returns "null" to signal "no opinion". Imagine it like an InteractionResult.PASS. public static @Nullable VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) { - return view.getBlockEntity(pos) instanceof FramedEntity be && !be.isSolid() ? VoxelShapes.empty() : null; + return view.getBlockEntity(pos) instanceof ReFramedEntity be && !be.isSolid() ? VoxelShapes.empty() : null; } public static boolean emitsRedstonePower(BlockState state) { @@ -169,11 +169,11 @@ public class TemplateInteractionUtil { } public static int getWeakRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return view.getBlockEntity(pos) instanceof FramedEntity be && be.emitsRedstone() ? 15 : 0; + return view.getBlockEntity(pos) instanceof ReFramedEntity be && be.emitsRedstone() ? 15 : 0; } public static int getStrongRedstonePower(BlockState state, BlockView view, BlockPos pos, Direction dir) { - return view.getBlockEntity(pos) instanceof FramedEntity be && be.emitsRedstone() ? 15 : 0; + return view.getBlockEntity(pos) instanceof ReFramedEntity be && be.emitsRedstone() ? 15 : 0; } public static int luminance(BlockState state) { diff --git a/src/main/java/fr/adrien1106/reframedtemplates/api/TemplateInteractionUtilExt.java b/src/main/java/fr/adrien1106/reframed/util/ReframedInteractible.java similarity index 50% rename from src/main/java/fr/adrien1106/reframedtemplates/api/TemplateInteractionUtilExt.java rename to src/main/java/fr/adrien1106/reframed/util/ReframedInteractible.java index f2b5cca..13a7e72 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/api/TemplateInteractionUtilExt.java +++ b/src/main/java/fr/adrien1106/reframed/util/ReframedInteractible.java @@ -1,20 +1,20 @@ -package fr.adrien1106.reframedtemplates.api; +package fr.adrien1106.reframed.util; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -public interface TemplateInteractionUtilExt { - default boolean templatesPlayerCanAddRedstoneEmission(BlockState state, BlockView view, BlockPos pos) { +public interface ReframedInteractible { + default boolean canAddRedstoneEmission(BlockState state, BlockView view, BlockPos pos) { return state.getWeakRedstonePower(view, pos, Direction.UP) == 0; } - default boolean templatesPlayerCanRemoveCollision(BlockState state, BlockView view, BlockPos pos) { + default boolean canRemoveCollision(BlockState state, BlockView view, BlockPos pos) { return !state.getCollisionShape(view, pos).isEmpty(); } - class Default implements TemplateInteractionUtilExt { + class Default implements ReframedInteractible { public static final Default INSTANCE = new Default(); } } diff --git a/src/main/java/fr/adrien1106/reframedtemplates/api/ThemeableBlockEntity.java b/src/main/java/fr/adrien1106/reframed/util/ThemeableBlockEntity.java similarity index 86% rename from src/main/java/fr/adrien1106/reframedtemplates/api/ThemeableBlockEntity.java rename to src/main/java/fr/adrien1106/reframed/util/ThemeableBlockEntity.java index eb788d5..92e76e1 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/api/ThemeableBlockEntity.java +++ b/src/main/java/fr/adrien1106/reframed/util/ThemeableBlockEntity.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.api; +package fr.adrien1106.reframed.util; import net.fabricmc.fabric.api.rendering.data.v1.RenderAttachmentBlockEntity; import net.minecraft.block.BlockState; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/util/VoxelHelper.java b/src/main/java/fr/adrien1106/reframed/util/VoxelHelper.java similarity index 98% rename from src/main/java/fr/adrien1106/reframedtemplates/util/VoxelHelper.java rename to src/main/java/fr/adrien1106/reframed/util/VoxelHelper.java index 123be5f..885e552 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/util/VoxelHelper.java +++ b/src/main/java/fr/adrien1106/reframed/util/VoxelHelper.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.util; +package fr.adrien1106.reframed.util; import net.minecraft.util.function.BooleanBiFunction; import net.minecraft.util.math.Direction; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/util/property/StairDirection.java b/src/main/java/fr/adrien1106/reframed/util/property/StairDirection.java similarity index 98% rename from src/main/java/fr/adrien1106/reframedtemplates/util/property/StairDirection.java rename to src/main/java/fr/adrien1106/reframed/util/property/StairDirection.java index dc456c9..35c05a0 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/util/property/StairDirection.java +++ b/src/main/java/fr/adrien1106/reframed/util/property/StairDirection.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.util.property; +package fr.adrien1106.reframed.util.property; import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.Direction; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/util/property/StairShape.java b/src/main/java/fr/adrien1106/reframed/util/property/StairShape.java similarity index 95% rename from src/main/java/fr/adrien1106/reframedtemplates/util/property/StairShape.java rename to src/main/java/fr/adrien1106/reframed/util/property/StairShape.java index a7327aa..eef0c51 100644 --- a/src/main/java/fr/adrien1106/reframedtemplates/util/property/StairShape.java +++ b/src/main/java/fr/adrien1106/reframed/util/property/StairShape.java @@ -1,4 +1,4 @@ -package fr.adrien1106.reframedtemplates.util.property; +package fr.adrien1106.reframed.util.property; import net.minecraft.util.StringIdentifiable; diff --git a/src/main/java/fr/adrien1106/reframedtemplates/Templates.java b/src/main/java/fr/adrien1106/reframedtemplates/Templates.java deleted file mode 100644 index 3263956..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/Templates.java +++ /dev/null @@ -1,95 +0,0 @@ -package fr.adrien1106.reframedtemplates; - -import fr.adrien1106.reframedtemplates.api.TemplateInteractionUtil; -import fr.adrien1106.reframedtemplates.block.*; -import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; -import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; -import net.minecraft.block.AbstractBlock; -import net.minecraft.block.Block; -import net.minecraft.block.BlockSetType; -import net.minecraft.block.Blocks; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.jetbrains.annotations.ApiStatus; - -import java.util.ArrayList; -import java.util.function.BiConsumer; -import java.util.stream.Collectors; - -/** - * TODO handle random textures rotation and mirroring wip, handle grass side, multiple camos - */ -public class Templates implements ModInitializer { - public static final String MODID = "reframedtemplates"; - - protected static final ArrayList INTERNAL_TEMPLATES = new ArrayList<>(); - public static Block CUBE, STAIRS, SLAB, POST, FENCE, FENCE_GATE, DOOR, TRAPDOOR, IRON_DOOR, IRON_TRAPDOOR, PRESSURE_PLATE, BUTTON, LEVER, WALL, CARPET, PANE, CANDLE; - - public static BlockEntityType TEMPLATE_BLOCK_ENTITY; - - public static BiConsumer chunkRerenderProxy = (world, pos) -> {}; - - @Override - public void onInitialize() { - //registerTemplate mutates MY_TEMPLATES as a side effect, which is a List, so order is preserved - //the ordering is used in the creative tab, so they're roughly sorted by encounter order of the - //corresponding vanilla block in the "search" creative tab... with the non-vanilla "post" and - //"vertical slab" inserted where they fit ...and i moved the lever way up next to the pressureplate - //and button, because they're redstoney... hopefully this ordering makes sense lol - CUBE = registerTemplate("cube" , new TemplateBlock(TemplateInteractionUtil.makeSettings())); - STAIRS = registerTemplate("stairs" , new TemplateStairsBlock(cp(Blocks.OAK_STAIRS))); - SLAB = registerTemplate("slab" , new TemplateSlabBlock(cp(Blocks.OAK_SLAB))); - POST = registerTemplate("post" , new TemplatePostBlock(cp(Blocks.OAK_FENCE))); - FENCE = registerTemplate("fence" , new TemplateFenceBlock(cp(Blocks.OAK_FENCE))); - FENCE_GATE = registerTemplate("fence_gate" , new TemplateFenceGateBlock(cp(Blocks.OAK_FENCE_GATE))); - DOOR = registerTemplate("door" , new TemplateDoorBlock(cp(Blocks.OAK_DOOR), BlockSetType.OAK)); - TRAPDOOR = registerTemplate("trapdoor" , new TemplateTrapdoorBlock(cp(Blocks.OAK_TRAPDOOR), BlockSetType.OAK)); - IRON_DOOR = registerTemplate("iron_door" , new TemplateDoorBlock(cp(Blocks.IRON_DOOR), BlockSetType.IRON)); - IRON_TRAPDOOR = registerTemplate("iron_trapdoor" , new TemplateTrapdoorBlock(cp(Blocks.IRON_TRAPDOOR), BlockSetType.IRON)); - PRESSURE_PLATE = registerTemplate("pressure_plate", new TemplatePressurePlateBlock(cp(Blocks.OAK_PRESSURE_PLATE))); - BUTTON = registerTemplate("button" , new TemplateButtonBlock(cp(Blocks.OAK_BUTTON))); - LEVER = registerTemplate("lever" , new TemplateLeverBlock(cp(Blocks.LEVER))); - WALL = registerTemplate("wall" , new TemplateWallBlock(TemplateInteractionUtil.makeSettings())); - CARPET = registerTemplate("carpet" , new TemplateCarpetBlock(cp(Blocks.WHITE_CARPET))); - PANE = registerTemplate("pane" , new TemplatePaneBlock(cp(Blocks.GLASS_PANE))); - CANDLE = registerTemplate("candle" , new TemplateCandleBlock(TemplateCandleBlock.configureSettings(cp(Blocks.CANDLE)))); - - //The block entity is still called templates:slope; this is a bit of a legacy mistake. - TEMPLATE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, id("slope"), - FabricBlockEntityTypeBuilder.create((pos, state) -> new FramedEntity(TEMPLATE_BLOCK_ENTITY, pos, state), INTERNAL_TEMPLATES.toArray(new Block[0])).build(null) - ); - - Registry.register(Registries.ITEM_GROUP, id("tab"), FabricItemGroup.builder() - .displayName(Text.translatable("itemGroup.reframedtemplates.tab")) - .icon(() -> new ItemStack(SLAB)) - .entries((ctx, e) -> e.addAll(INTERNAL_TEMPLATES.stream().map(ItemStack::new).collect(Collectors.toList()))).build() - ); - } - - private static AbstractBlock.Settings cp(Block base) { - return TemplateInteractionUtil.configureSettings(AbstractBlock.Settings.copy(base)); - } - - private static B registerTemplate(String path, B block) { - Identifier id = id(path); - - Registry.register(Registries.BLOCK, id, block); - Registry.register(Registries.ITEM, id, new BlockItem(block, new Item.Settings())); - INTERNAL_TEMPLATES.add(block); - return block; - } - - @ApiStatus.Internal - public static Identifier id(String path) { - return new Identifier(MODID, path); - } -} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java b/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java deleted file mode 100644 index 669edab..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClient.java +++ /dev/null @@ -1,123 +0,0 @@ -package fr.adrien1106.reframedtemplates; - -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; -import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; -import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; -import net.fabricmc.fabric.api.resource.ResourceManagerHelper; -import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener; -import net.minecraft.block.Block; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.resource.ResourceManager; -import net.minecraft.resource.ResourceType; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.ChunkSectionPos; -import org.jetbrains.annotations.ApiStatus; - -public class TemplatesClient implements ClientModInitializer { - @ApiStatus.Internal //2.2 - Please use the new TemplatesClientApi.getInstance() method. - public static final TemplatesModelProvider provider = new TemplatesModelProvider(); - - @ApiStatus.Internal //Please use TemplatesClientApi.getInstance() instead. - public static final TemplatesClientApiImpl API_IMPL = new TemplatesClientApiImpl(provider); - - @Override - public void onInitializeClient() { - privateInit(); //<- Stuff you shouldn't replicate in any addon mods ;) - - //all templates mustn't be on the SOLID layer because they are not opaque! - BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Templates.INTERNAL_TEMPLATES.toArray(new Block[0])); - - //now, assign special item models - TemplatesClientApi api = TemplatesClientApi.getInstance(); - - api.addTemplateModel(Templates.id("button_special") , api.auto(new Identifier("block/button"))); - api.addTemplateModel(Templates.id("button_pressed_special") , api.auto(new Identifier("block/button_pressed"))); - api.addTemplateModel(Templates.id("one_candle_special") , api.auto(new Identifier("block/template_candle"))); - api.addTemplateModel(Templates.id("two_candles_special") , api.auto(new Identifier("block/template_two_candles"))); - api.addTemplateModel(Templates.id("three_candles_special") , api.auto(new Identifier("block/template_three_candles"))); - api.addTemplateModel(Templates.id("four_candles_special") , api.auto(new Identifier("block/template_four_candles"))); - api.addTemplateModel(Templates.id("carpet_special") , api.auto(new Identifier("block/carpet"))); - api.addTemplateModel(Templates.id("cube_special") , api.auto(new Identifier("block/cube"))); - api.addTemplateModel(Templates.id("door_bottom_left_special") , api.auto(new Identifier("block/door_bottom_left"))); - api.addTemplateModel(Templates.id("door_bottom_right_special") , api.auto(new Identifier("block/door_bottom_right"))); - api.addTemplateModel(Templates.id("door_top_left_special") , api.auto(new Identifier("block/door_top_left"))); - api.addTemplateModel(Templates.id("door_top_right_special") , api.auto(new Identifier("block/door_top_right"))); - api.addTemplateModel(Templates.id("door_bottom_left_open_special"), api.auto(new Identifier("block/door_bottom_left_open"))); - api.addTemplateModel(Templates.id("door_bottom_right_open_special"), api.auto(new Identifier("block/door_bottom_right_open"))); //This is why we dont format code as tables kids - api.addTemplateModel(Templates.id("door_top_left_open_special") , api.auto(new Identifier("block/door_top_left_open"))); - api.addTemplateModel(Templates.id("door_top_right_open_special") , api.auto(new Identifier("block/door_top_right_open"))); - api.addTemplateModel(Templates.id("fence_post_special") , api.auto(new Identifier("block/fence_post"))); - api.addTemplateModel(Templates.id("fence_gate_special") , api.auto(new Identifier("block/template_fence_gate"))); - api.addTemplateModel(Templates.id("fence_gate_open_special") , api.auto(new Identifier("block/template_fence_gate_open"))); - api.addTemplateModel(Templates.id("fence_gate_wall_special") , api.auto(new Identifier("block/template_fence_gate_wall"))); - api.addTemplateModel(Templates.id("fence_gate_wall_open_special") , api.auto(new Identifier("block/template_fence_gate_wall_open"))); - api.addTemplateModel(Templates.id("glass_pane_post_special") , api.auto(new Identifier("block/glass_pane_post"))); - api.addTemplateModel(Templates.id("glass_pane_noside_special") , api.auto(new Identifier("block/glass_pane_noside"))); - api.addTemplateModel(Templates.id("glass_pane_noside_alt_special"), api.auto(new Identifier("block/glass_pane_noside_alt"))); - api.addTemplateModel(Templates.id("pressure_plate_up_special") , api.auto(new Identifier("block/pressure_plate_up"))); - api.addTemplateModel(Templates.id("pressure_plate_down_special") , api.auto(new Identifier("block/pressure_plate_down"))); - api.addTemplateModel(Templates.id("slab_special") , api.auto(new Identifier("block/slab"))); - api.addTemplateModel(Templates.id("stairs_special") , api.auto(new Identifier("block/stairs"))); - api.addTemplateModel(Templates.id("double_outer_stairs_special") , api.auto(Templates.id("block/double_outer_stairs"))); - api.addTemplateModel(Templates.id("inner_stairs_special") , api.auto(new Identifier("block/inner_stairs"))); - api.addTemplateModel(Templates.id("outer_stairs_special") , api.auto(new Identifier("block/outer_stairs"))); - api.addTemplateModel(Templates.id("trapdoor_bottom_special") , api.auto(new Identifier("block/template_trapdoor_bottom"))); - api.addTemplateModel(Templates.id("trapdoor_top_special") , api.auto(new Identifier("block/template_trapdoor_top"))); - api.addTemplateModel(Templates.id("wall_post_special") , api.auto(new Identifier("block/template_wall_post"))); - - //vanilla style models (using "special-sprite replacement" method) - api.addTemplateModel(Templates.id("lever_special") , api.json(Templates.id("block/lever"))); - api.addTemplateModel(Templates.id("trapdoor_open_special") , api.json(Templates.id("block/trapdoor_open"))); - api.addTemplateModel(Templates.id("lever_on_special") , api.json(Templates.id("block/lever_on"))); - //these next five only exist because AutoRetexturedModels don't seem to rotate their textures the right way when rotated from a multipart blockstate - api.addTemplateModel(Templates.id("fence_side_special") , api.json(Templates.id("block/fence_side"))); - api.addTemplateModel(Templates.id("glass_pane_side_special") , api.json(Templates.id("block/glass_pane_side"))); - api.addTemplateModel(Templates.id("glass_pane_side_alt_special") , api.json(Templates.id("block/glass_pane_side_alt"))); - api.addTemplateModel(Templates.id("wall_side_special") , api.json(Templates.id("block/wall_side"))); - api.addTemplateModel(Templates.id("wall_side_tall_special") , api.json(Templates.id("block/wall_side_tall"))); - - //item only models - api.addTemplateModel(Templates.id("button_inventory_special") , api.auto(new Identifier("block/button_inventory"))); - api.addTemplateModel(Templates.id("fence_inventory_special") , api.auto(new Identifier("block/fence_inventory"))); - api.addTemplateModel(Templates.id("fence_post_inventory_special") , api.auto(Templates.id("block/fence_post_inventory"))); - api.addTemplateModel(Templates.id("wall_inventory_special") , api.auto(new Identifier("block/wall_inventory"))); - - //item model assignments (in lieu of models/item/___.json) - api.assignItemModel(Templates.id("button_inventory_special") , Templates.BUTTON); - api.assignItemModel(Templates.id("carpet_special") , Templates.CARPET); - api.assignItemModel(Templates.id("cube_special") , Templates.CUBE); - api.assignItemModel(Templates.id("fence_inventory_special") , Templates.FENCE); - api.assignItemModel(Templates.id("fence_gate_special") , Templates.FENCE_GATE); - api.assignItemModel(Templates.id("trapdoor_bottom_special") , Templates.IRON_TRAPDOOR); - api.assignItemModel(Templates.id("fence_post_inventory_special") , Templates.POST); - api.assignItemModel(Templates.id("pressure_plate_up_special") , Templates.PRESSURE_PLATE); - api.assignItemModel(Templates.id("slab_special") , Templates.SLAB); - api.assignItemModel(Templates.id("stairs_special") , Templates.STAIRS); - api.assignItemModel(Templates.id("trapdoor_bottom_special") , Templates.TRAPDOOR); - api.assignItemModel(Templates.id("wall_inventory_special") , Templates.WALL); - } - - private void privateInit() { - //set up some magic to force chunk rerenders when you change a template (see TemplateEntity) - Templates.chunkRerenderProxy = (world, pos) -> { - if(world == MinecraftClient.getInstance().world) { - MinecraftClient.getInstance().worldRenderer.scheduleBlockRender( - ChunkSectionPos.getSectionCoord(pos.getX()), - ChunkSectionPos.getSectionCoord(pos.getY()), - ChunkSectionPos.getSectionCoord(pos.getZ()) - ); - } - }; - - //supporting code for the TemplatesModelProvider - ModelLoadingRegistry.INSTANCE.registerResourceProvider(rm -> provider); //block models - ModelLoadingRegistry.INSTANCE.registerVariantProvider(rm -> provider); //item models - - ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() { - @Override public Identifier getFabricId() { return Templates.id("dump-caches"); } - @Override public void reload(ResourceManager blah) { provider.dumpCache(); } - }); - } -} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClientApiImpl.java b/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClientApiImpl.java deleted file mode 100644 index e2b2cdb..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/TemplatesClientApiImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -package fr.adrien1106.reframedtemplates; - -import fr.adrien1106.reframedtemplates.api.TemplatesClientApi; -import fr.adrien1106.reframedtemplates.model.apperance.TemplateAppearanceManager; -import fr.adrien1106.reframedtemplates.model.UnbakedAutoRetexturedModel; -import fr.adrien1106.reframedtemplates.model.UnbakedJsonRetexturedModel; -import fr.adrien1106.reframedtemplates.model.UnbakedMeshRetexturedModel; -import net.fabricmc.fabric.api.renderer.v1.Renderer; -import net.fabricmc.fabric.api.renderer.v1.RendererAccess; -import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.client.render.model.UnbakedModel; -import net.minecraft.client.texture.Sprite; -import net.minecraft.client.util.ModelIdentifier; -import net.minecraft.client.util.SpriteIdentifier; -import net.minecraft.item.ItemConvertible; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.NotNull; - -import java.util.function.Function; - -public class TemplatesClientApiImpl implements TemplatesClientApi { - public TemplatesClientApiImpl(TemplatesModelProvider prov) { - this.prov = prov; - } - - private final TemplatesModelProvider prov; - - @Override - public TweakableUnbakedModel auto(Identifier parent) { - return new UnbakedAutoRetexturedModel(parent); - } - - @Override - public TweakableUnbakedModel json(Identifier parent) { - return new UnbakedJsonRetexturedModel(parent); - } - - @Override - public TweakableUnbakedModel mesh(Identifier parent, Function, Mesh> baseMeshFactory) { - return new UnbakedMeshRetexturedModel(parent, baseMeshFactory); - } - - @Override - public void addTemplateModel(Identifier id, UnbakedModel unbaked) { - prov.addTemplateModel(id, unbaked); - } - - @Override - public void assignItemModel(Identifier templateModelId, ModelIdentifier... modelIds) { - prov.assignItemModel(templateModelId, modelIds); - } - - @Override - public void assignItemModel(Identifier templateModelId, Identifier... itemIds) { - prov.assignItemModel(templateModelId, itemIds); - } - - @Override - public void assignItemModel(Identifier templateModelId, ItemConvertible... itemConvs) { - prov.assignItemModel(templateModelId, itemConvs); - } - - @Override - public TemplateAppearanceManager getOrCreateTemplateApperanceManager(Function spriteLookup) { - return prov.getOrCreateTemplateApperanceManager(spriteLookup); - } - - @Override - public @NotNull Renderer getFabricRenderer() { - Renderer obj = RendererAccess.INSTANCE.getRenderer(); - if(obj != null) return obj; - - //Welp, not much more we can do, this mod heavily relies on frapi - String msg = "A Fabric Rendering API implementation is required to use Templates 2!"; - - if(!FabricLoader.getInstance().isModLoaded("fabric-renderer-indigo")) - msg += "\nI noticed you don't have Indigo installed, which is a part of the complete Fabric API package."; - if(FabricLoader.getInstance().isModLoaded("sodium")) - msg += "\nI noticed you have Sodium installed - consider also installing Indium to provide a compatible renderer implementation."; - - throw new NullPointerException(msg); - } -} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/api/TemplatesClientApi.java b/src/main/java/fr/adrien1106/reframedtemplates/api/TemplatesClientApi.java deleted file mode 100644 index f3c12c1..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/api/TemplatesClientApi.java +++ /dev/null @@ -1,116 +0,0 @@ -package fr.adrien1106.reframedtemplates.api; - -import fr.adrien1106.reframedtemplates.model.apperance.TemplateAppearanceManager; -import fr.adrien1106.reframedtemplates.TemplatesClient; -import net.fabricmc.fabric.api.renderer.v1.Renderer; -import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; -import net.minecraft.block.BlockState; -import net.minecraft.client.render.model.UnbakedModel; -import net.minecraft.client.texture.Sprite; -import net.minecraft.client.util.ModelIdentifier; -import net.minecraft.client.util.SpriteIdentifier; -import net.minecraft.item.ItemConvertible; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; - -import java.util.function.Function; -import java.util.function.Supplier; - -@ApiStatus.AvailableSince("2.2") -@SuppressWarnings({"unused", "UnusedReturnValue"}) //this is all public api -public interface TemplatesClientApi { - /** - * Obtain the current API instance. - */ - static TemplatesClientApi getInstance() { - return TemplatesClient.API_IMPL; - } - - /// CONSTRUCTING UNBAKED MODELS /// - - /** - * - the quad: Sourced from the ID you pass in. It can be a json model. - * - whether you want to retexture it: "Yes". All quads will be retextured. - * - what face of the block: Automatically determined by facing direction. - */ - TweakableUnbakedModel auto(Identifier parent); - - /** - * - the quad: Sourced from the ID you pass in. It can be a json model. - * - whether you want to retexture it: Determined from the texture applied to the quad. - * - what face of the block: Determined via the texture applied to the quad. - */ - TweakableUnbakedModel json(Identifier parent); - - /** - * - the quad: Sourced from a `Mesh`. - * - whether you want to retexture it: Quads with a nonzero `tag`. - * - what face of the block: Determined from the `tag`. - *

- * This form doesn't give the ability to look up sprites, so it's hard to make a sensible quad that won't be retextured. - */ - default TweakableUnbakedModel mesh(Identifier parent, Supplier baseMeshFactory) { - return mesh(parent, __ -> baseMeshFactory.get()); - } - - /** - * - the quad: Sourced from a `Mesh`. - * - whether you want to retexture it: Quads with a nonzero `tag`. - * - what face of the block: Determined from the `tag`. - *

- * You can use the provided Function to look up sprite UVs and put them on faces with a 0 tag. - * These faces will not get retextured. - */ - TweakableUnbakedModel mesh(Identifier parent, Function, Mesh> baseMeshFactory); - - /** - * Get the TemplateAppearanceManager instance. To retexture a template, there has to be some way of determining what texture should - * go on the top, what texture should go on the north side, and the TemplateAppearanceManager is in charge of gleaning this information - * from the target blockmodels. It also caches this information. - *

- * There is one TemplateApperanceManager per resource-load. Please obtain a new one every model bake. - * - * @param spriteLookup Something you'll find as part of UnbakedModel#bake. - */ - TemplateAppearanceManager getOrCreateTemplateApperanceManager(Function spriteLookup); - - /// REGISTERING UNBAKED MODELS /// - - /** - * Register an UnbakedModel to be loaded behind a particular ID. - * Astute viewers will note that this is, *currently*, a thin wrapper around the fabric ModelResourceProvider system. - */ - void addTemplateModel(Identifier id, UnbakedModel unbaked); - - /** - * When the game loads this ModelIdentifier, it will instead load the UnbakedModel corresponding to the id passed to addTemplateModel. - * Astute viewers will note that this is, *currently*, a thin wrapper around the fabric ModelVariantProvider system. - */ - void assignItemModel(Identifier templateModelId, ModelIdentifier... modelIds); - - /** - * Calls assignItemModel(Identifier, ModelIdentifier) with "#inventory" appended. - * In practice: you can pass an item's ID. - */ - void assignItemModel(Identifier templateModelId, Identifier... itemIds); - - /** - * Calls assignItemModel(Identifier, Identifier) by first converting the argument to an item, then taking its ID. - * In practice: you can pass a Block (or Item), and the model will be assigned to the block's item form. - */ - void assignItemModel(Identifier templateModelId, ItemConvertible... itemConvs); - - /// OTHER STUFF LOL /// - - /** - * Simple wrapper around fabric's RenderAccess.INSTANCE.getRenderer() that throws a slightly more informative error if one is not - * present. Note that NullPointerException is not a checked exception. - */ - @NotNull Renderer getFabricRenderer() throws NullPointerException; - - interface TweakableUnbakedModel extends UnbakedModel { - TweakableUnbakedModel disableAo(); - TweakableUnbakedModel itemModelState(BlockState state); - } -} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/AccessorParticle.java b/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/AccessorParticle.java deleted file mode 100644 index 9a25f25..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/mixin/particles/AccessorParticle.java +++ /dev/null @@ -1,15 +0,0 @@ -package fr.adrien1106.reframedtemplates.mixin.particles; - -import net.minecraft.client.particle.Particle; -import net.minecraft.util.math.random.Random; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(Particle.class) -public interface AccessorParticle { - @Accessor("random") Random templates$getRandom(); - - @Accessor("red") void templates$setRed(float red); - @Accessor("green") void templates$setGreen(float green); - @Accessor("blue") void templates$setBlue(float blue); -} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/util/Edge.java b/src/main/java/fr/adrien1106/reframedtemplates/util/Edge.java deleted file mode 100644 index 071cea8..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/util/Edge.java +++ /dev/null @@ -1,89 +0,0 @@ -package fr.adrien1106.reframedtemplates.util; - -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.util.StringIdentifiable; -import net.minecraft.util.math.Direction; -import org.joml.Vector3d; - -import java.util.Locale; - -public enum Edge implements StringIdentifiable { - DOWN_NORTH, - DOWN_SOUTH, - UP_SOUTH, - UP_NORTH, - NORTH_WEST, - SOUTH_WEST, - SOUTH_EAST, - NORTH_EAST, - DOWN_WEST, - UP_WEST, - UP_EAST, - DOWN_EAST; - - public static Edge stairslikePlacement(ItemPlacementContext ctx) { - Direction playerHorizontalFacing = ctx.getHorizontalPlayerFacing(); - Direction clickedFace = ctx.getSide(); - boolean sneaky = ctx.getPlayer() != null && ctx.getPlayer().isSneaky(); - - double dx = ctx.getHitPos().x - ctx.getBlockPos().getX(); - double dy = ctx.getHitPos().y - ctx.getBlockPos().getY(); - double dz = ctx.getHitPos().z - ctx.getBlockPos().getZ(); - - if(clickedFace == Direction.UP || (!sneaky && dy <= 0.5)) return switch(playerHorizontalFacing) { - case NORTH -> DOWN_NORTH; - case EAST -> DOWN_EAST; - case SOUTH -> DOWN_SOUTH; - case WEST -> DOWN_WEST; - default -> throw new IllegalArgumentException(); - }; - - else if(clickedFace == Direction.DOWN || (!sneaky && dy >= 0.5)) return switch(playerHorizontalFacing) { - case NORTH -> UP_NORTH; - case EAST -> UP_EAST; - case SOUTH -> UP_SOUTH; - case WEST -> UP_WEST; - default -> throw new IllegalArgumentException(); - }; - - else return switch(playerHorizontalFacing) { - case NORTH -> dx < 0.5 ? Edge.NORTH_WEST : Edge.NORTH_EAST; - case EAST -> dz < 0.5 ? Edge.NORTH_EAST : Edge.SOUTH_EAST; - case SOUTH -> dx > 0.5 ? Edge.SOUTH_EAST : Edge.SOUTH_WEST; - case WEST -> dz > 0.5 ? Edge.SOUTH_WEST : Edge.NORTH_WEST; - default -> throw new IllegalArgumentException(); - }; - } - - //I may have skill issue - //Beep boop i am very maintainable yes - public record CoordinateFrame(Vector3d origin, Vector3d along, Vector3d a, Vector3d b) {} - private static final Vector3d ZR = new Vector3d(); - private static final Vector3d PX = new Vector3d(1, 0, 0); - private static final Vector3d NX = new Vector3d(-1, 0, 0); - private static final Vector3d PY = new Vector3d(0, 1, 0); - private static final Vector3d NY = new Vector3d(0, -1, 0); - private static final Vector3d PZ = new Vector3d(0, 0, 1); - private static final Vector3d NZ = new Vector3d(0, 0, -1); - public CoordinateFrame makeCoordinateFrame() { - return switch(this) { - case DOWN_NORTH -> new CoordinateFrame(ZR, PX, PZ, PY); - case DOWN_EAST -> new CoordinateFrame(PX, PZ, NX, PY); - case DOWN_SOUTH -> new CoordinateFrame(new Vector3d(1, 0, 1), NX, NZ, PY); - case DOWN_WEST -> new CoordinateFrame(PZ, NZ, PX, PY); - case UP_NORTH -> new CoordinateFrame(PY, PX, PZ, NY); - case UP_EAST -> new CoordinateFrame(new Vector3d(1, 1, 0), PZ, NX, NY); - case UP_SOUTH -> new CoordinateFrame(new Vector3d(1, 1, 1), NX, NZ, NY); - case UP_WEST -> new CoordinateFrame(new Vector3d(0, 1, 1), NZ, PX, NY); - case NORTH_WEST -> new CoordinateFrame(ZR, PY, PZ, PX); - case NORTH_EAST -> new CoordinateFrame(PX, PY, NX, PZ); - case SOUTH_EAST -> new CoordinateFrame(new Vector3d(1, 0, 1), PY, NZ, NX); - case SOUTH_WEST -> new CoordinateFrame(PZ, PY, PX, NZ); - }; - } - - @Override - public String asString() { - return name().toLowerCase(Locale.ROOT); - } -} diff --git a/src/main/java/fr/adrien1106/reframedtemplates/util/StairShapeMaker.java b/src/main/java/fr/adrien1106/reframedtemplates/util/StairShapeMaker.java deleted file mode 100644 index 1d4009d..0000000 --- a/src/main/java/fr/adrien1106/reframedtemplates/util/StairShapeMaker.java +++ /dev/null @@ -1,32 +0,0 @@ -package fr.adrien1106.reframedtemplates.util; - -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; -import org.joml.Vector3d; - -public class StairShapeMaker { - //TODO: clean this the fuck up, maybe keep in mind that VoxelShapes can be rotated multiples of 90 degrees by just rotating their corners - public static VoxelShape makeStair(Edge innerEdge, double stepIn, double initialStepRise, double stepRise, double stepRun, int stepCount) { - Edge.CoordinateFrame frame = innerEdge.makeCoordinateFrame(); - Vector3d origin = frame.origin(); - - Vector3d in = new Vector3d(frame.a()).mul(stepIn); - Vector3d fstRise = new Vector3d(frame.b()).mul(initialStepRise); - - Vector3d cursor = new Vector3d(origin).add(frame.along()).add(in).add(fstRise); - Vector3d step = new Vector3d(frame.b()).mul(stepRise).add(new Vector3d(frame.a()).mul(-stepRun)); - - VoxelShape shape = VoxelShapes.empty(); - for(int i = 0; i < stepCount; i++) { - shape = VoxelShapes.union(shape, box(origin.x, origin.y, origin.z, cursor.x, cursor.y, cursor.z)); - cursor.add(step); - } - - return shape.simplify(); - } - - //VoxelShape's constructor is picky about specifying your mins before your maxs - private static VoxelShape box(double x1, double y1, double z1, double x2, double y2, double z2) { - return VoxelShapes.cuboid(Math.min(x1, x2), Math.min(y1, y2), Math.min(z1, z2), Math.max(x1, x2), Math.max(y1, y2), Math.max(z1, z2)); - } -} diff --git a/src/main/resources/assets/minecraft/atlases/blocks.json b/src/main/resources/assets/minecraft/atlases/blocks.json index 84cad5f..7f14b7d 100644 --- a/src/main/resources/assets/minecraft/atlases/blocks.json +++ b/src/main/resources/assets/minecraft/atlases/blocks.json @@ -2,8 +2,8 @@ "sources": [ { "type": "directory", - "source": "templates_special", - "prefix": "templates_special/" + "source": "reframed_special", + "prefix": "reframed_special/" } ] } \ No newline at end of file diff --git a/src/main/resources/assets/framed-templates-icon.png b/src/main/resources/assets/reframed-icon.png similarity index 100% rename from src/main/resources/assets/framed-templates-icon.png rename to src/main/resources/assets/reframed-icon.png diff --git a/src/main/resources/assets/reframedtemplates/blockstates/button.json b/src/main/resources/assets/reframed/blockstates/button.json similarity index 58% rename from src/main/resources/assets/reframedtemplates/blockstates/button.json rename to src/main/resources/assets/reframed/blockstates/button.json index e460e2f..3d92350 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/button.json +++ b/src/main/resources/assets/reframed/blockstates/button.json @@ -1,115 +1,115 @@ { "variants": { "face=ceiling,facing=east,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "x": 180, "y": 270 }, "face=ceiling,facing=east,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "x": 180, "y": 270 }, "face=ceiling,facing=north,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "x": 180, "y": 180 }, "face=ceiling,facing=north,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "x": 180, "y": 180 }, "face=ceiling,facing=south,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "x": 180 }, "face=ceiling,facing=south,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "x": 180 }, "face=ceiling,facing=west,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "x": 180, "y": 90 }, "face=ceiling,facing=west,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "x": 180, "y": 90 }, "face=floor,facing=east,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "y": 90 }, "face=floor,facing=east,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "y": 90 }, "face=floor,facing=north,powered=false": { - "model": "reframedtemplates:button_special" + "model": "reframed:button_special" }, "face=floor,facing=north,powered=true": { - "model": "reframedtemplates:button_pressed_special" + "model": "reframed:button_pressed_special" }, "face=floor,facing=south,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "y": 180 }, "face=floor,facing=south,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "y": 180 }, "face=floor,facing=west,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "y": 270 }, "face=floor,facing=west,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "y": 270 }, "face=wall,facing=east,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "uvlock": true, "x": 90, "y": 90 }, "face=wall,facing=east,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "uvlock": true, "x": 90, "y": 90 }, "face=wall,facing=north,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "uvlock": true, "x": 90 }, "face=wall,facing=north,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "uvlock": true, "x": 90 }, "face=wall,facing=south,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "uvlock": true, "x": 90, "y": 180 }, "face=wall,facing=south,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "uvlock": true, "x": 90, "y": 180 }, "face=wall,facing=west,powered=false": { - "model": "reframedtemplates:button_special", + "model": "reframed:button_special", "uvlock": true, "x": 90, "y": 270 }, "face=wall,facing=west,powered=true": { - "model": "reframedtemplates:button_pressed_special", + "model": "reframed:button_pressed_special", "uvlock": true, "x": 90, "y": 270 diff --git a/src/main/resources/assets/reframed/blockstates/candle.json b/src/main/resources/assets/reframed/blockstates/candle.json new file mode 100644 index 0000000..2e43925 --- /dev/null +++ b/src/main/resources/assets/reframed/blockstates/candle.json @@ -0,0 +1,16 @@ +{ + "variants": { + "candles=1": { + "model": "reframed:one_candle_special" + }, + "candles=2": { + "model": "reframed:two_candles_special" + }, + "candles=3": { + "model": "reframed:three_candles_special" + }, + "candles=4": { + "model": "reframed:four_candles_special" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/reframed/blockstates/carpet.json b/src/main/resources/assets/reframed/blockstates/carpet.json new file mode 100644 index 0000000..c065759 --- /dev/null +++ b/src/main/resources/assets/reframed/blockstates/carpet.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "reframed:carpet_special" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/reframed/blockstates/cube.json b/src/main/resources/assets/reframed/blockstates/cube.json new file mode 100644 index 0000000..a82f101 --- /dev/null +++ b/src/main/resources/assets/reframed/blockstates/cube.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "reframed:cube_special" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/blockstates/door.json b/src/main/resources/assets/reframed/blockstates/door.json similarity index 52% rename from src/main/resources/assets/reframedtemplates/blockstates/door.json rename to src/main/resources/assets/reframed/blockstates/door.json index ca062aa..28f9903 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/door.json +++ b/src/main/resources/assets/reframed/blockstates/door.json @@ -1,123 +1,123 @@ { "variants": { "facing=east,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special" + "model": "reframed:door_bottom_left_special" }, "facing=east,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special", + "model": "reframed:door_bottom_left_open_special", "y": 90 }, "facing=east,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special" + "model": "reframed:door_bottom_right_special" }, "facing=east,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special", + "model": "reframed:door_bottom_right_open_special", "y": 270 }, "facing=east,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special" + "model": "reframed:door_top_left_special" }, "facing=east,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special", + "model": "reframed:door_top_left_open_special", "y": 90 }, "facing=east,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special" + "model": "reframed:door_top_right_special" }, "facing=east,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special", + "model": "reframed:door_top_right_open_special", "y": 270 }, "facing=north,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special", + "model": "reframed:door_bottom_left_special", "y": 270 }, "facing=north,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special" + "model": "reframed:door_bottom_left_open_special" }, "facing=north,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special", + "model": "reframed:door_bottom_right_special", "y": 270 }, "facing=north,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special", + "model": "reframed:door_bottom_right_open_special", "y": 180 }, "facing=north,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special", + "model": "reframed:door_top_left_special", "y": 270 }, "facing=north,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special" + "model": "reframed:door_top_left_open_special" }, "facing=north,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special", + "model": "reframed:door_top_right_special", "y": 270 }, "facing=north,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special", + "model": "reframed:door_top_right_open_special", "y": 180 }, "facing=south,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special", + "model": "reframed:door_bottom_left_special", "y": 90 }, "facing=south,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special", + "model": "reframed:door_bottom_left_open_special", "y": 180 }, "facing=south,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special", + "model": "reframed:door_bottom_right_special", "y": 90 }, "facing=south,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special" + "model": "reframed:door_bottom_right_open_special" }, "facing=south,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special", + "model": "reframed:door_top_left_special", "y": 90 }, "facing=south,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special", + "model": "reframed:door_top_left_open_special", "y": 180 }, "facing=south,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special", + "model": "reframed:door_top_right_special", "y": 90 }, "facing=south,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special" + "model": "reframed:door_top_right_open_special" }, "facing=west,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special", + "model": "reframed:door_bottom_left_special", "y": 180 }, "facing=west,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special", + "model": "reframed:door_bottom_left_open_special", "y": 270 }, "facing=west,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special", + "model": "reframed:door_bottom_right_special", "y": 180 }, "facing=west,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special", + "model": "reframed:door_bottom_right_open_special", "y": 90 }, "facing=west,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special", + "model": "reframed:door_top_left_special", "y": 180 }, "facing=west,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special", + "model": "reframed:door_top_left_open_special", "y": 270 }, "facing=west,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special", + "model": "reframed:door_top_right_special", "y": 180 }, "facing=west,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special", + "model": "reframed:door_top_right_open_special", "y": 90 } } diff --git a/src/main/resources/assets/reframedtemplates/blockstates/fence.json b/src/main/resources/assets/reframed/blockstates/fence.json similarity index 61% rename from src/main/resources/assets/reframedtemplates/blockstates/fence.json rename to src/main/resources/assets/reframed/blockstates/fence.json index 6dec5a3..fc79e23 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/fence.json +++ b/src/main/resources/assets/reframed/blockstates/fence.json @@ -2,12 +2,12 @@ "multipart": [ { "apply": { - "model": "reframedtemplates:fence_post_special" + "model": "reframed:fence_post_special" } }, { "apply": { - "model": "reframedtemplates:fence_side_special", + "model": "reframed:fence_side_special", "uvlock": true }, "when": { @@ -16,7 +16,7 @@ }, { "apply": { - "model": "reframedtemplates:fence_side_special", + "model": "reframed:fence_side_special", "uvlock": true, "y": 90 }, @@ -26,7 +26,7 @@ }, { "apply": { - "model": "reframedtemplates:fence_side_special", + "model": "reframed:fence_side_special", "uvlock": true, "y": 180 }, @@ -36,7 +36,7 @@ }, { "apply": { - "model": "reframedtemplates:fence_side_special", + "model": "reframed:fence_side_special", "uvlock": true, "y": 270 }, diff --git a/src/main/resources/assets/reframedtemplates/blockstates/fence_gate.json b/src/main/resources/assets/reframed/blockstates/fence_gate.json similarity index 57% rename from src/main/resources/assets/reframedtemplates/blockstates/fence_gate.json rename to src/main/resources/assets/reframed/blockstates/fence_gate.json index c03f045..f0ea0f4 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/fence_gate.json +++ b/src/main/resources/assets/reframed/blockstates/fence_gate.json @@ -1,78 +1,78 @@ { "variants": { "facing=east,in_wall=false,open=false": { - "model": "reframedtemplates:fence_gate_special", + "model": "reframed:fence_gate_special", "uvlock": true, "y": 270 }, "facing=east,in_wall=false,open=true": { - "model": "reframedtemplates:fence_gate_open_special", + "model": "reframed:fence_gate_open_special", "uvlock": true, "y": 270 }, "facing=east,in_wall=true,open=false": { - "model": "reframedtemplates:fence_gate_wall_special", + "model": "reframed:fence_gate_wall_special", "uvlock": true, "y": 270 }, "facing=east,in_wall=true,open=true": { - "model": "reframedtemplates:fence_gate_wall_open_special", + "model": "reframed:fence_gate_wall_open_special", "uvlock": true, "y": 270 }, "facing=north,in_wall=false,open=false": { - "model": "reframedtemplates:fence_gate_special", + "model": "reframed:fence_gate_special", "uvlock": true, "y": 180 }, "facing=north,in_wall=false,open=true": { - "model": "reframedtemplates:fence_gate_open_special", + "model": "reframed:fence_gate_open_special", "uvlock": true, "y": 180 }, "facing=north,in_wall=true,open=false": { - "model": "reframedtemplates:fence_gate_wall_special", + "model": "reframed:fence_gate_wall_special", "uvlock": true, "y": 180 }, "facing=north,in_wall=true,open=true": { - "model": "reframedtemplates:fence_gate_wall_open_special", + "model": "reframed:fence_gate_wall_open_special", "uvlock": true, "y": 180 }, "facing=south,in_wall=false,open=false": { - "model": "reframedtemplates:fence_gate_special", + "model": "reframed:fence_gate_special", "uvlock": true }, "facing=south,in_wall=false,open=true": { - "model": "reframedtemplates:fence_gate_open_special", + "model": "reframed:fence_gate_open_special", "uvlock": true }, "facing=south,in_wall=true,open=false": { - "model": "reframedtemplates:fence_gate_wall_special", + "model": "reframed:fence_gate_wall_special", "uvlock": true }, "facing=south,in_wall=true,open=true": { - "model": "reframedtemplates:fence_gate_wall_open_special", + "model": "reframed:fence_gate_wall_open_special", "uvlock": true }, "facing=west,in_wall=false,open=false": { - "model": "reframedtemplates:fence_gate_special", + "model": "reframed:fence_gate_special", "uvlock": true, "y": 90 }, "facing=west,in_wall=false,open=true": { - "model": "reframedtemplates:fence_gate_open_special", + "model": "reframed:fence_gate_open_special", "uvlock": true, "y": 90 }, "facing=west,in_wall=true,open=false": { - "model": "reframedtemplates:fence_gate_wall_special", + "model": "reframed:fence_gate_wall_special", "uvlock": true, "y": 90 }, "facing=west,in_wall=true,open=true": { - "model": "reframedtemplates:fence_gate_wall_open_special", + "model": "reframed:fence_gate_wall_open_special", "uvlock": true, "y": 90 } diff --git a/src/main/resources/assets/reframedtemplates/blockstates/iron_door.json b/src/main/resources/assets/reframed/blockstates/iron_door.json similarity index 52% rename from src/main/resources/assets/reframedtemplates/blockstates/iron_door.json rename to src/main/resources/assets/reframed/blockstates/iron_door.json index ca062aa..28f9903 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/iron_door.json +++ b/src/main/resources/assets/reframed/blockstates/iron_door.json @@ -1,123 +1,123 @@ { "variants": { "facing=east,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special" + "model": "reframed:door_bottom_left_special" }, "facing=east,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special", + "model": "reframed:door_bottom_left_open_special", "y": 90 }, "facing=east,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special" + "model": "reframed:door_bottom_right_special" }, "facing=east,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special", + "model": "reframed:door_bottom_right_open_special", "y": 270 }, "facing=east,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special" + "model": "reframed:door_top_left_special" }, "facing=east,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special", + "model": "reframed:door_top_left_open_special", "y": 90 }, "facing=east,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special" + "model": "reframed:door_top_right_special" }, "facing=east,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special", + "model": "reframed:door_top_right_open_special", "y": 270 }, "facing=north,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special", + "model": "reframed:door_bottom_left_special", "y": 270 }, "facing=north,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special" + "model": "reframed:door_bottom_left_open_special" }, "facing=north,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special", + "model": "reframed:door_bottom_right_special", "y": 270 }, "facing=north,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special", + "model": "reframed:door_bottom_right_open_special", "y": 180 }, "facing=north,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special", + "model": "reframed:door_top_left_special", "y": 270 }, "facing=north,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special" + "model": "reframed:door_top_left_open_special" }, "facing=north,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special", + "model": "reframed:door_top_right_special", "y": 270 }, "facing=north,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special", + "model": "reframed:door_top_right_open_special", "y": 180 }, "facing=south,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special", + "model": "reframed:door_bottom_left_special", "y": 90 }, "facing=south,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special", + "model": "reframed:door_bottom_left_open_special", "y": 180 }, "facing=south,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special", + "model": "reframed:door_bottom_right_special", "y": 90 }, "facing=south,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special" + "model": "reframed:door_bottom_right_open_special" }, "facing=south,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special", + "model": "reframed:door_top_left_special", "y": 90 }, "facing=south,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special", + "model": "reframed:door_top_left_open_special", "y": 180 }, "facing=south,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special", + "model": "reframed:door_top_right_special", "y": 90 }, "facing=south,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special" + "model": "reframed:door_top_right_open_special" }, "facing=west,half=lower,hinge=left,open=false": { - "model": "reframedtemplates:door_bottom_left_special", + "model": "reframed:door_bottom_left_special", "y": 180 }, "facing=west,half=lower,hinge=left,open=true": { - "model": "reframedtemplates:door_bottom_left_open_special", + "model": "reframed:door_bottom_left_open_special", "y": 270 }, "facing=west,half=lower,hinge=right,open=false": { - "model": "reframedtemplates:door_bottom_right_special", + "model": "reframed:door_bottom_right_special", "y": 180 }, "facing=west,half=lower,hinge=right,open=true": { - "model": "reframedtemplates:door_bottom_right_open_special", + "model": "reframed:door_bottom_right_open_special", "y": 90 }, "facing=west,half=upper,hinge=left,open=false": { - "model": "reframedtemplates:door_top_left_special", + "model": "reframed:door_top_left_special", "y": 180 }, "facing=west,half=upper,hinge=left,open=true": { - "model": "reframedtemplates:door_top_left_open_special", + "model": "reframed:door_top_left_open_special", "y": 270 }, "facing=west,half=upper,hinge=right,open=false": { - "model": "reframedtemplates:door_top_right_special", + "model": "reframed:door_top_right_special", "y": 180 }, "facing=west,half=upper,hinge=right,open=true": { - "model": "reframedtemplates:door_top_right_open_special", + "model": "reframed:door_top_right_open_special", "y": 90 } } diff --git a/src/main/resources/assets/reframedtemplates/blockstates/iron_trapdoor.json b/src/main/resources/assets/reframed/blockstates/iron_trapdoor.json similarity index 51% rename from src/main/resources/assets/reframedtemplates/blockstates/iron_trapdoor.json rename to src/main/resources/assets/reframed/blockstates/iron_trapdoor.json index 15b6d94..5ea5b45 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/iron_trapdoor.json +++ b/src/main/resources/assets/reframed/blockstates/iron_trapdoor.json @@ -1,67 +1,67 @@ { "variants": { "facing=east,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special", + "model": "reframed:trapdoor_bottom_special", "y": 90 }, "facing=east,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "y": 90 }, "facing=east,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special", + "model": "reframed:trapdoor_top_special", "y": 90 }, "facing=east,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 270 }, "facing=north,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special" + "model": "reframed:trapdoor_bottom_special" }, "facing=north,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special" + "model": "reframed:trapdoor_open_special" }, "facing=north,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special" + "model": "reframed:trapdoor_top_special" }, "facing=north,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 180 }, "facing=south,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special", + "model": "reframed:trapdoor_bottom_special", "y": 180 }, "facing=south,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "y": 180 }, "facing=south,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special", + "model": "reframed:trapdoor_top_special", "y": 180 }, "facing=south,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 0 }, "facing=west,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special", + "model": "reframed:trapdoor_bottom_special", "y": 270 }, "facing=west,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "y": 270 }, "facing=west,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special", + "model": "reframed:trapdoor_top_special", "y": 270 }, "facing=west,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 90 } diff --git a/src/main/resources/assets/reframedtemplates/blockstates/lever.json b/src/main/resources/assets/reframed/blockstates/lever.json similarity index 58% rename from src/main/resources/assets/reframedtemplates/blockstates/lever.json rename to src/main/resources/assets/reframed/blockstates/lever.json index a3f6ba5..221f4b7 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/lever.json +++ b/src/main/resources/assets/reframed/blockstates/lever.json @@ -1,108 +1,108 @@ { "variants": { "face=ceiling,facing=east,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 180, "y": 270 }, "face=ceiling,facing=east,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 180, "y": 270 }, "face=ceiling,facing=north,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 180, "y": 180 }, "face=ceiling,facing=north,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 180, "y": 180 }, "face=ceiling,facing=south,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 180 }, "face=ceiling,facing=south,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 180 }, "face=ceiling,facing=west,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 180, "y": 90 }, "face=ceiling,facing=west,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 180, "y": 90 }, "face=floor,facing=east,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "y": 90 }, "face=floor,facing=east,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "y": 90 }, "face=floor,facing=north,powered=false": { - "model": "reframedtemplates:lever_on_special" + "model": "reframed:lever_on_special" }, "face=floor,facing=north,powered=true": { - "model": "reframedtemplates:lever_special" + "model": "reframed:lever_special" }, "face=floor,facing=south,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "y": 180 }, "face=floor,facing=south,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "y": 180 }, "face=floor,facing=west,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "y": 270 }, "face=floor,facing=west,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "y": 270 }, "face=wall,facing=east,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 90, "y": 90 }, "face=wall,facing=east,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 90, "y": 90 }, "face=wall,facing=north,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 90 }, "face=wall,facing=north,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 90 }, "face=wall,facing=south,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 90, "y": 180 }, "face=wall,facing=south,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 90, "y": 180 }, "face=wall,facing=west,powered=false": { - "model": "reframedtemplates:lever_on_special", + "model": "reframed:lever_on_special", "x": 90, "y": 270 }, "face=wall,facing=west,powered=true": { - "model": "reframedtemplates:lever_special", + "model": "reframed:lever_special", "x": 90, "y": 270 } diff --git a/src/main/resources/assets/reframedtemplates/blockstates/pane.json b/src/main/resources/assets/reframed/blockstates/pane.json similarity index 53% rename from src/main/resources/assets/reframedtemplates/blockstates/pane.json rename to src/main/resources/assets/reframed/blockstates/pane.json index 4cb0ba3..d1a6ea6 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/pane.json +++ b/src/main/resources/assets/reframed/blockstates/pane.json @@ -2,12 +2,12 @@ "multipart": [ { "apply": { - "model": "reframedtemplates:glass_pane_post_special" + "model": "reframed:glass_pane_post_special" } }, { "apply": { - "model": "reframedtemplates:glass_pane_side_special" + "model": "reframed:glass_pane_side_special" }, "when": { "north": "true" @@ -15,7 +15,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_side_special", + "model": "reframed:glass_pane_side_special", "y": 90 }, "when": { @@ -24,7 +24,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_side_alt_special" + "model": "reframed:glass_pane_side_alt_special" }, "when": { "south": "true" @@ -32,7 +32,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_side_alt_special", + "model": "reframed:glass_pane_side_alt_special", "y": 90 }, "when": { @@ -41,7 +41,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_noside_special" + "model": "reframed:glass_pane_noside_special" }, "when": { "north": "false" @@ -49,7 +49,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_noside_alt_special" + "model": "reframed:glass_pane_noside_alt_special" }, "when": { "east": "false" @@ -57,7 +57,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_noside_alt_special", + "model": "reframed:glass_pane_noside_alt_special", "y": 90 }, "when": { @@ -66,7 +66,7 @@ }, { "apply": { - "model": "reframedtemplates:glass_pane_noside_special", + "model": "reframed:glass_pane_noside_special", "y": 270 }, "when": { diff --git a/src/main/resources/assets/reframedtemplates/blockstates/post.json b/src/main/resources/assets/reframed/blockstates/post.json similarity index 51% rename from src/main/resources/assets/reframedtemplates/blockstates/post.json rename to src/main/resources/assets/reframed/blockstates/post.json index 9bc5208..439dbaa 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/post.json +++ b/src/main/resources/assets/reframed/blockstates/post.json @@ -1,17 +1,17 @@ { "variants": { "axis=x": { - "model": "reframedtemplates:fence_post_special", + "model": "reframed:fence_post_special", "x": 90, "y": 90, "uvlock": true }, "axis=y": { - "model": "reframedtemplates:fence_post_special", + "model": "reframed:fence_post_special", "uvlock": true }, "axis=z": { - "model": "reframedtemplates:fence_post_special", + "model": "reframed:fence_post_special", "uvlock": true, "x": 90 } diff --git a/src/main/resources/assets/reframed/blockstates/pressure_plate.json b/src/main/resources/assets/reframed/blockstates/pressure_plate.json new file mode 100644 index 0000000..1316871 --- /dev/null +++ b/src/main/resources/assets/reframed/blockstates/pressure_plate.json @@ -0,0 +1,10 @@ +{ + "variants": { + "powered=false": { + "model": "reframed:pressure_plate_up_special" + }, + "powered=true": { + "model": "reframed:pressure_plate_down_special" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/blockstates/slab.json b/src/main/resources/assets/reframed/blockstates/slab.json similarity index 69% rename from src/main/resources/assets/reframedtemplates/blockstates/slab.json rename to src/main/resources/assets/reframed/blockstates/slab.json index d856e67..acc6312 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/slab.json +++ b/src/main/resources/assets/reframed/blockstates/slab.json @@ -2,7 +2,7 @@ "multipart": [ { "apply": { - "model": "reframedtemplates:slab_special", + "model": "reframed:slab_special", "uvlock": true }, "when": { @@ -11,7 +11,7 @@ }, { "apply": { - "model": "reframedtemplates:slab_special", + "model": "reframed:slab_special", "uvlock": true, "x": 180 }, @@ -21,7 +21,7 @@ }, { "apply": { - "model": "reframedtemplates:slab_special", + "model": "reframed:slab_special", "uvlock": true, "x": 270 }, @@ -31,7 +31,7 @@ }, { "apply": { - "model": "reframedtemplates:slab_special", + "model": "reframed:slab_special", "uvlock": true, "x": 90 }, @@ -41,7 +41,7 @@ }, { "apply": { - "model": "reframedtemplates:slab_special", + "model": "reframed:slab_special", "uvlock": true, "x": 90, "y": 90 @@ -52,7 +52,7 @@ }, { "apply": { - "model": "reframedtemplates:slab_special", + "model": "reframed:slab_special", "uvlock": true, "x": 90, "y": 270 diff --git a/src/main/resources/assets/reframedtemplates/blockstates/trapdoor.json b/src/main/resources/assets/reframed/blockstates/trapdoor.json similarity index 51% rename from src/main/resources/assets/reframedtemplates/blockstates/trapdoor.json rename to src/main/resources/assets/reframed/blockstates/trapdoor.json index 15b6d94..5ea5b45 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/trapdoor.json +++ b/src/main/resources/assets/reframed/blockstates/trapdoor.json @@ -1,67 +1,67 @@ { "variants": { "facing=east,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special", + "model": "reframed:trapdoor_bottom_special", "y": 90 }, "facing=east,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "y": 90 }, "facing=east,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special", + "model": "reframed:trapdoor_top_special", "y": 90 }, "facing=east,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 270 }, "facing=north,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special" + "model": "reframed:trapdoor_bottom_special" }, "facing=north,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special" + "model": "reframed:trapdoor_open_special" }, "facing=north,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special" + "model": "reframed:trapdoor_top_special" }, "facing=north,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 180 }, "facing=south,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special", + "model": "reframed:trapdoor_bottom_special", "y": 180 }, "facing=south,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "y": 180 }, "facing=south,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special", + "model": "reframed:trapdoor_top_special", "y": 180 }, "facing=south,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 0 }, "facing=west,half=bottom,open=false": { - "model": "reframedtemplates:trapdoor_bottom_special", + "model": "reframed:trapdoor_bottom_special", "y": 270 }, "facing=west,half=bottom,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "y": 270 }, "facing=west,half=top,open=false": { - "model": "reframedtemplates:trapdoor_top_special", + "model": "reframed:trapdoor_top_special", "y": 270 }, "facing=west,half=top,open=true": { - "model": "reframedtemplates:trapdoor_open_special", + "model": "reframed:trapdoor_open_special", "x": 180, "y": 90 } diff --git a/src/main/resources/assets/reframedtemplates/blockstates/wall.json b/src/main/resources/assets/reframed/blockstates/wall.json similarity index 63% rename from src/main/resources/assets/reframedtemplates/blockstates/wall.json rename to src/main/resources/assets/reframed/blockstates/wall.json index 7e77704..3d6903d 100644 --- a/src/main/resources/assets/reframedtemplates/blockstates/wall.json +++ b/src/main/resources/assets/reframed/blockstates/wall.json @@ -2,7 +2,7 @@ "multipart": [ { "apply": { - "model": "reframedtemplates:wall_post_special" + "model": "reframed:wall_post_special" }, "when": { "up": "true" @@ -10,7 +10,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_special", + "model": "reframed:wall_side_special", "uvlock": true }, "when": { @@ -19,7 +19,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_special", + "model": "reframed:wall_side_special", "uvlock": true, "y": 90 }, @@ -29,7 +29,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_special", + "model": "reframed:wall_side_special", "uvlock": true, "y": 180 }, @@ -39,7 +39,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_special", + "model": "reframed:wall_side_special", "uvlock": true, "y": 270 }, @@ -49,7 +49,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_tall_special", + "model": "reframed:wall_side_tall_special", "uvlock": true }, "when": { @@ -58,7 +58,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_tall_special", + "model": "reframed:wall_side_tall_special", "uvlock": true, "y": 90 }, @@ -68,7 +68,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_tall_special", + "model": "reframed:wall_side_tall_special", "uvlock": true, "y": 180 }, @@ -78,7 +78,7 @@ }, { "apply": { - "model": "reframedtemplates:wall_side_tall_special", + "model": "reframed:wall_side_tall_special", "uvlock": true, "y": 270 }, diff --git a/src/main/resources/assets/reframed/lang/en_us.json b/src/main/resources/assets/reframed/lang/en_us.json new file mode 100644 index 0000000..1e1683b --- /dev/null +++ b/src/main/resources/assets/reframed/lang/en_us.json @@ -0,0 +1,22 @@ +{ + "itemGroup.reframed.tab": "Frames", + + "block.reframed.button": "Button Frame", + "block.reframed.candle": "Candle Frame", + "block.reframed.carpet": "Carpet Frame", + "block.reframed.cube": "Cube Frame", + "block.reframed.door": "Door Frame", + "block.reframed.fence": "Fence Frame", + "block.reframed.fence_gate": "Fence Gate Frame", + "block.reframed.iron_door": "Iron Door Frame", + "block.reframed.iron_trapdoor": "Iron Trapdoor Frame", + "block.reframed.lever": "Lever Frame", + "block.reframed.pane": "Pane Frame", + "block.reframed.post": "Post Frame", + "block.reframed.pressure_plate": "Pressure Plate Frame", + "block.reframed.slab": "Slab Frame", + "block.reframed.stairs": "Stairs Frame", + "block.reframed.trapdoor": "Trapdoor Frame", + "block.reframed.wall": "Wall Frame" + +} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/models/block/double_outer_stairs.json b/src/main/resources/assets/reframed/models/block/double_outer_stairs.json similarity index 100% rename from src/main/resources/assets/reframedtemplates/models/block/double_outer_stairs.json rename to src/main/resources/assets/reframed/models/block/double_outer_stairs.json diff --git a/src/main/resources/assets/reframedtemplates/models/block/fence_post_inventory.json b/src/main/resources/assets/reframed/models/block/fence_post_inventory.json similarity index 100% rename from src/main/resources/assets/reframedtemplates/models/block/fence_post_inventory.json rename to src/main/resources/assets/reframed/models/block/fence_post_inventory.json diff --git a/src/main/resources/assets/reframedtemplates/models/block/fence_side.json b/src/main/resources/assets/reframed/models/block/fence_side.json similarity index 73% rename from src/main/resources/assets/reframedtemplates/models/block/fence_side.json rename to src/main/resources/assets/reframed/models/block/fence_side.json index cb05c78..b17cb3c 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/fence_side.json +++ b/src/main/resources/assets/reframed/models/block/fence_side.json @@ -1,12 +1,4 @@ { - "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east" - }, "elements": [ { "from": [7, 12, 0], diff --git a/src/main/resources/assets/reframedtemplates/models/block/glass_pane_side.json b/src/main/resources/assets/reframed/models/block/glass_pane_side.json similarity index 59% rename from src/main/resources/assets/reframedtemplates/models/block/glass_pane_side.json rename to src/main/resources/assets/reframed/models/block/glass_pane_side.json index 0a05ca7..ada50c1 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/glass_pane_side.json +++ b/src/main/resources/assets/reframed/models/block/glass_pane_side.json @@ -1,13 +1,5 @@ { "ambientocclusion": false, - "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east" - }, "elements": [ { "from": [7, 0, 0], diff --git a/src/main/resources/assets/reframedtemplates/models/block/glass_pane_side_alt.json b/src/main/resources/assets/reframed/models/block/glass_pane_side_alt.json similarity index 59% rename from src/main/resources/assets/reframedtemplates/models/block/glass_pane_side_alt.json rename to src/main/resources/assets/reframed/models/block/glass_pane_side_alt.json index fe2a4ed..47efbab 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/glass_pane_side_alt.json +++ b/src/main/resources/assets/reframed/models/block/glass_pane_side_alt.json @@ -1,13 +1,5 @@ { "ambientocclusion": false, - "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east" - }, "elements": [ { "from": [7, 0, 9], diff --git a/src/main/resources/assets/reframedtemplates/models/block/lever.json b/src/main/resources/assets/reframed/models/block/lever.json similarity index 78% rename from src/main/resources/assets/reframedtemplates/models/block/lever.json rename to src/main/resources/assets/reframed/models/block/lever.json index 7b75bfd..15b6eb5 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/lever.json +++ b/src/main/resources/assets/reframed/models/block/lever.json @@ -2,12 +2,6 @@ "parent": "block/block", "ambientocclusion": false, "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east", "lever": "block/lever" }, "elements": [ diff --git a/src/main/resources/assets/reframedtemplates/models/block/lever_on.json b/src/main/resources/assets/reframed/models/block/lever_on.json similarity index 78% rename from src/main/resources/assets/reframedtemplates/models/block/lever_on.json rename to src/main/resources/assets/reframed/models/block/lever_on.json index 89c2a59..25b5276 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/lever_on.json +++ b/src/main/resources/assets/reframed/models/block/lever_on.json @@ -2,12 +2,6 @@ "parent": "block/block", "ambientocclusion": false, "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east", "lever": "block/lever" }, "elements": [ diff --git a/src/main/resources/assets/reframedtemplates/models/block/trapdoor_open.json b/src/main/resources/assets/reframed/models/block/trapdoor_open.json similarity index 68% rename from src/main/resources/assets/reframedtemplates/models/block/trapdoor_open.json rename to src/main/resources/assets/reframed/models/block/trapdoor_open.json index 113c9f4..11f8b91 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/trapdoor_open.json +++ b/src/main/resources/assets/reframed/models/block/trapdoor_open.json @@ -1,13 +1,5 @@ { "parent": "block/block", - "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east" - }, "elements": [ { "from": [0, 0, 13], diff --git a/src/main/resources/assets/reframedtemplates/models/block/wall_side.json b/src/main/resources/assets/reframed/models/block/wall_side.json similarity index 53% rename from src/main/resources/assets/reframedtemplates/models/block/wall_side.json rename to src/main/resources/assets/reframed/models/block/wall_side.json index dff3eb5..e29d419 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/wall_side.json +++ b/src/main/resources/assets/reframed/models/block/wall_side.json @@ -1,12 +1,4 @@ { - "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east" - }, "elements": [ { "from": [5, 0, 0], diff --git a/src/main/resources/assets/reframedtemplates/models/block/wall_side_tall.json b/src/main/resources/assets/reframed/models/block/wall_side_tall.json similarity index 53% rename from src/main/resources/assets/reframedtemplates/models/block/wall_side_tall.json rename to src/main/resources/assets/reframed/models/block/wall_side_tall.json index a47c485..7f80864 100644 --- a/src/main/resources/assets/reframedtemplates/models/block/wall_side_tall.json +++ b/src/main/resources/assets/reframed/models/block/wall_side_tall.json @@ -1,12 +1,4 @@ { - "textures": { - "down": "reframedtemplates:templates_special/down", - "up": "reframedtemplates:templates_special/up", - "north": "reframedtemplates:templates_special/north", - "south": "reframedtemplates:templates_special/south", - "west": "reframedtemplates:templates_special/west", - "east": "reframedtemplates:templates_special/east" - }, "elements": [ { "from": [5, 0, 0], diff --git a/src/main/resources/assets/reframedtemplates/models/item/candle.json b/src/main/resources/assets/reframed/models/item/candle.json similarity index 56% rename from src/main/resources/assets/reframedtemplates/models/item/candle.json rename to src/main/resources/assets/reframed/models/item/candle.json index 0d039fb..7c743ac 100644 --- a/src/main/resources/assets/reframedtemplates/models/item/candle.json +++ b/src/main/resources/assets/reframed/models/item/candle.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "reframedtemplates:item/candle" + "layer0": "reframed:item/candle" } } \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/models/item/door.json b/src/main/resources/assets/reframed/models/item/door.json similarity index 57% rename from src/main/resources/assets/reframedtemplates/models/item/door.json rename to src/main/resources/assets/reframed/models/item/door.json index f32b972..a8db42c 100644 --- a/src/main/resources/assets/reframedtemplates/models/item/door.json +++ b/src/main/resources/assets/reframed/models/item/door.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "reframedtemplates:item/door" + "layer0": "reframed:item/door" } } \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/models/item/iron_door.json b/src/main/resources/assets/reframed/models/item/iron_door.json similarity index 57% rename from src/main/resources/assets/reframedtemplates/models/item/iron_door.json rename to src/main/resources/assets/reframed/models/item/iron_door.json index f32b972..a8db42c 100644 --- a/src/main/resources/assets/reframedtemplates/models/item/iron_door.json +++ b/src/main/resources/assets/reframed/models/item/iron_door.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "reframedtemplates:item/door" + "layer0": "reframed:item/door" } } \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/models/item/lever.json b/src/main/resources/assets/reframed/models/item/lever.json similarity index 57% rename from src/main/resources/assets/reframedtemplates/models/item/lever.json rename to src/main/resources/assets/reframed/models/item/lever.json index 189a51b..38b386f 100644 --- a/src/main/resources/assets/reframedtemplates/models/item/lever.json +++ b/src/main/resources/assets/reframed/models/item/lever.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "reframedtemplates:item/lever" + "layer0": "reframed:item/lever" } } \ No newline at end of file diff --git a/src/main/resources/assets/reframed/models/item/pane.json b/src/main/resources/assets/reframed/models/item/pane.json new file mode 100644 index 0000000..63cd040 --- /dev/null +++ b/src/main/resources/assets/reframed/models/item/pane.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "reframed:block/framed_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/textures/block/framed_accent_block.png b/src/main/resources/assets/reframed/textures/block/framed_accent_block.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/block/framed_accent_block.png rename to src/main/resources/assets/reframed/textures/block/framed_accent_block.png diff --git a/src/main/resources/assets/reframedtemplates/textures/block/framed_block.png b/src/main/resources/assets/reframed/textures/block/framed_block.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/block/framed_block.png rename to src/main/resources/assets/reframed/textures/block/framed_block.png diff --git a/src/main/resources/assets/reframedtemplates/textures/item/candle.png b/src/main/resources/assets/reframed/textures/item/candle.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/item/candle.png rename to src/main/resources/assets/reframed/textures/item/candle.png diff --git a/src/main/resources/assets/reframedtemplates/textures/item/door.png b/src/main/resources/assets/reframed/textures/item/door.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/item/door.png rename to src/main/resources/assets/reframed/textures/item/door.png diff --git a/src/main/resources/assets/reframedtemplates/textures/item/lever.png b/src/main/resources/assets/reframed/textures/item/lever.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/item/lever.png rename to src/main/resources/assets/reframed/textures/item/lever.png diff --git a/src/main/resources/assets/reframedtemplates/textures/templates_special/down.png b/src/main/resources/assets/reframed/textures/reframed_special/down.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/templates_special/down.png rename to src/main/resources/assets/reframed/textures/reframed_special/down.png diff --git a/src/main/resources/assets/reframedtemplates/textures/templates_special/east.png b/src/main/resources/assets/reframed/textures/reframed_special/east.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/templates_special/east.png rename to src/main/resources/assets/reframed/textures/reframed_special/east.png diff --git a/src/main/resources/assets/reframedtemplates/textures/templates_special/north.png b/src/main/resources/assets/reframed/textures/reframed_special/north.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/templates_special/north.png rename to src/main/resources/assets/reframed/textures/reframed_special/north.png diff --git a/src/main/resources/assets/reframedtemplates/textures/templates_special/south.png b/src/main/resources/assets/reframed/textures/reframed_special/south.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/templates_special/south.png rename to src/main/resources/assets/reframed/textures/reframed_special/south.png diff --git a/src/main/resources/assets/reframedtemplates/textures/templates_special/up.png b/src/main/resources/assets/reframed/textures/reframed_special/up.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/templates_special/up.png rename to src/main/resources/assets/reframed/textures/reframed_special/up.png diff --git a/src/main/resources/assets/reframedtemplates/textures/templates_special/west.png b/src/main/resources/assets/reframed/textures/reframed_special/west.png similarity index 100% rename from src/main/resources/assets/reframedtemplates/textures/templates_special/west.png rename to src/main/resources/assets/reframed/textures/reframed_special/west.png diff --git a/src/main/resources/assets/reframedtemplates/blockstates/candle.json b/src/main/resources/assets/reframedtemplates/blockstates/candle.json deleted file mode 100644 index fedfd9c..0000000 --- a/src/main/resources/assets/reframedtemplates/blockstates/candle.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "variants": { - "candles=1": { - "model": "reframedtemplates:one_candle_special" - }, - "candles=2": { - "model": "reframedtemplates:two_candles_special" - }, - "candles=3": { - "model": "reframedtemplates:three_candles_special" - }, - "candles=4": { - "model": "reframedtemplates:four_candles_special" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/blockstates/carpet.json b/src/main/resources/assets/reframedtemplates/blockstates/carpet.json deleted file mode 100644 index 1e93c1d..0000000 --- a/src/main/resources/assets/reframedtemplates/blockstates/carpet.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "reframedtemplates:carpet_special" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/blockstates/cube.json b/src/main/resources/assets/reframedtemplates/blockstates/cube.json deleted file mode 100644 index 91da698..0000000 --- a/src/main/resources/assets/reframedtemplates/blockstates/cube.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "reframedtemplates:cube_special" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/blockstates/pressure_plate.json b/src/main/resources/assets/reframedtemplates/blockstates/pressure_plate.json deleted file mode 100644 index 4e35b7b..0000000 --- a/src/main/resources/assets/reframedtemplates/blockstates/pressure_plate.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "variants": { - "powered=false": { - "model": "reframedtemplates:pressure_plate_up_special" - }, - "powered=true": { - "model": "reframedtemplates:pressure_plate_down_special" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/lang/en_us.json b/src/main/resources/assets/reframedtemplates/lang/en_us.json deleted file mode 100644 index 382c0e6..0000000 --- a/src/main/resources/assets/reframedtemplates/lang/en_us.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "itemGroup.reframedtemplates.tab": "Frames", - - "block.reframedtemplates.button": "Button Frame", - "block.reframedtemplates.candle": "Candle Frame", - "block.reframedtemplates.carpet": "Carpet Frame", - "block.reframedtemplates.cube": "Cube Frame", - "block.reframedtemplates.door": "Door Frame", - "block.reframedtemplates.fence": "Fence Frame", - "block.reframedtemplates.fence_gate": "Fence Gate Frame", - "block.reframedtemplates.iron_door": "Iron Door Frame", - "block.reframedtemplates.iron_trapdoor": "Iron Trapdoor Frame", - "block.reframedtemplates.lever": "Lever Frame", - "block.reframedtemplates.pane": "Pane Frame", - "block.reframedtemplates.post": "Post Frame", - "block.reframedtemplates.pressure_plate": "Pressure Plate Frame", - "block.reframedtemplates.slab": "Slab Frame", - "block.reframedtemplates.stairs": "Stairs Frame", - "block.reframedtemplates.trapdoor": "Trapdoor Frame", - "block.reframedtemplates.wall": "Wall Frame" - -} \ No newline at end of file diff --git a/src/main/resources/assets/reframedtemplates/models/item/pane.json b/src/main/resources/assets/reframedtemplates/models/item/pane.json deleted file mode 100644 index b97941a..0000000 --- a/src/main/resources/assets/reframedtemplates/models/item/pane.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "reframedtemplates:block/framed_block" - } -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/candles.json b/src/main/resources/data/minecraft/tags/blocks/candles.json index 0b3ed30..bbdd105 100644 --- a/src/main/resources/data/minecraft/tags/blocks/candles.json +++ b/src/main/resources/data/minecraft/tags/blocks/candles.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:candle" + "reframed:candle" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/doors.json b/src/main/resources/data/minecraft/tags/blocks/doors.json index 2d49da2..6ac1784 100644 --- a/src/main/resources/data/minecraft/tags/blocks/doors.json +++ b/src/main/resources/data/minecraft/tags/blocks/doors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:iron_door" + "reframed:iron_door" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/fence_gates.json b/src/main/resources/data/minecraft/tags/blocks/fence_gates.json index ecdd802..81ce22c 100644 --- a/src/main/resources/data/minecraft/tags/blocks/fence_gates.json +++ b/src/main/resources/data/minecraft/tags/blocks/fence_gates.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:fence_gate" + "reframed:fence_gate" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json index ba62db0..fee30ea 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,20 +1,20 @@ { "replace": false, "values": [ - "reframedtemplates:button", - "reframedtemplates:candle", - "reframedtemplates:carpet", - "reframedtemplates:cube", - "reframedtemplates:door", - "reframedtemplates:fence", - "reframedtemplates:fence_gate", - "reframedtemplates:lever", - "reframedtemplates:pane", - "reframedtemplates:post", - "reframedtemplates:pressure_plate", - "reframedtemplates:slab", - "reframedtemplates:stairs", - "reframedtemplates:trapdoor", - "reframedtemplates:wall" + "reframed:button", + "reframed:candle", + "reframed:carpet", + "reframed:cube", + "reframed:door", + "reframed:fence", + "reframed:fence_gate", + "reframed:lever", + "reframed:pane", + "reframed:post", + "reframed:pressure_plate", + "reframed:slab", + "reframed:stairs", + "reframed:trapdoor", + "reframed:wall" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index e5e5ecc..ae5e912 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,7 +1,7 @@ { "replace": false, "values": [ - "reframedtemplates:iron_door", - "reframedtemplates:iron_trapdoor" + "reframed:iron_door", + "reframed:iron_trapdoor" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/trapdoors.json b/src/main/resources/data/minecraft/tags/blocks/trapdoors.json index 99ffa39..4a330e3 100644 --- a/src/main/resources/data/minecraft/tags/blocks/trapdoors.json +++ b/src/main/resources/data/minecraft/tags/blocks/trapdoors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:iron_trapdoor" + "reframed:iron_trapdoor" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/walls.json b/src/main/resources/data/minecraft/tags/blocks/walls.json index 7af721a..162e22a 100644 --- a/src/main/resources/data/minecraft/tags/blocks/walls.json +++ b/src/main/resources/data/minecraft/tags/blocks/walls.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:wall" + "reframed:wall" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json b/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json index bdb2c36..3425df1 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_buttons.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:button" + "reframed:button" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_doors.json b/src/main/resources/data/minecraft/tags/blocks/wooden_doors.json index 029c8a4..d3b2d1c 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_doors.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_doors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:door" + "reframed:door" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json b/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json index e01b675..498fb11 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_fences.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:fence" + "reframed:fence" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_pressure_plates.json b/src/main/resources/data/minecraft/tags/blocks/wooden_pressure_plates.json index 0ab4f55..0ccbcc3 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_pressure_plates.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_pressure_plates.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:pressure_plate" + "reframed:pressure_plate" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_slabs.json b/src/main/resources/data/minecraft/tags/blocks/wooden_slabs.json index 8daeef0..0fcb99d 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_slabs.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_slabs.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:slab" + "reframed:slab" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_stairs.json b/src/main/resources/data/minecraft/tags/blocks/wooden_stairs.json index 6541f1a..e28719c 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_stairs.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_stairs.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:stairs" + "reframed:stairs" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wooden_trapdoors.json b/src/main/resources/data/minecraft/tags/blocks/wooden_trapdoors.json index 9e2ffd8..9b25ee1 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wooden_trapdoors.json +++ b/src/main/resources/data/minecraft/tags/blocks/wooden_trapdoors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:trapdoor" + "reframed:trapdoor" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json b/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json index 053113e..731bb53 100644 --- a/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json +++ b/src/main/resources/data/minecraft/tags/blocks/wool_carpets.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:carpet" + "reframed:carpet" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/candles.json b/src/main/resources/data/minecraft/tags/items/candles.json index 0b3ed30..bbdd105 100644 --- a/src/main/resources/data/minecraft/tags/items/candles.json +++ b/src/main/resources/data/minecraft/tags/items/candles.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:candle" + "reframed:candle" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/doors.json b/src/main/resources/data/minecraft/tags/items/doors.json index 2d49da2..6ac1784 100644 --- a/src/main/resources/data/minecraft/tags/items/doors.json +++ b/src/main/resources/data/minecraft/tags/items/doors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:iron_door" + "reframed:iron_door" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/fence_gates.json b/src/main/resources/data/minecraft/tags/items/fence_gates.json index ecdd802..81ce22c 100644 --- a/src/main/resources/data/minecraft/tags/items/fence_gates.json +++ b/src/main/resources/data/minecraft/tags/items/fence_gates.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:fence_gate" + "reframed:fence_gate" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/trapdoors.json b/src/main/resources/data/minecraft/tags/items/trapdoors.json index 99ffa39..4a330e3 100644 --- a/src/main/resources/data/minecraft/tags/items/trapdoors.json +++ b/src/main/resources/data/minecraft/tags/items/trapdoors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:iron_trapdoor" + "reframed:iron_trapdoor" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/walls.json b/src/main/resources/data/minecraft/tags/items/walls.json index 7af721a..162e22a 100644 --- a/src/main/resources/data/minecraft/tags/items/walls.json +++ b/src/main/resources/data/minecraft/tags/items/walls.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:wall" + "reframed:wall" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_buttons.json b/src/main/resources/data/minecraft/tags/items/wooden_buttons.json index bdb2c36..3425df1 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_buttons.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_buttons.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:button" + "reframed:button" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_doors.json b/src/main/resources/data/minecraft/tags/items/wooden_doors.json index 029c8a4..d3b2d1c 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_doors.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_doors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:door" + "reframed:door" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_fences.json b/src/main/resources/data/minecraft/tags/items/wooden_fences.json index e01b675..498fb11 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_fences.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_fences.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:fence" + "reframed:fence" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_pressure_plates.json b/src/main/resources/data/minecraft/tags/items/wooden_pressure_plates.json index 0ab4f55..0ccbcc3 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_pressure_plates.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_pressure_plates.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:pressure_plate" + "reframed:pressure_plate" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_slabs.json b/src/main/resources/data/minecraft/tags/items/wooden_slabs.json index 8daeef0..0fcb99d 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_slabs.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_slabs.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:slab" + "reframed:slab" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_stairs.json b/src/main/resources/data/minecraft/tags/items/wooden_stairs.json index 6541f1a..e28719c 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_stairs.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_stairs.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:stairs" + "reframed:stairs" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wooden_trapdoors.json b/src/main/resources/data/minecraft/tags/items/wooden_trapdoors.json index 9e2ffd8..9b25ee1 100644 --- a/src/main/resources/data/minecraft/tags/items/wooden_trapdoors.json +++ b/src/main/resources/data/minecraft/tags/items/wooden_trapdoors.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:trapdoor" + "reframed:trapdoor" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/wool_carpets.json b/src/main/resources/data/minecraft/tags/items/wool_carpets.json index 053113e..731bb53 100644 --- a/src/main/resources/data/minecraft/tags/items/wool_carpets.json +++ b/src/main/resources/data/minecraft/tags/items/wool_carpets.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "reframedtemplates:carpet" + "reframed:carpet" ] } \ No newline at end of file diff --git a/src/main/resources/data/reframed/advancements/recipes/decorations/reframed.json b/src/main/resources/data/reframed/advancements/recipes/decorations/reframed.json new file mode 100644 index 0000000..a632e74 --- /dev/null +++ b/src/main/resources/data/reframed/advancements/recipes/decorations/reframed.json @@ -0,0 +1,41 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "reframed:button", + "reframed:candle", + "reframed:carpet", + "reframed:cube", + "reframed:door", + "reframed:fence", + "reframed:fence_gate", + "reframed:iron_door", + "reframed:iron_trapdoor", + "reframed:lever", + "reframed:pane", + "reframed:post", + "reframed:pressure_plate", + "reframed:slab", + "reframed:stairs", + "reframed:trapdoor", + "reframed:wall" + ] + }, + "criteria": { + "has_bamboo": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:bamboo" + } + ] + } + } + }, + "requirements": [ + [ + "has_bamboo" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/loot_tables/blocks/candle.json b/src/main/resources/data/reframed/loot_tables/blocks/candle.json similarity index 86% rename from src/main/resources/data/reframedtemplates/loot_tables/blocks/candle.json rename to src/main/resources/data/reframed/loot_tables/blocks/candle.json index e2d10f9..9555c75 100644 --- a/src/main/resources/data/reframedtemplates/loot_tables/blocks/candle.json +++ b/src/main/resources/data/reframed/loot_tables/blocks/candle.json @@ -11,7 +11,7 @@ "add": false, "conditions": [ { - "block": "reframedtemplates:candle", + "block": "reframed:candle", "condition": "minecraft:block_state_property", "properties": { "candles": "2" @@ -25,7 +25,7 @@ "add": false, "conditions": [ { - "block": "reframedtemplates:candle", + "block": "reframed:candle", "condition": "minecraft:block_state_property", "properties": { "candles": "3" @@ -39,7 +39,7 @@ "add": false, "conditions": [ { - "block": "reframedtemplates:candle", + "block": "reframed:candle", "condition": "minecraft:block_state_property", "properties": { "candles": "4" @@ -53,7 +53,7 @@ "function": "minecraft:explosion_decay" } ], - "name": "reframedtemplates:candle" + "name": "reframed:candle" } ], "rolls": 1.0 diff --git a/src/main/resources/data/reframedtemplates/loot_tables/blocks/door.json b/src/main/resources/data/reframed/loot_tables/blocks/door.json similarity index 81% rename from src/main/resources/data/reframedtemplates/loot_tables/blocks/door.json rename to src/main/resources/data/reframed/loot_tables/blocks/door.json index 36eb855..8d9f6ac 100644 --- a/src/main/resources/data/reframedtemplates/loot_tables/blocks/door.json +++ b/src/main/resources/data/reframed/loot_tables/blocks/door.json @@ -6,10 +6,10 @@ "entries": [ { "type": "minecraft:item", - "name": "reframedtemplates:door", + "name": "reframed:door", "conditions": [ { - "block": "reframedtemplates:door", + "block": "reframed:door", "condition": "minecraft:block_state_property", "properties": { "half": "lower" diff --git a/src/main/resources/data/reframedtemplates/loot_tables/blocks/iron_door.json b/src/main/resources/data/reframed/loot_tables/blocks/iron_door.json similarity index 80% rename from src/main/resources/data/reframedtemplates/loot_tables/blocks/iron_door.json rename to src/main/resources/data/reframed/loot_tables/blocks/iron_door.json index 8a14043..1021c5f 100644 --- a/src/main/resources/data/reframedtemplates/loot_tables/blocks/iron_door.json +++ b/src/main/resources/data/reframed/loot_tables/blocks/iron_door.json @@ -6,10 +6,10 @@ "entries": [ { "type": "minecraft:item", - "name": "reframedtemplates:iron_door", + "name": "reframed:iron_door", "conditions": [ { - "block": "reframedtemplates:iron_door", + "block": "reframed:iron_door", "condition": "minecraft:block_state_property", "properties": { "half": "lower" diff --git a/src/main/resources/data/reframedtemplates/recipes/button.json b/src/main/resources/data/reframed/recipes/button.json similarity index 74% rename from src/main/resources/data/reframedtemplates/recipes/button.json rename to src/main/resources/data/reframed/recipes/button.json index 0ad683b..16d10d0 100644 --- a/src/main/resources/data/reframedtemplates/recipes/button.json +++ b/src/main/resources/data/reframed/recipes/button.json @@ -13,8 +13,8 @@ } }, "result": { - "item": "reframedtemplates:button", + "item": "reframed:button", "count": 1 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/candle.json b/src/main/resources/data/reframed/recipes/candle.json similarity index 78% rename from src/main/resources/data/reframedtemplates/recipes/candle.json rename to src/main/resources/data/reframed/recipes/candle.json index 1ca4609..461c0a6 100644 --- a/src/main/resources/data/reframedtemplates/recipes/candle.json +++ b/src/main/resources/data/reframed/recipes/candle.json @@ -17,8 +17,8 @@ } }, "result": { - "item": "reframedtemplates:candle", + "item": "reframed:candle", "count": 1 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/carpet.json b/src/main/resources/data/reframed/recipes/carpet.json similarity index 74% rename from src/main/resources/data/reframedtemplates/recipes/carpet.json rename to src/main/resources/data/reframed/recipes/carpet.json index 850396c..63bbcdb 100644 --- a/src/main/resources/data/reframedtemplates/recipes/carpet.json +++ b/src/main/resources/data/reframed/recipes/carpet.json @@ -13,8 +13,8 @@ } }, "result": { - "item": "reframedtemplates:carpet", + "item": "reframed:carpet", "count": 12 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/cube.json b/src/main/resources/data/reframed/recipes/cube.json similarity index 76% rename from src/main/resources/data/reframedtemplates/recipes/cube.json rename to src/main/resources/data/reframed/recipes/cube.json index e1f988e..58676f1 100644 --- a/src/main/resources/data/reframedtemplates/recipes/cube.json +++ b/src/main/resources/data/reframed/recipes/cube.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:cube", + "item": "reframed:cube", "count": 4 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/door.json b/src/main/resources/data/reframed/recipes/door.json similarity index 76% rename from src/main/resources/data/reframedtemplates/recipes/door.json rename to src/main/resources/data/reframed/recipes/door.json index 57202b7..a1e5e47 100644 --- a/src/main/resources/data/reframedtemplates/recipes/door.json +++ b/src/main/resources/data/reframed/recipes/door.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:door", + "item": "reframed:door", "count": 2 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/fence.json b/src/main/resources/data/reframed/recipes/fence.json similarity index 75% rename from src/main/resources/data/reframedtemplates/recipes/fence.json rename to src/main/resources/data/reframed/recipes/fence.json index 6f0aa4c..70b1da3 100644 --- a/src/main/resources/data/reframedtemplates/recipes/fence.json +++ b/src/main/resources/data/reframed/recipes/fence.json @@ -13,8 +13,8 @@ } }, "result": { - "item": "reframedtemplates:fence", + "item": "reframed:fence", "count": 8 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/fence_gate.json b/src/main/resources/data/reframed/recipes/fence_gate.json similarity index 73% rename from src/main/resources/data/reframedtemplates/recipes/fence_gate.json rename to src/main/resources/data/reframed/recipes/fence_gate.json index 6a53590..c04bd65 100644 --- a/src/main/resources/data/reframedtemplates/recipes/fence_gate.json +++ b/src/main/resources/data/reframed/recipes/fence_gate.json @@ -13,8 +13,8 @@ } }, "result": { - "item": "reframedtemplates:fence_gate", + "item": "reframed:fence_gate", "count": 2 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/iron_door.json b/src/main/resources/data/reframed/recipes/iron_door.json similarity index 79% rename from src/main/resources/data/reframedtemplates/recipes/iron_door.json rename to src/main/resources/data/reframed/recipes/iron_door.json index abaebb3..6456e3d 100644 --- a/src/main/resources/data/reframedtemplates/recipes/iron_door.json +++ b/src/main/resources/data/reframed/recipes/iron_door.json @@ -17,8 +17,8 @@ } }, "result": { - "item": "reframedtemplates:door", + "item": "reframed:door", "count": 2 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/iron_trapdoor.json b/src/main/resources/data/reframed/recipes/iron_trapdoor.json similarity index 77% rename from src/main/resources/data/reframedtemplates/recipes/iron_trapdoor.json rename to src/main/resources/data/reframed/recipes/iron_trapdoor.json index 86a0175..dcccb78 100644 --- a/src/main/resources/data/reframedtemplates/recipes/iron_trapdoor.json +++ b/src/main/resources/data/reframed/recipes/iron_trapdoor.json @@ -17,8 +17,8 @@ } }, "result": { - "item": "reframedtemplates:iron_trapdoor", + "item": "reframed:iron_trapdoor", "count": 4 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/lever.json b/src/main/resources/data/reframed/recipes/lever.json similarity index 79% rename from src/main/resources/data/reframedtemplates/recipes/lever.json rename to src/main/resources/data/reframed/recipes/lever.json index c3d9d05..bfb6d05 100644 --- a/src/main/resources/data/reframedtemplates/recipes/lever.json +++ b/src/main/resources/data/reframed/recipes/lever.json @@ -17,8 +17,8 @@ } }, "result": { - "item": "reframedtemplates:lever", + "item": "reframed:lever", "count": 1 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/pane.json b/src/main/resources/data/reframed/recipes/pane.json similarity index 76% rename from src/main/resources/data/reframedtemplates/recipes/pane.json rename to src/main/resources/data/reframed/recipes/pane.json index 1b7c61f..42bae61 100644 --- a/src/main/resources/data/reframedtemplates/recipes/pane.json +++ b/src/main/resources/data/reframed/recipes/pane.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:pane", + "item": "reframed:pane", "count": 16 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/post.json b/src/main/resources/data/reframed/recipes/post.json similarity index 75% rename from src/main/resources/data/reframedtemplates/recipes/post.json rename to src/main/resources/data/reframed/recipes/post.json index 93e9fa0..0b02992 100644 --- a/src/main/resources/data/reframedtemplates/recipes/post.json +++ b/src/main/resources/data/reframed/recipes/post.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:post", + "item": "reframed:post", "count": 8 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/pressure_plate.json b/src/main/resources/data/reframed/recipes/pressure_plate.json similarity index 72% rename from src/main/resources/data/reframedtemplates/recipes/pressure_plate.json rename to src/main/resources/data/reframed/recipes/pressure_plate.json index 5d85133..710e413 100644 --- a/src/main/resources/data/reframedtemplates/recipes/pressure_plate.json +++ b/src/main/resources/data/reframed/recipes/pressure_plate.json @@ -13,8 +13,8 @@ } }, "result": { - "item": "reframedtemplates:pressure_plate", + "item": "reframed:pressure_plate", "count": 1 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/slab.json b/src/main/resources/data/reframed/recipes/slab.json similarity index 75% rename from src/main/resources/data/reframedtemplates/recipes/slab.json rename to src/main/resources/data/reframed/recipes/slab.json index 06e9a77..2f7a293 100644 --- a/src/main/resources/data/reframedtemplates/recipes/slab.json +++ b/src/main/resources/data/reframed/recipes/slab.json @@ -13,8 +13,8 @@ } }, "result": { - "item": "reframedtemplates:slab", + "item": "reframed:slab", "count": 6 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/stairs.json b/src/main/resources/data/reframed/recipes/stairs.json similarity index 75% rename from src/main/resources/data/reframedtemplates/recipes/stairs.json rename to src/main/resources/data/reframed/recipes/stairs.json index c5d7a95..08af090 100644 --- a/src/main/resources/data/reframedtemplates/recipes/stairs.json +++ b/src/main/resources/data/reframed/recipes/stairs.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:stairs", + "item": "reframed:stairs", "count": 10 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/trapdoor.json b/src/main/resources/data/reframed/recipes/trapdoor.json similarity index 75% rename from src/main/resources/data/reframedtemplates/recipes/trapdoor.json rename to src/main/resources/data/reframed/recipes/trapdoor.json index 4b7cdfd..252bd1f 100644 --- a/src/main/resources/data/reframedtemplates/recipes/trapdoor.json +++ b/src/main/resources/data/reframed/recipes/trapdoor.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:trapdoor", + "item": "reframed:trapdoor", "count": 4 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/recipes/wall.json b/src/main/resources/data/reframed/recipes/wall.json similarity index 76% rename from src/main/resources/data/reframedtemplates/recipes/wall.json rename to src/main/resources/data/reframed/recipes/wall.json index 9360c99..a3ccfbb 100644 --- a/src/main/resources/data/reframedtemplates/recipes/wall.json +++ b/src/main/resources/data/reframed/recipes/wall.json @@ -14,8 +14,8 @@ } }, "result": { - "item": "reframedtemplates:wall", + "item": "reframed:wall", "count": 8 }, - "group": "reframedtemplates" + "group": "reframed" } \ No newline at end of file diff --git a/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json b/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json deleted file mode 100644 index 20d94eb..0000000 --- a/src/main/resources/data/reframedtemplates/advancements/recipes/decorations/templates.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "rewards": { - "recipes": [ - "reframedtemplates:button", - "reframedtemplates:candle", - "reframedtemplates:carpet", - "reframedtemplates:cube", - "reframedtemplates:door", - "reframedtemplates:fence", - "reframedtemplates:fence_gate", - "reframedtemplates:iron_door", - "reframedtemplates:iron_trapdoor", - "reframedtemplates:lever", - "reframedtemplates:pane", - "reframedtemplates:post", - "reframedtemplates:pressure_plate", - "reframedtemplates:slab", - "reframedtemplates:stairs", - "reframedtemplates:trapdoor", - "reframedtemplates:wall" - ] - }, - "criteria": { - "has_bamboo": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "minecraft:bamboo" - } - ] - } - }, - "has_the_recipe": { - "trigger": "minecraft:recipe_unlocked", - "conditions": { - "recipe": "reframedtemplates:slope" - } - } - }, - "requirements": [ - [ - "has_bamboo", - "has_the_recipe" - ] - ] -} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3926f82..88a8a81 100755 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -2,28 +2,28 @@ "schemaVersion": 1, "id": "${mod_id}", "version": "${version}", - "name": "ReFramedBlocks", - "description": "An API for templated blocks", + "name": "ReFramed", + "description": "A remake of forge framed blocks", "authors": [ "Adrien1106" ], "contact": {}, "license": "All-Rights-Reserved", - "icon": "assets/framed-templates-icon.png", + "icon": "assets/reframed-icon.png", "environment": "*", "entrypoints": { "fabric-datagen": [ - "fr.adrien1106.reframedtemplates.generator.Generator" + "fr.adrien1106.reframed.generator.Generator" ], "main": [ - "fr.adrien1106.reframedtemplates.Templates" + "fr.adrien1106.reframed.ReFramed" ], "client": [ - "fr.adrien1106.reframedtemplates.TemplatesClient" + "fr.adrien1106.reframed.client.ReFramedClient" ] }, "mixins": [ - "reframedtemplates.mixins.json" + "reframed.mixins.json" ], "depends": { "minecraft": ">=${minecraft_version}", diff --git a/src/main/resources/reframedtemplates.mixins.json b/src/main/resources/reframed.mixins.json similarity index 89% rename from src/main/resources/reframedtemplates.mixins.json rename to src/main/resources/reframed.mixins.json index aa2e76b..d80641c 100644 --- a/src/main/resources/reframedtemplates.mixins.json +++ b/src/main/resources/reframed.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "fr.adrien1106.reframedtemplates.mixin", + "package": "fr.adrien1106.reframed.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ "MinecraftAccessor",