From 41f4eabb5f197b1471ca1086ec259530038a432c Mon Sep 17 00:00:00 2001 From: Maxx <53229958+MBatt1@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:15:13 -0500 Subject: [PATCH] switch incubus core versions - chests --- gradle.properties | 2 +- .../net/id/paradiselost/ParadiseLost.java | 5 - .../blocks/BlockRegistration.java | 274 ++++++++++++++++++ .../blocks/ParadiseLostBlocks.java | 220 ++++---------- .../blockentity/FoodBowlBlockEntity.java | 19 +- .../blockentity/IncubatorBlockEntity.java | 16 +- .../blockentity/TreeTapBlockEntity.java | 49 ++-- .../blocks/natural/plant/LichenBlock.java | 129 --------- .../blocks/natural/plant/LichenPileBlock.java | 86 ------ .../natural/tree/ParadiseLostLeavesBlock.java | 2 +- .../client/model/ParadiseLostModelLayers.java | 2 - .../client/model/entity/RookModel.java | 80 ----- .../block/IncubatorBlockEntityRenderer.java | 4 +- .../entity/ParadiseLostEntityRenderers.java | 9 - .../entity/misc/RookEyeFeatureRenderer.java | 56 ---- .../rendering/entity/misc/RookRenderer.java | 54 ---- .../entity/projectile/DartRenderer.java | 24 -- .../rendering/ui/BloodstoneHUDRenderer.java | 16 - .../util/ParadiseLostColorProviders.java | 4 +- .../id/paradiselost/commands/LUVCommand.java | 52 ---- .../commands/ParadiseLostCommands.java | 1 - .../net/id/paradiselost/component/LUV.java | 122 -------- .../component/ParadiseLostComponents.java | 3 - .../effect/ParadiseLostStatusEffects.java | 19 -- .../effect/SimmeringStatusEffect.java | 40 --- .../effect/condition/Conditions.java | 33 --- .../effect/condition/VenomCondition.java | 61 ---- .../entities/ParadiseLostEntityTypes.java | 9 - .../entities/hostile/HellenroseEntity.java | 4 +- .../entities/misc/RookEntity.java | 212 -------------- .../entities/passive/moa/MoaEntity.java | 4 +- .../entities/projectile/DartEntity.java | 38 --- .../entities/projectile/PoisonDartEntity.java | 42 --- .../projectile/PoisonNeedleEntity.java | 29 -- .../paradiselost/items/ParadiseLostItems.java | 147 +++++----- .../bloodstone/BloodstoneCapturedData.java | 10 - .../items/utils/ParadiseLostRarity.java | 9 - .../net/id/paradiselost/mixin/Plugin.java | 7 - .../mixin/block/BlockEntityTypeMixin.java | 34 +++ .../render/EntityRenderDispatcherMixin.java | 25 -- .../mixin/entity/EntityMixin.java | 26 +- .../mixin/entity/LivingEntityMixin.java | 24 -- .../paradiselost/mixin/item/AxeItemMixin.java | 2 +- .../paradiselost/mixin/util/RarityMixin.java | 31 -- .../mixin/util/SignTypeAccessor.java | 13 + .../id/paradiselost/util/CompatConfig.java | 12 - .../util/ParadiseLostSignType.java | 9 + .../ParadiseLostTreeConfiguredFeatures.java | 82 +++--- .../ParadiseLostTreePlacedFeatures.java | 8 +- .../generator/AurelTowerGenerator.java | 10 +- src/main/resources/paradise_lost.mixins.json | 4 +- 51 files changed, 563 insertions(+), 1610 deletions(-) create mode 100644 src/main/java/net/id/paradiselost/blocks/BlockRegistration.java delete mode 100644 src/main/java/net/id/paradiselost/blocks/natural/plant/LichenBlock.java delete mode 100644 src/main/java/net/id/paradiselost/blocks/natural/plant/LichenPileBlock.java delete mode 100644 src/main/java/net/id/paradiselost/client/model/entity/RookModel.java delete mode 100644 src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookEyeFeatureRenderer.java delete mode 100644 src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookRenderer.java delete mode 100644 src/main/java/net/id/paradiselost/client/rendering/entity/projectile/DartRenderer.java delete mode 100644 src/main/java/net/id/paradiselost/commands/LUVCommand.java delete mode 100644 src/main/java/net/id/paradiselost/component/LUV.java delete mode 100644 src/main/java/net/id/paradiselost/effect/ParadiseLostStatusEffects.java delete mode 100644 src/main/java/net/id/paradiselost/effect/SimmeringStatusEffect.java delete mode 100644 src/main/java/net/id/paradiselost/effect/condition/Conditions.java delete mode 100644 src/main/java/net/id/paradiselost/effect/condition/VenomCondition.java delete mode 100644 src/main/java/net/id/paradiselost/entities/misc/RookEntity.java delete mode 100644 src/main/java/net/id/paradiselost/entities/projectile/DartEntity.java delete mode 100644 src/main/java/net/id/paradiselost/entities/projectile/PoisonDartEntity.java delete mode 100644 src/main/java/net/id/paradiselost/entities/projectile/PoisonNeedleEntity.java delete mode 100644 src/main/java/net/id/paradiselost/items/utils/ParadiseLostRarity.java create mode 100644 src/main/java/net/id/paradiselost/mixin/block/BlockEntityTypeMixin.java delete mode 100644 src/main/java/net/id/paradiselost/mixin/client/render/EntityRenderDispatcherMixin.java delete mode 100644 src/main/java/net/id/paradiselost/mixin/util/RarityMixin.java create mode 100644 src/main/java/net/id/paradiselost/mixin/util/SignTypeAccessor.java delete mode 100644 src/main/java/net/id/paradiselost/util/CompatConfig.java create mode 100644 src/main/java/net/id/paradiselost/util/ParadiseLostSignType.java diff --git a/gradle.properties b/gradle.properties index 68479eaf8..ed26b15eb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ loaderVersion=0.15.7 javaVersion=17 fabricApiVersion=0.77.0+1.19.2 -incubusCoreVersion=1.9.4 +incubusCoreVersion=2.0.0 customportalapiVersion=0.0.1-beta63.5-1.19.X cardinalComponentsVersion=5.0.1 trinketsVersion=3.4.0 diff --git a/src/main/java/net/id/paradiselost/ParadiseLost.java b/src/main/java/net/id/paradiselost/ParadiseLost.java index bd132c437..d5f56404d 100644 --- a/src/main/java/net/id/paradiselost/ParadiseLost.java +++ b/src/main/java/net/id/paradiselost/ParadiseLost.java @@ -17,8 +17,6 @@ import net.id.paradiselost.client.rendering.util.ParadiseLostColorProviders; import net.id.paradiselost.commands.ParadiseLostCommands; import net.id.paradiselost.config.ParadiseLostConfig; -import net.id.paradiselost.effect.ParadiseLostStatusEffects; -import net.id.paradiselost.effect.condition.Conditions; import net.id.paradiselost.entities.ParadiseLostEntityTypes; import net.id.paradiselost.entities.passive.moa.MoaRaces; import net.id.paradiselost.fluids.ParadiseLostFluids; @@ -83,7 +81,6 @@ public void onInitialize() { ParadiseLostFeatures.init(); ParadiseLostBiomes.init(); ParadiseLostDimension.init(); - ParadiseLostStatusEffects.init(); ParadiseLostBlocks.init(); ParadiseLostFluids.init(); ParadiseLostEntityTypes.init(); @@ -94,7 +91,6 @@ public void onInitialize() { ParadiseLostGameRules.init(); ParadiseLostLootNumberProviderTypes.init(); ParadiseLostSoundEvents.init(); - Conditions.init(); MoaRaces.init(); ParadiseLostScreens.init(); ParadiseLostLore.init(); @@ -123,7 +119,6 @@ public void onInitializeClient() { ParadiseLostBlocks.initClient(); ParadiseLostItemRenderers.initClient(); ParadiseLostScreens.initClient(); - Conditions.clientInit(); ParadiseLostScreens.clientInit(); } diff --git a/src/main/java/net/id/paradiselost/blocks/BlockRegistration.java b/src/main/java/net/id/paradiselost/blocks/BlockRegistration.java new file mode 100644 index 000000000..64e28ffd7 --- /dev/null +++ b/src/main/java/net/id/paradiselost/blocks/BlockRegistration.java @@ -0,0 +1,274 @@ +package net.id.paradiselost.blocks; + +import net.fabricmc.fabric.mixin.lookup.BlockEntityTypeAccessor; +import net.id.incubus_core.util.RegistryQueue; +import net.id.paradiselost.blocks.natural.ParadiseLostSaplingBlock; +import net.id.paradiselost.blocks.natural.tree.FruitingLeavesBlock; +import net.id.paradiselost.blocks.natural.tree.ParadiseLostLeavesBlock; +import net.id.paradiselost.items.ParadiseLostItems; +import net.id.paradiselost.mixin.util.SignTypeAccessor; +import net.id.paradiselost.registry.ParadiseLostRegistryQueues; +import net.id.paradiselost.util.ParadiseLostSignType; +import net.id.paradiselost.world.feature.tree.generator.MotherAurelSaplingGenerator; +import net.id.paradiselost.world.feature.tree.generator.OrangeSaplingGenerator; +import net.minecraft.block.*; +import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.SignType; +import org.jetbrains.annotations.NotNull; + +import java.util.Arrays; +import java.util.Iterator; + +import static net.id.paradiselost.ParadiseLost.MOD_ID; +import static net.id.paradiselost.ParadiseLost.locate; +import static net.id.paradiselost.blocks.ParadiseLostBlockActions.cutoutMippedRenderLayer; +import static net.id.paradiselost.blocks.ParadiseLostBlockActions.cutoutRenderLayer; +import static net.id.paradiselost.blocks.ParadiseLostBlockActions.flammableLeaves; +import static net.id.paradiselost.blocks.ParadiseLostBlockActions.flammableLog; +import static net.id.paradiselost.blocks.ParadiseLostBlockActions.flammablePlanks; +import static net.id.paradiselost.blocks.ParadiseLostBlockActions.stripsTo; + +public class BlockRegistration { + + @SafeVarargs + public static V add(String id, V block, RegistryQueue.Action... additionalActions) { + return ParadiseLostRegistryQueues.BLOCK.add(locate(id), block, additionalActions); + } + + static class ParadiseLostFarmlandBlock extends FarmlandBlock { + ParadiseLostFarmlandBlock(Settings settings) { + super(settings); + } + } + + static class ParadiseLostPaneBlock extends PaneBlock { + ParadiseLostPaneBlock(Settings settings) { + super(settings); + } + } + + static class ParadiseLostStairsBlock extends StairsBlock { + ParadiseLostStairsBlock(BlockState baseBlockState, Settings settings) { + super(baseBlockState, settings); + } + } + + + // WOOD BLOCK SET + + public static WoodBlockSet registerWoodBlockSet(String id, SaplingGenerator saplingGenerator, MapColor woodColor, MapColor barkColor, MapColor leafColor) { + return registerWoodBlockSet( + id+"_sapling", "potted_"+id+"_sapling", + id+"_log", id+"_wood", "stripped_"+id+"_log", "stripped_"+id+"_wood", + id+"_leaves", + id+"_planks", id+"_stairs",id+"_slab", + id+"_fence",id+"_fence_gate", + id+"_door",id+"_trapdoor", + id+"_button",id+"_pressure_plate", + saplingGenerator, woodColor, barkColor, leafColor + ); + } + + public static WoodBlockSet registerWoodBlockSetMotherAurel() { + String id = "mother_aurel"; + var saplingSettings = AbstractBlock.Settings.copy(Blocks.OAK_SAPLING).mapColor(MapColor.GOLD).luminance(state -> 3); + var flowerPotSettings = AbstractBlock.Settings.copy(Blocks.POTTED_OAK_SAPLING).luminance(state -> 3); + var leavesSettings = AbstractBlock.Settings.copy(Blocks.OAK_LEAVES).mapColor(MapColor.GOLD).luminance(state -> 5); + SaplingBlock sapling = add(id+"_sapling", new ParadiseLostSaplingBlock(new MotherAurelSaplingGenerator(), saplingSettings)); + return registerWoodBlockSet( + sapling, + add("potted_"+id+"_sapling", new FlowerPotBlock(sapling, flowerPotSettings)), + id+"_log", id+"_wood", "stripped_"+id+"_log", "stripped_"+id+"_wood", + add(id+"_leaves", new ParadiseLostLeavesBlock(leavesSettings, true), flammableLeaves, cutoutMippedRenderLayer), + id+"_planks", id+"_stairs",id+"_slab", + id+"_fence",id+"_fence_gate", + id+"_door",id+"_trapdoor", + id+"_button",id+"_pressure_plate", + MapColor.GOLD, MapColor.TERRACOTTA_RED + ); + } + + public static WoodBlockSet registerWoodBlockSetOrange() { + String id = "orange"; + var leavesSettings = AbstractBlock.Settings.copy(Blocks.OAK_LEAVES).mapColor(MapColor.PALE_GREEN).sounds(BlockSoundGroup.AZALEA_LEAVES); + FruitingLeavesBlock leaves = add(id+"_leaves", new FruitingLeavesBlock(leavesSettings, () -> ParadiseLostItems.ORANGE), flammableLeaves, cutoutMippedRenderLayer); + return registerWoodBlockSet( + id+"_sapling", "potted_"+id+"_sapling", + id+"_log", id+"_wood", "stripped_"+id+"_log", "stripped_"+id+"_wood", + leaves, + id+"_planks", id+"_stairs",id+"_slab", + id+"_fence",id+"_fence_gate", + id+"_door",id+"_trapdoor", + id+"_button",id+"_pressure_plate", + new OrangeSaplingGenerator(), MapColor.TERRACOTTA_LIGHT_GRAY, MapColor.RAW_IRON_PINK + ); + } + + public static WoodBlockSet registerWoodBlockSetWisteria() { + String id = "wisteria"; + return registerWoodBlockSet( + null, null, + id+"_log", id+"_wood", "stripped_"+id+"_log", "stripped_"+id+"_wood", + null, + id+"_planks", id+"_stairs",id+"_slab", + id+"_fence",id+"_fence_gate", + id+"_door",id+"_trapdoor", + id+"_button",id+"_pressure_plate", + MapColor.PALE_YELLOW, MapColor.BROWN + ); + } + + private static WoodBlockSet registerWoodBlockSet( + String saplingId, String flowerPotId, + String logId, String woodId, String strippedLogId, String strippedWoodId, + String leavesId, + String plankId, String plankStairsId, String plankSlabId, + String fenceId, String fenceGateId, + String doorId, String trapdoorId, + String buttonId, String pressurePlateId, + SaplingGenerator saplingGenerator, MapColor woodColor, MapColor barkColor, MapColor leafColor + ) { + var saplingSettings = AbstractBlock.Settings.copy(Blocks.OAK_SAPLING).mapColor(woodColor); + var flowerPotSettings = AbstractBlock.Settings.copy(Blocks.POTTED_OAK_SAPLING); + var logSettings = AbstractBlock.Settings.copy(Blocks.OAK_LOG).mapColor(barkColor); + var leavesSettings = AbstractBlock.Settings.copy(Blocks.OAK_LEAVES).mapColor(leafColor); + var plankSettings = AbstractBlock.Settings.copy(Blocks.OAK_PLANKS).mapColor(woodColor); + var doorSettings = AbstractBlock.Settings.copy(Blocks.OAK_DOOR).mapColor(woodColor); + var trapdoorSettings = AbstractBlock.Settings.copy(Blocks.OAK_TRAPDOOR).mapColor(woodColor); + var buttonSettings = AbstractBlock.Settings.copy(Blocks.OAK_BUTTON).mapColor(woodColor); + var pressurePlateSettings = AbstractBlock.Settings.copy(Blocks.OAK_PRESSURE_PLATE).mapColor(woodColor); + + + SaplingBlock sapling = add(saplingId, new SaplingBlock(saplingGenerator, saplingSettings), cutoutRenderLayer); + PillarBlock strippedLog = add(strippedLogId, new PillarBlock(logSettings), flammableLog); + PillarBlock strippedWood = add(strippedWoodId, new PillarBlock(logSettings), flammableLog); + Block planks = add(plankId, new Block(plankSettings), flammablePlanks); + return new WoodBlockSet( + sapling, add(flowerPotId, new FlowerPotBlock(sapling, flowerPotSettings)), + add(logId, new PillarBlock(logSettings), flammableLog, stripsTo(strippedLog)), add(woodId, new PillarBlock(logSettings), flammableLog, stripsTo(strippedWood)), strippedLog, strippedWood, + add(leavesId, new LeavesBlock(leavesSettings), flammableLeaves, cutoutMippedRenderLayer), + planks, add(plankStairsId, new ParadiseLostStairsBlock(planks.getDefaultState(), plankSettings), flammablePlanks), add(plankSlabId, new SlabBlock(plankSettings), flammablePlanks), + add(fenceId, new FenceBlock(plankSettings), flammablePlanks), add(fenceGateId, new FenceGateBlock(plankSettings), flammablePlanks), + add(doorId, new DoorBlock(doorSettings)), add(trapdoorId, new TrapdoorBlock(trapdoorSettings)), + add(buttonId, new WoodenButtonBlock(buttonSettings)), add(pressurePlateId, new PressurePlateBlock(PressurePlateBlock.ActivationRule.EVERYTHING, pressurePlateSettings)) + ); + } + + private static WoodBlockSet registerWoodBlockSet( + SaplingBlock sapling, FlowerPotBlock flowerPot, + String logId, String woodId, String strippedLogId, String strippedWoodId, + LeavesBlock leaves, + String plankId, String plankStairsId, String plankSlabId, + String fenceId, String fenceGateId, + String doorId, String trapdoorId, + String buttonId, String pressurePlateId, + MapColor woodColor, MapColor barkColor + ) { + var logSettings = AbstractBlock.Settings.copy(Blocks.OAK_LOG).mapColor(barkColor); + var plankSettings = AbstractBlock.Settings.copy(Blocks.OAK_PLANKS).mapColor(woodColor); + var doorSettings = AbstractBlock.Settings.copy(Blocks.OAK_DOOR).mapColor(woodColor); + var trapdoorSettings = AbstractBlock.Settings.copy(Blocks.OAK_TRAPDOOR).mapColor(woodColor); + var buttonSettings = AbstractBlock.Settings.copy(Blocks.OAK_BUTTON).mapColor(woodColor); + var pressurePlateSettings = AbstractBlock.Settings.copy(Blocks.OAK_PRESSURE_PLATE).mapColor(woodColor); + + PillarBlock strippedLog = add(strippedLogId, new PillarBlock(logSettings), flammableLog); + PillarBlock strippedWood = add(strippedWoodId, new PillarBlock(logSettings), flammableLog); + Block planks = add(plankId, new Block(plankSettings), flammablePlanks); + return new WoodBlockSet( + sapling, flowerPot, + add(logId, new PillarBlock(logSettings), flammableLog, stripsTo(strippedLog)), add(woodId, new PillarBlock(logSettings), flammableLog, stripsTo(strippedWood)), strippedLog, strippedWood, + leaves, + planks, add(plankStairsId, new ParadiseLostStairsBlock(planks.getDefaultState(), plankSettings), flammablePlanks), add(plankSlabId, new SlabBlock(plankSettings), flammablePlanks), + add(fenceId, new FenceBlock(plankSettings), flammablePlanks), add(fenceGateId, new FenceGateBlock(plankSettings), flammablePlanks), + add(doorId, new DoorBlock(doorSettings)), add(trapdoorId, new TrapdoorBlock(trapdoorSettings)), + add(buttonId, new WoodenButtonBlock(buttonSettings)), add(pressurePlateId, new PressurePlateBlock(PressurePlateBlock.ActivationRule.EVERYTHING, pressurePlateSettings)) + ); + } + + private static WoodBlockSet registerWoodBlockSet( + String saplingId, String flowerPotId, + String logId, String woodId, String strippedLogId, String strippedWoodId, + LeavesBlock leaves, + String plankId, String plankStairsId, String plankSlabId, + String fenceId, String fenceGateId, + String doorId, String trapdoorId, + String buttonId, String pressurePlateId, + SaplingGenerator saplingGenerator, MapColor woodColor, MapColor barkColor + ) { + var saplingSettings = AbstractBlock.Settings.copy(Blocks.OAK_SAPLING).mapColor(woodColor); + var flowerPotSettings = AbstractBlock.Settings.copy(Blocks.POTTED_OAK_SAPLING); + var logSettings = AbstractBlock.Settings.copy(Blocks.OAK_LOG).mapColor(barkColor); + var plankSettings = AbstractBlock.Settings.copy(Blocks.OAK_PLANKS).mapColor(woodColor); + var doorSettings = AbstractBlock.Settings.copy(Blocks.OAK_DOOR).mapColor(woodColor); + var trapdoorSettings = AbstractBlock.Settings.copy(Blocks.OAK_TRAPDOOR).mapColor(woodColor); + var buttonSettings = AbstractBlock.Settings.copy(Blocks.OAK_BUTTON).mapColor(woodColor); + var pressurePlateSettings = AbstractBlock.Settings.copy(Blocks.OAK_PRESSURE_PLATE).mapColor(woodColor); + + SaplingBlock sapling = add(saplingId, new SaplingBlock(saplingGenerator, saplingSettings), cutoutRenderLayer); + PillarBlock strippedLog = add(strippedLogId, new PillarBlock(logSettings), flammableLog); + PillarBlock strippedWood = add(strippedWoodId, new PillarBlock(logSettings), flammableLog); + Block planks = add(plankId, new Block(plankSettings), flammablePlanks); + return new WoodBlockSet( + sapling, add(flowerPotId, new FlowerPotBlock(sapling, flowerPotSettings)), + add(logId, new PillarBlock(logSettings), flammableLog, stripsTo(strippedLog)), add(woodId, new PillarBlock(logSettings), flammableLog, stripsTo(strippedWood)), strippedLog, strippedWood, + leaves, + planks, add(plankStairsId, new ParadiseLostStairsBlock(planks.getDefaultState(), plankSettings), flammablePlanks), add(plankSlabId, new SlabBlock(plankSettings), flammablePlanks), + add(fenceId, new FenceBlock(plankSettings), flammablePlanks), add(fenceGateId, new FenceGateBlock(plankSettings), flammablePlanks), + add(doorId, new DoorBlock(doorSettings)), add(trapdoorId, new TrapdoorBlock(trapdoorSettings)), + add(buttonId, new WoodenButtonBlock(buttonSettings)), add(pressurePlateId, new PressurePlateBlock(PressurePlateBlock.ActivationRule.EVERYTHING, pressurePlateSettings)) + ); + } + + public record WoodBlockSet( + SaplingBlock sapling, FlowerPotBlock flowerPot, + PillarBlock log, PillarBlock wood, PillarBlock strippedLog, PillarBlock strippedWood, + LeavesBlock leaves, + Block plank, StairsBlock plankStairs, SlabBlock plankSlab, + FenceBlock fence, FenceGateBlock fenceGate, + DoorBlock door, TrapdoorBlock trapdoor, + WoodenButtonBlock button, PressurePlateBlock pressurePlate + ) implements Iterable { + public @NotNull Iterator iterator() { + return Arrays.stream(new Block[]{ + sapling, flowerPot, + log, wood, strippedLog, strippedWood, + leaves, + plank, plankStairs, plankSlab, + fence, fenceGate, + door, trapdoor, + button, pressurePlate + }).iterator(); + } + } + + // SIGN SET + + public static SignSet registerSignSet(String woodId) { + SignType signType = SignTypeAccessor.callRegister(new ParadiseLostSignType(MOD_ID + "_" + woodId)); + + var signSettings = AbstractBlock.Settings.copy(Blocks.OAK_SIGN); + + SignBlock signBlock = new SignBlock(signSettings, signType); + WallSignBlock wallSignBlock = new WallSignBlock(signSettings.dropsLike(signBlock), signType); + + ((BlockEntityTypeAccessor) BlockEntityType.SIGN).getBlocks().add(signBlock); + ((BlockEntityTypeAccessor) BlockEntityType.SIGN).getBlocks().add(wallSignBlock); + + add(woodId + "_sign", signBlock); + add(woodId + "_wall_sign", wallSignBlock); + + return new SignSet(signType, signBlock, wallSignBlock); + } + + public record SignSet( + SignType type, + SignBlock sign, + WallSignBlock wallSign + ) implements Iterable { + public @NotNull Iterator iterator() { + return Arrays.stream(new Block[]{sign, wallSign}).iterator(); + } + } +} diff --git a/src/main/java/net/id/paradiselost/blocks/ParadiseLostBlocks.java b/src/main/java/net/id/paradiselost/blocks/ParadiseLostBlocks.java index 7ae9ea8ec..8c8170fdc 100644 --- a/src/main/java/net/id/paradiselost/blocks/ParadiseLostBlocks.java +++ b/src/main/java/net/id/paradiselost/blocks/ParadiseLostBlocks.java @@ -2,7 +2,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.id.incubus_core.woodtypefactory.api.chest.ChestFactory; import net.id.paradiselost.ParadiseLost; import net.id.paradiselost.blocks.decorative.*; import net.id.paradiselost.blocks.mechanical.CherineCampfireBlock; @@ -32,17 +31,16 @@ import net.id.paradiselost.tag.ParadiseLostBlockTags; import net.id.paradiselost.world.feature.tree.generator.*; import net.id.incubus_core.util.RegistryQueue.Action; -import net.id.incubus_core.woodtypefactory.api.WoodSettingsFactory; -import net.id.incubus_core.woodtypefactory.api.WoodTypeFactory; import net.minecraft.block.*; import net.minecraft.block.AbstractBlock.Settings; +import net.minecraft.client.render.TexturedRenderLayers; +import net.minecraft.client.util.SpriteIdentifier; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.state.property.Properties; import net.minecraft.tag.BlockTags; +import net.minecraft.util.Identifier; import net.minecraft.util.math.intprovider.UniformIntProvider; import net.minecraft.util.registry.Registry; - import java.util.List; import static net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings.copy; @@ -50,6 +48,7 @@ import static net.id.paradiselost.ParadiseLost.locate; import static net.id.paradiselost.blocks.ParadiseLostBlockActions.*; import static net.minecraft.block.Blocks.*; +import static net.id.paradiselost.blocks.BlockRegistration.*; @SuppressWarnings("unused") public class ParadiseLostBlocks { @@ -178,119 +177,53 @@ protected static Settings flowerPot() { public static final CampfireBlock CHERINE_CAMPFIRE = add("cherine_campfire", new CherineCampfireBlock(false, 1, Settings.copy(CAMPFIRE)), cutoutRenderLayer); + protected static Settings leafPile() { + return of(Material.REPLACEABLE_PLANT).strength(0.2f).sounds(BlockSoundGroup.VINE).nonOpaque().suffocates(never).blockVision(never); + } // Aurel Wood - private static final WoodSettingsFactory aurelColors = new WoodSettingsFactory(MapColor.DARK_RED, MapColor.DARK_RED); - public static final WoodTypeFactory AUREL = new WoodTypeFactory(aurelColors, locate("aurel"), new AurelSaplingGenerator()); - public static final ChestFactory AUREL_CHEST_FACTORY = new ChestFactory(ParadiseLost.MOD_ID, "skyroot", AUREL.settings.chest()); - - - public static final SaplingBlock AUREL_SAPLING = AUREL.sapling(); - public static final FlowerPotBlock POTTED_AUREL_SAPLING = AUREL.pottedSapling(); - public static final PillarBlock AUREL_LOG = AUREL.log(); - public static final PillarBlock AUREL_WOOD = AUREL.wood(); - public static final PillarBlock STRIPPED_AUREL_LOG = AUREL.strippedLog(); - public static final PillarBlock STRIPPED_AUREL_WOOD = AUREL.strippedWood(); - public static final PillarBlock MOTTLED_AUREL_LOG = add("mottled_aurel_log", new PillarBlock(aurelColors.log()), flammableLog, stripsTo(STRIPPED_AUREL_LOG)); - public static final ChuteBlock MOTTLED_AUREL_FALLEN_LOG = add("mottled_aurel_fallen_log", new ChuteBlock(aurelColors.log()), flammableLog, cutoutRenderLayer); - public static final LeavesBlock AUREL_LEAVES = AUREL.leaves(); - public static final LeafPileBlock AUREL_LEAF_PILE = add("aurel_leaf_pile", new LeafPileBlock(aurelColors.leafPile()), flammableLeaves, cutoutMippedRenderLayer); - public static final Block AUREL_PLANKS = AUREL.planks(); - public static final Block AUREL_BOOKSHELF = add("aurel_bookshelf", new Block(copy(BOOKSHELF).mapColor(aurelColors.plankColor())), flammable(30, 20)); - public static final FenceBlock AUREL_FENCE = AUREL.fence(); - public static final FenceGateBlock AUREL_FENCE_GATE = AUREL.fenceGate(); - public static final SlabBlock AUREL_SLAB = AUREL.slab(); - public static final StairsBlock AUREL_STAIRS = AUREL.stairs(); - public static final TrapdoorBlock AUREL_TRAPDOOR = AUREL.trapdoor(); - public static final DoorBlock AUREL_DOOR = AUREL.door(); - public static final WoodenButtonBlock AUREL_BUTTON = AUREL.button(); - public static final PressurePlateBlock AUREL_PRESSURE_PLATE = AUREL.pressurePlate(); - public static final SignBlock AUREL_SIGN = AUREL.signFactory().signBlock; - public static final WallSignBlock AUREL_WALL_SIGN = AUREL.signFactory().wallSignBlock; + public static final WoodBlockSet AUREL_WOODSTUFF = registerWoodBlockSet("aurel", new AurelSaplingGenerator(), MapColor.DARK_RED, MapColor.DARK_RED, MapColor.PALE_GREEN); + public static final PillarBlock MOTTLED_AUREL_LOG = add("mottled_aurel_log", new PillarBlock(copy(OAK_LOG).mapColor(MapColor.DARK_RED)), flammableLog, stripsTo(AUREL_WOODSTUFF.strippedLog())); + public static final ChuteBlock MOTTLED_AUREL_FALLEN_LOG = add("mottled_aurel_fallen_log", new ChuteBlock(copy(OAK_LOG).mapColor(MapColor.DARK_RED)), flammableLog, cutoutRenderLayer); + public static final LeafPileBlock AUREL_LEAF_PILE = add("aurel_leaf_pile", new LeafPileBlock(leafPile().mapColor(MapColor.PALE_GREEN)), flammableLeaves, cutoutMippedRenderLayer); + public static final Block AUREL_BOOKSHELF = add("aurel_bookshelf", new Block(copy(BOOKSHELF).mapColor(MapColor.DARK_RED)), flammable(30, 20)); + public static final SignSet AUREL_SIGNS = registerSignSet("aurel"); // Mother Aurel Wood - private static final WoodSettingsFactory motherAurelColors = new WoodSettingsFactory(MapColor.OAK_TAN, MapColor.TERRACOTTA_RED, MapColor.GOLD, MapColor.TERRACOTTA_RED); - public static final WoodTypeFactory MOTHER_AUREL = new WoodTypeFactory(motherAurelColors, locate("mother_aurel")); - public static final ChestFactory MOTHER_AUREL_CHEST_FACTORY = new ChestFactory(ParadiseLost.MOD_ID, "golden_oak", MOTHER_AUREL.settings.chest()); - - public static final SaplingBlock MOTHER_AUREL_SAPLING = add("mother_aurel_sapling", new ParadiseLostSaplingBlock(new MotherAurelSaplingGenerator(), motherAurelColors.sapling().luminance(state -> 7)), cutoutRenderLayer); - public static final FlowerPotBlock POTTED_MOTHER_AUREL_SAPLING = add("potted_mother_aurel_sapling", new FlowerPotBlock(MOTHER_AUREL_SAPLING, flowerPot().luminance(state -> 7)), cutoutRenderLayer); - public static final PillarBlock MOTHER_AUREL_LOG = MOTHER_AUREL.log(); - public static final PillarBlock MOTHER_AUREL_WOOD = MOTHER_AUREL.wood(); - public static final PillarBlock STRIPPED_MOTHER_AUREL_LOG = MOTHER_AUREL.strippedLog(); - public static final PillarBlock STRIPPED_MOTHER_AUREL_WOOD = MOTHER_AUREL.strippedWood(); - public static final ParadiseLostLeavesBlock MOTHER_AUREL_LEAVES = add("mother_aurel_leaves", new ParadiseLostLeavesBlock(motherAurelColors.leaves().luminance((value -> 11)), true), flammableLeaves, cutoutMippedRenderLayer); - public static final Block MOTHER_AUREL_PLANKS = MOTHER_AUREL.planks(); - public static final FenceBlock MOTHER_AUREL_FENCE = MOTHER_AUREL.fence(); - public static final FenceGateBlock MOTHER_AUREL_FENCE_GATE = MOTHER_AUREL.fenceGate(); - public static final SlabBlock MOTHER_AUREL_SLAB = MOTHER_AUREL.slab(); - public static final StairsBlock MOTHER_AUREL_STAIRS = MOTHER_AUREL.stairs(); - public static final TrapdoorBlock MOTHER_AUREL_TRAPDOOR = MOTHER_AUREL.trapdoor(); - public static final DoorBlock MOTHER_AUREL_DOOR = MOTHER_AUREL.door(); - public static final WoodenButtonBlock MOTHER_AUREL_BUTTON = MOTHER_AUREL.button(); - public static final PressurePlateBlock MOTHER_AUREL_PRESSURE_PLATE = MOTHER_AUREL.pressurePlate(); - public static final SignBlock MOTHER_AUREL_SIGN = MOTHER_AUREL.signFactory().signBlock; - public static final WallSignBlock MOTHER_AUREL_WALL_SIGN = MOTHER_AUREL.signFactory().wallSignBlock; + public static final WoodBlockSet MOTHER_AUREL_WOODSTUFF = registerWoodBlockSetMotherAurel(); + public static final SignSet MOTHER_AUREL_SIGNS = registerSignSet("mother_aurel"); // Orange Wood - private static final WoodSettingsFactory orangeColors = new WoodSettingsFactory(MapColor.RAW_IRON_PINK, MapColor.TERRACOTTA_LIGHT_GRAY, MapColor.GREEN); - public static final WoodTypeFactory ORANGE = new WoodTypeFactory(orangeColors, locate("orange"), new OrangeSaplingGenerator()); - - public static final SaplingBlock ORANGE_SAPLING = ORANGE.sapling(); - public static final FlowerPotBlock POTTED_ORANGE_SAPLING = ORANGE.pottedSapling(); - public static final PillarBlock ORANGE_LOG = ORANGE.log(); - public static final PillarBlock ORANGE_WOOD = ORANGE.wood(); - public static final PillarBlock STRIPPED_ORANGE_LOG = ORANGE.strippedLog(); - public static final PillarBlock STRIPPED_ORANGE_WOOD = ORANGE.strippedWood(); - public static final FruitingLeavesBlock ORANGE_LEAVES = add("orange_leaves", new FruitingLeavesBlock(orangeColors.leaves().sounds(BlockSoundGroup.AZALEA_LEAVES), () -> ParadiseLostItems.ORANGE), flammableLeaves, cutoutMippedRenderLayer); - public static final Block ORANGE_PLANKS = ORANGE.planks(); - public static final FenceBlock ORANGE_FENCE = ORANGE.fence(); - public static final FenceGateBlock ORANGE_FENCE_GATE = ORANGE.fenceGate(); - public static final SlabBlock ORANGE_SLAB = ORANGE.slab(); - public static final StairsBlock ORANGE_STAIRS = ORANGE.stairs(); - public static final TrapdoorBlock ORANGE_TRAPDOOR = ORANGE.trapdoor(); - public static final DoorBlock ORANGE_DOOR = ORANGE.door(); - public static final WoodenButtonBlock ORANGE_BUTTON = ORANGE.button(); - public static final PressurePlateBlock ORANGE_PRESSURE_PLATE = ORANGE.pressurePlate(); - public static final SignBlock ORANGE_SIGN = ORANGE.signFactory().signBlock; - public static final WallSignBlock ORANGE_WALL_SIGN = ORANGE.signFactory().wallSignBlock; + public static final WoodBlockSet ORANGE_WOODSTUFF = registerWoodBlockSetOrange(); + public static final SignSet ORANGE_SIGNS = registerSignSet("orange"); // Wisteria Wood - private static final WoodSettingsFactory wisteriaColors = new WoodSettingsFactory(MapColor.PALE_YELLOW, MapColor.BROWN); - public static final WoodTypeFactory WISTERIA = new WoodTypeFactory(wisteriaColors, locate("wisteria")); - - public static final PillarBlock WISTERIA_LOG = WISTERIA.log(); - public static final PillarBlock WISTERIA_WOOD = WISTERIA.wood(); - public static final PillarBlock STRIPPED_WISTERIA_LOG = WISTERIA.strippedLog(); - public static final PillarBlock STRIPPED_WISTERIA_WOOD = WISTERIA.strippedWood(); - public static final Block WISTERIA_PLANKS = WISTERIA.planks(); - public static final FenceBlock WISTERIA_FENCE = WISTERIA.fence(); - public static final FenceGateBlock WISTERIA_FENCE_GATE = WISTERIA.fenceGate(); - public static final SlabBlock WISTERIA_SLAB = WISTERIA.slab(); - public static final StairsBlock WISTERIA_STAIRS = WISTERIA.stairs(); - public static final TrapdoorBlock WISTERIA_TRAPDOOR = WISTERIA.trapdoor(); - public static final DoorBlock WISTERIA_DOOR = WISTERIA.door(); - public static final WoodenButtonBlock WISTERIA_BUTTON = WISTERIA.button(); - public static final PressurePlateBlock WISTERIA_PRESSURE_PLATE = WISTERIA.pressurePlate(); - public static final SignBlock WISTERIA_SIGN = WISTERIA.signFactory().signBlock; - public static final WallSignBlock WISTERIA_WALL_SIGN = WISTERIA.signFactory().wallSignBlock; - - private static final WoodSettingsFactory roseWisteriaColors = wisteriaColors.withLeafColor(MapColor.PINK); - public static final WisteriaLeavesBlock ROSE_WISTERIA_LEAVES = add("rose_wisteria_leaves", new WisteriaLeavesBlock(roseWisteriaColors.noCollideLeaves(), false), flammableLeaves, cutoutMippedRenderLayer); - public static final LeafPileBlock ROSE_WISTERIA_LEAF_PILE = add("rose_wisteria_leaf_pile", new LeafPileBlock(roseWisteriaColors.leafPile()), flammableLeaves, cutoutMippedRenderLayer); - public static final SaplingBlock ROSE_WISTERIA_SAPLING = add("rose_wisteria_sapling", new ParadiseLostSaplingBlock(new RoseWisteriaSaplingGenerator(), roseWisteriaColors.sapling()), cutoutRenderLayer); + public static final WoodBlockSet WISTERIA_WOODSTUFF = registerWoodBlockSetWisteria(); + public static final SignSet WISTERIA_SIGNS = registerSignSet("wisteria"); + + protected static Settings wisteriaLeaf() { + return copy(OAK_LEAVES); + } + protected static Settings wisteriaHanger() { + return of(Material.DECORATION).strength(0.2f).noCollision().breakInstantly().sounds(BlockSoundGroup.GRASS).suffocates(never).blockVision(never); + } + protected static Settings wisteriaSapling() { + return copy(Blocks.OAK_SAPLING); + } + + public static final WisteriaLeavesBlock ROSE_WISTERIA_LEAVES = add("rose_wisteria_leaves", new WisteriaLeavesBlock(wisteriaLeaf().mapColor(MapColor.PINK), false), flammableLeaves, cutoutMippedRenderLayer); + public static final LeafPileBlock ROSE_WISTERIA_LEAF_PILE = add("rose_wisteria_leaf_pile", new LeafPileBlock(leafPile().mapColor(MapColor.PINK)), flammableLeaves, cutoutMippedRenderLayer); + public static final SaplingBlock ROSE_WISTERIA_SAPLING = add("rose_wisteria_sapling", new ParadiseLostSaplingBlock(new RoseWisteriaSaplingGenerator(), wisteriaSapling().mapColor(MapColor.PINK)), cutoutRenderLayer); public static final FlowerPotBlock POTTED_ROSE_WISTERIA_SAPLING = add("potted_rose_wisteria_sapling", new FlowerPotBlock(ROSE_WISTERIA_SAPLING, flowerPot()), cutoutRenderLayer); - public static final ParadiseLostHangerBlock ROSE_WISTERIA_HANGER = add("rose_wisteria_hanger", new ParadiseLostHangerBlock(roseWisteriaColors.hanger()), flammableLeaves, cutoutRenderLayer); + public static final ParadiseLostHangerBlock ROSE_WISTERIA_HANGER = add("rose_wisteria_hanger", new ParadiseLostHangerBlock(wisteriaHanger().mapColor(MapColor.PINK)), flammableLeaves, cutoutRenderLayer); - private static final WoodSettingsFactory frostWisteriaColors = wisteriaColors.withLeafColor(MapColor.LIGHT_BLUE); - public static final WisteriaLeavesBlock FROST_WISTERIA_LEAVES = add("frost_wisteria_leaves", new WisteriaLeavesBlock(frostWisteriaColors.noCollideLeaves(), false), flammableLeaves, cutoutMippedRenderLayer); - public static final LeafPileBlock FROST_WISTERIA_LEAF_PILE = add("frost_wisteria_leaf_pile", new LeafPileBlock(frostWisteriaColors.leafPile()), flammableLeaves, cutoutMippedRenderLayer); - public static final SaplingBlock FROST_WISTERIA_SAPLING = add("frost_wisteria_sapling", new ParadiseLostSaplingBlock(new FrostWisteriaSaplingGenerator(), frostWisteriaColors.sapling()), cutoutRenderLayer); + public static final WisteriaLeavesBlock FROST_WISTERIA_LEAVES = add("frost_wisteria_leaves", new WisteriaLeavesBlock(wisteriaLeaf().mapColor(MapColor.LIGHT_BLUE), false), flammableLeaves, cutoutMippedRenderLayer); + public static final LeafPileBlock FROST_WISTERIA_LEAF_PILE = add("frost_wisteria_leaf_pile", new LeafPileBlock(leafPile().mapColor(MapColor.LIGHT_BLUE)), flammableLeaves, cutoutMippedRenderLayer); + public static final SaplingBlock FROST_WISTERIA_SAPLING = add("frost_wisteria_sapling", new ParadiseLostSaplingBlock(new FrostWisteriaSaplingGenerator(), wisteriaSapling().mapColor(MapColor.LIGHT_BLUE)), cutoutRenderLayer); public static final FlowerPotBlock POTTED_FROST_WISTERIA_SAPLING = add("potted_frost_wisteria_sapling", new FlowerPotBlock(FROST_WISTERIA_SAPLING, flowerPot()), cutoutRenderLayer); - public static final ParadiseLostHangerBlock FROST_WISTERIA_HANGER = add("frost_wisteria_hanger", new ParadiseLostHangerBlock(frostWisteriaColors.hanger()), flammableLeaves, cutoutRenderLayer); + public static final ParadiseLostHangerBlock FROST_WISTERIA_HANGER = add("frost_wisteria_hanger", new ParadiseLostHangerBlock(wisteriaHanger().mapColor(MapColor.LIGHT_BLUE)), flammableLeaves, cutoutRenderLayer); - private static final WoodSettingsFactory lavenderWisteriaColors = wisteriaColors.withLeafColor(MapColor.MAGENTA); - public static final WisteriaLeavesBlock LAVENDER_WISTERIA_LEAVES = add("lavender_wisteria_leaves", new WisteriaLeavesBlock(lavenderWisteriaColors.noCollideLeaves(), false), flammableLeaves, cutoutMippedRenderLayer); - public static final LeafPileBlock LAVENDER_WISTERIA_LEAF_PILE = add("lavender_wisteria_leaf_pile", new LeafPileBlock(lavenderWisteriaColors.leafPile()), flammableLeaves, cutoutMippedRenderLayer); - public static final SaplingBlock LAVENDER_WISTERIA_SAPLING = add("lavender_wisteria_sapling", new ParadiseLostSaplingBlock(new LavenderWisteriaSaplingGenerator(), lavenderWisteriaColors.sapling()), cutoutRenderLayer); + public static final WisteriaLeavesBlock LAVENDER_WISTERIA_LEAVES = add("lavender_wisteria_leaves", new WisteriaLeavesBlock(wisteriaLeaf().mapColor(MapColor.MAGENTA), false), flammableLeaves, cutoutMippedRenderLayer); + public static final LeafPileBlock LAVENDER_WISTERIA_LEAF_PILE = add("lavender_wisteria_leaf_pile", new LeafPileBlock(leafPile().mapColor(MapColor.MAGENTA)), flammableLeaves, cutoutMippedRenderLayer); + public static final SaplingBlock LAVENDER_WISTERIA_SAPLING = add("lavender_wisteria_sapling", new ParadiseLostSaplingBlock(new LavenderWisteriaSaplingGenerator(), wisteriaSapling().mapColor(MapColor.MAGENTA)), cutoutRenderLayer); public static final FlowerPotBlock POTTED_LAVENDER_WISTERIA_SAPLING = add("potted_lavender_wisteria_sapling", new FlowerPotBlock(LAVENDER_WISTERIA_SAPLING, flowerPot()), cutoutRenderLayer); - public static final ParadiseLostHangerBlock LAVENDER_WISTERIA_HANGER = add("lavender_wisteria_hanger", new ParadiseLostHangerBlock(lavenderWisteriaColors.hanger()), flammableLeaves, cutoutRenderLayer); + public static final ParadiseLostHangerBlock LAVENDER_WISTERIA_HANGER = add("lavender_wisteria_hanger", new ParadiseLostHangerBlock(wisteriaHanger().mapColor(MapColor.MAGENTA)), flammableLeaves, cutoutRenderLayer); // Grasses private static Settings shrub() { @@ -390,70 +323,29 @@ private static Settings cherineTorch() { // public static final DungeonSwitchBlock DUNGEON_SWITCH = add("dungeonswitch", new DungeonSwitchBlock(of(Material.METAL, MapColor.BLUE).strength(-1.0F, 3600000.0F))); // Chests - public static final ChestFactory CRYSTAL_CHEST_FACTORY = new ChestFactory(ParadiseLost.MOD_ID, "crystal", AUREL.settings.chest()); - - public static final ChestBlock CRYSTAL_CHEST = add("crystal_chest", CRYSTAL_CHEST_FACTORY.chest); - public static final ChestBlock MOTHER_AUREL_CHEST = add("golden_oak_chest", MOTHER_AUREL_CHEST_FACTORY.chest); - public static final ChestBlock ORANGE_CHEST = ORANGE.chestFactory().chest; - public static final ChestBlock AUREL_CHEST = add("skyroot_chest", AUREL_CHEST_FACTORY.chest); - public static final ChestBlock WISTERIA_CHEST = WISTERIA.chestFactory().chest; - - @SafeVarargs - private static V add(String id, V block, Action... additionalActions) { - return ParadiseLostRegistryQueues.BLOCK.add(locate(id), block, additionalActions); - } - - /* - This is the same thing the add method above, but it doesn't wait to register or perform the actions. - This is required because some block settings code uses ID caches, so without it some blocks - behave like air. - */ - @SafeVarargs - private static T addImmediately(String name, T block, Action... actions) { - var id = locate(name); - Registry.register(Registry.BLOCK, id, block); - for (var action : actions) { - action.accept(id, block); - } - return block; - } +// public static final ChestBlock CRYSTAL_CHEST = add("crystal_chest", CRYSTAL_CHEST_FACTORY.chest); +// public static final ChestBlock MOTHER_AUREL_CHEST = add("golden_oak_chest", MOTHER_AUREL_CHEST_FACTORY.chest); +// public static final ChestBlock ORANGE_CHEST = ORANGE.chestFactory().chest; +// public static final ChestBlock AUREL_CHEST = add("skyroot_chest", AUREL_CHEST_FACTORY.chest); +// public static final ChestBlock WISTERIA_CHEST = WISTERIA.chestFactory().chest; public static void init() { ParadiseLostRegistryQueues.BLOCK.register(); - - for (var woodType : List.of(AUREL, MOTHER_AUREL, ORANGE, WISTERIA)) { - woodType.registerCreatedBlocks(); - woodType.registerFlammability(); - woodType.registerStripping(); - } } @Environment(EnvType.CLIENT) public static void initClient() { - for (var woodType : List.of(AUREL, MOTHER_AUREL, ORANGE, WISTERIA)) { - woodType.registerBlockEntityRenderers(); - woodType.registerRenderLayers(); + for (var signSet : List.of(AUREL_SIGNS, MOTHER_AUREL_SIGNS, ORANGE_SIGNS, WISTERIA_SIGNS)) { + TexturedRenderLayers.WOOD_TYPE_TEXTURES.put( + signSet.type(), new SpriteIdentifier( + TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, new Identifier("entity/signs/" + signSet.type().getName()) + ) + ); } - AUREL_CHEST_FACTORY.registerChestRenderers(); - MOTHER_AUREL_CHEST_FACTORY.registerChestRenderers(); - CRYSTAL_CHEST_FACTORY.registerChestRenderers(); +// AUREL_CHEST_FACTORY.registerChestRenderers(); +// MOTHER_AUREL_CHEST_FACTORY.registerChestRenderers(); +// CRYSTAL_CHEST_FACTORY.registerChestRenderers(); } - private static class ParadiseLostFarmlandBlock extends FarmlandBlock { - ParadiseLostFarmlandBlock(Settings settings) { - super(settings); - } - } - private static class ParadiseLostPaneBlock extends PaneBlock { - ParadiseLostPaneBlock(Settings settings) { - super(settings); - } - } - - private static class ParadiseLostStairsBlock extends StairsBlock { - ParadiseLostStairsBlock(BlockState baseBlockState, Settings settings) { - super(baseBlockState, settings); - } - } } diff --git a/src/main/java/net/id/paradiselost/blocks/blockentity/FoodBowlBlockEntity.java b/src/main/java/net/id/paradiselost/blocks/blockentity/FoodBowlBlockEntity.java index a337025a5..a5ce68234 100644 --- a/src/main/java/net/id/paradiselost/blocks/blockentity/FoodBowlBlockEntity.java +++ b/src/main/java/net/id/paradiselost/blocks/blockentity/FoodBowlBlockEntity.java @@ -1,7 +1,6 @@ package net.id.paradiselost.blocks.blockentity; import net.id.paradiselost.blocks.mechanical.FoodBowlBlock; -import net.id.incubus_core.be.InventoryBlockEntity; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.ItemEntity; @@ -15,7 +14,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class FoodBowlBlockEntity extends BlockEntity implements InventoryBlockEntity { +public class FoodBowlBlockEntity extends BlockEntity { private final DefaultedList inventory; public FoodBowlBlockEntity(BlockPos pos, BlockState state) { @@ -57,19 +56,7 @@ private void updateState() { world.setBlockState(pos, getCachedState().with(FoodBowlBlock.FULL, !inventory.get(0).isEmpty())); } - @Override - public @NotNull HopperStrategy getHopperStrategy() { - return HopperStrategy.IN_ANY_OUT_BOTTOM; - } - - @SuppressWarnings("ConstantConditions") - @Override - public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir) { - return InventoryBlockEntity.super.canInsert(slot, stack, dir) && stack.isFood() && stack.getItem().getFoodComponent().isMeat(); - } - - @Override - public DefaultedList getItems() { - return inventory; + public ItemStack getContainedItem() { + return inventory.get(0); } } diff --git a/src/main/java/net/id/paradiselost/blocks/blockentity/IncubatorBlockEntity.java b/src/main/java/net/id/paradiselost/blocks/blockentity/IncubatorBlockEntity.java index 133cbadaa..1fe15fa74 100644 --- a/src/main/java/net/id/paradiselost/blocks/blockentity/IncubatorBlockEntity.java +++ b/src/main/java/net/id/paradiselost/blocks/blockentity/IncubatorBlockEntity.java @@ -3,7 +3,6 @@ import net.id.paradiselost.component.MoaGenes; import net.id.paradiselost.items.ParadiseLostItems; import net.id.paradiselost.util.ParadiseLostSoundEvents; -import net.id.incubus_core.be.InventoryBlockEntity; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; @@ -18,7 +17,7 @@ import java.util.UUID; -public class IncubatorBlockEntity extends BlockEntity implements InventoryBlockEntity { +public class IncubatorBlockEntity extends BlockEntity { private UUID owner; private int hatchTicks = 100; @@ -52,9 +51,12 @@ public void handleUse(PlayerEntity player, Hand hand, ItemStack handStack) { hatchTicks = (int) (12000 / world.getBiome(pos).value().getTemperature()); } - @Override - public DefaultedList getItems() { - return inventory; + public boolean hasItem() { + return !inventory.isEmpty(); + } + + public ItemStack getItem() { + return inventory.get(0); } @Override @@ -69,8 +71,4 @@ public void readNbt(NbtCompound nbt) { hatchTicks = nbt.getInt("hatchTicks"); } - @Override - public @NotNull HopperStrategy getHopperStrategy() { - return HopperStrategy.ALL_PASS; - } } diff --git a/src/main/java/net/id/paradiselost/blocks/blockentity/TreeTapBlockEntity.java b/src/main/java/net/id/paradiselost/blocks/blockentity/TreeTapBlockEntity.java index b0f0d80f0..7279887c9 100644 --- a/src/main/java/net/id/paradiselost/blocks/blockentity/TreeTapBlockEntity.java +++ b/src/main/java/net/id/paradiselost/blocks/blockentity/TreeTapBlockEntity.java @@ -1,12 +1,13 @@ package net.id.paradiselost.blocks.blockentity; -import net.id.incubus_core.be.InventoryBlockEntity; import net.id.paradiselost.recipe.ParadiseLostRecipeTypes; import net.id.paradiselost.recipe.TreeTapRecipe; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.HopperBlockEntity; +import net.minecraft.block.entity.LootableContainerBlockEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Inventories; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; @@ -14,20 +15,21 @@ import net.minecraft.network.Packet; import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; +import net.minecraft.screen.ScreenHandler; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.state.property.Properties; +import net.minecraft.text.Text; import net.minecraft.util.Hand; import net.minecraft.util.collection.DefaultedList; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Optional; -public class TreeTapBlockEntity extends BlockEntity implements InventoryBlockEntity { +public class TreeTapBlockEntity extends LootableContainerBlockEntity { private final DefaultedList inventory; @@ -47,24 +49,13 @@ public void handleUse(PlayerEntity player, Hand hand, ItemStack handStack) { markDirty(); } - @Override - public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir) { - return this.getHopperStrategy().canInsert(dir) && this.inventory.get(0).isEmpty(); - } - - @Override - public boolean canExtract(int slot, ItemStack stack, Direction dir) { - return this.getHopperStrategy().canExtract(dir); - } - - @Override - public @NotNull HopperStrategy getHopperStrategy() { - return HopperStrategy.IN_ANY; + public DefaultedList getItems() { + return inventory; } @Override - public DefaultedList getItems() { - return inventory; + public int size() { + return 1; } @Override @@ -76,6 +67,16 @@ public void setStack(int slot, ItemStack stack) { inventoryChanged(); } + @Override + protected DefaultedList getInvStackList() { + return null; + } + + @Override + protected void setInvStackList(DefaultedList list) { + + } + private void inventoryChanged() { markDirty(); if (world != null && !world.isClient) updateInClientWorld(); @@ -94,7 +95,17 @@ public void writeNbt(NbtCompound nbt) { Inventories.writeNbt(nbt, inventory); } - public BlockState getTappedState() { + @Override + protected Text getContainerName() { + return null; + } + + @Override + protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory) { + return null; + } + + public BlockState getTappedState() { return this.world.getBlockState(this.pos.offset(getCachedState().get(Properties.HORIZONTAL_FACING).getOpposite())); } diff --git a/src/main/java/net/id/paradiselost/blocks/natural/plant/LichenBlock.java b/src/main/java/net/id/paradiselost/blocks/natural/plant/LichenBlock.java deleted file mode 100644 index a623ea9a7..000000000 --- a/src/main/java/net/id/paradiselost/blocks/natural/plant/LichenBlock.java +++ /dev/null @@ -1,129 +0,0 @@ -package net.id.paradiselost.blocks.natural.plant; - -import net.id.incubus_core.condition.api.ConditionAPI; -import net.id.incubus_core.condition.api.Persistence; -import net.id.incubus_core.condition.base.ConditionManager; -import net.id.paradiselost.effect.condition.Conditions; -import net.id.paradiselost.tag.ParadiseLostBlockTags; -import net.id.paradiselost.util.ParadiseLostSoundEvents; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.FallingBlock; -import net.minecraft.block.ShapeContext; -import net.minecraft.block.piston.PistonBehavior; -import net.minecraft.entity.Entity; -import net.minecraft.entity.FallingBlockEntity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.sound.SoundCategory; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.BooleanProperty; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.random.Random; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import net.minecraft.world.World; - -public class LichenBlock extends FallingBlock { - - public static final BooleanProperty ALLOW_FALL = BooleanProperty.of("allow_fall"); - public static final VoxelShape WALKING_SHAPE = Block.createCuboidShape(0, 0, 0, 16, 8, 16); - - private final boolean venomous; - - public LichenBlock(Settings settings, boolean venomous) { - super(settings); - this.venomous = venomous; - setDefaultState(getDefaultState().with(ALLOW_FALL, false)); - } - - @Override - public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { - entity.fallDistance = 0; - if (venomous) { - entity.slowMovement(state, new Vec3d(0.65D, 0.875D, 0.65D)); - if (entity instanceof LivingEntity livingEntity) { - ConditionManager manager = ConditionAPI.getConditionManager(livingEntity); - manager.add(Conditions.VENOM, Persistence.TEMPORARY, 1F); - } - } - else { - entity.slowMovement(state, new Vec3d(0.85D, 0.9D, 0.85D)); - } - } - - @Override - public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { - for (int i = random.nextInt(2); i < 3; i++) { - BlockPos.streamOutwards(pos, 3, 2, 3) - .filter(temp -> world.getBlockState(temp).isIn(ParadiseLostBlockTags.LICHEN_SPREADABLES)) - .filter(temp -> world.isAir(temp.up()) && world.getLightLevel(temp.up()) <= 9) - .filter(temp -> random.nextBoolean()) - .findFirst() - .ifPresent(spreadPoint -> { - world.setBlockState(spreadPoint, getDefaultState()); - world.playSound(null, spreadPoint, ParadiseLostSoundEvents.BLOCK_LICHEN_SPREADS, SoundCategory.BLOCKS, 1, 0.9F + random.nextFloat() / 10); - }); - } - } - - @Override - public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return WALKING_SHAPE; - } - - @Override - public float getJumpVelocityMultiplier() { - return 0.9F; - } - - @Override - public void onSteppedOn(World world, BlockPos topPos, BlockState state, Entity entity) { - BlockPos pos = topPos.down(venomous ? 2 : 4); - while (pos.getY() != topPos.getY() + 1) { - tryFall(world, pos, state); - pos = pos.up(); - } - } - - @Override - public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { - if (state.get(ALLOW_FALL)) { - tryFall(world, pos, state); - } - } - - public void tryFall(World world, BlockPos pos, BlockState state) { - if (canFallThrough(world.getBlockState(pos.down())) && pos.getY() >= world.getBottomY()) { - if (state.getPistonBehavior().equals(PistonBehavior.BLOCK) || state.getBlock().getHardness() == -1F) { - return; - } - FallingBlockEntity fallingBlockEntity = FallingBlockEntity.spawnFromBlock(world, pos, state); - this.configureFallingBlockEntity(fallingBlockEntity); - - BlockPos.iterateOutwards(pos, 1, 0, 1).forEach(checkPos -> { - var checkState = world.getBlockState(checkPos); - if (!checkPos.equals(pos) && checkState.isOf(this)) { - world.setBlockState(checkPos, checkState.with(ALLOW_FALL, true)); - } - }); - } - } - - @Override - protected int getFallDelay() { - return 3; - } - - @Override - public int getColor(BlockState state, BlockView world, BlockPos pos) { - return venomous ? 0x4d333c : 0x503639; - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(builder); - builder.add(ALLOW_FALL); - } -} diff --git a/src/main/java/net/id/paradiselost/blocks/natural/plant/LichenPileBlock.java b/src/main/java/net/id/paradiselost/blocks/natural/plant/LichenPileBlock.java deleted file mode 100644 index 2fece969d..000000000 --- a/src/main/java/net/id/paradiselost/blocks/natural/plant/LichenPileBlock.java +++ /dev/null @@ -1,86 +0,0 @@ -package net.id.paradiselost.blocks.natural.plant; - -import net.id.paradiselost.effect.condition.Conditions; -import net.id.paradiselost.tag.ParadiseLostBlockTags; -import net.id.incubus_core.condition.api.ConditionAPI; -import net.id.incubus_core.condition.api.Persistence; -import net.id.incubus_core.condition.base.ConditionManager; -import net.minecraft.block.*; -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.random.Random; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import net.minecraft.world.World; - -public class LichenPileBlock extends FallingBlock implements Fertilizable { - - public static final VoxelShape SHAPE = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D); - public static final VoxelShape WALKING_SHAPE = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D); - - private final boolean venomous; - - public LichenPileBlock(Settings settings, boolean venomous) { - super(settings); - this.venomous = venomous; - } - - @Override - public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { - if (venomous) { - entity.slowMovement(state, new Vec3d(0.925D, 1D, 0.925D)); - if (entity instanceof LivingEntity livingEntity) { - ConditionManager manager = ConditionAPI.getConditionManager(livingEntity); - manager.add(Conditions.VENOM, Persistence.TEMPORARY, 0.6F); - } - } - else { - entity.slowMovement(state, new Vec3d(0.975D, 1D, 0.975D)); - } - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return SHAPE; - } - - @Override - public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return WALKING_SHAPE; - } - - @Override - protected int getFallDelay() { - return 3; - } - - @Override - public int getColor(BlockState state, BlockView world, BlockPos pos) { - return venomous ? 0x4d333c : 0x503639; - } - - @Override - public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) { - return true; - } - - @Override - public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { - return true; - } - - @Override - public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) { - BlockPos.streamOutwards(pos, 3, 1, 3) - .filter(world::isAir) - .filter(temp -> { - var floor = world.getBlockState(temp); - return floor.getBlock() instanceof LichenBlock || floor.isIn(ParadiseLostBlockTags.LICHEN_SPREADABLES); - }) - .filter(temp -> random.nextInt(60) == 0) - .forEach(spreadPoint -> world.setBlockState(spreadPoint, getDefaultState())); - } -} diff --git a/src/main/java/net/id/paradiselost/blocks/natural/tree/ParadiseLostLeavesBlock.java b/src/main/java/net/id/paradiselost/blocks/natural/tree/ParadiseLostLeavesBlock.java index 4862a48d7..786f44722 100644 --- a/src/main/java/net/id/paradiselost/blocks/natural/tree/ParadiseLostLeavesBlock.java +++ b/src/main/java/net/id/paradiselost/blocks/natural/tree/ParadiseLostLeavesBlock.java @@ -47,7 +47,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit @Override public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { - if (state.isOf(ParadiseLostBlocks.MOTHER_AUREL_LEAVES) && random.nextInt(75) == 0) { + if (state.isOf(ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.leaves()) && random.nextInt(75) == 0) { Direction direction = Direction.DOWN; BlockPos blockPos = pos.offset(direction); BlockState blockState = world.getBlockState(blockPos); diff --git a/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java b/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java index 1bbdabda4..762527db8 100644 --- a/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java +++ b/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java @@ -21,8 +21,6 @@ public class ParadiseLostModelLayers { public static final EntityModelLayer HELLENROSE = register("hellenrose", "main", ParadiseLostPlantModel.getTexturedModelData()); public static final EntityModelLayer PARADISE_HARE = register("corsican_hare", "main", ParadiseHareModel.getTexturedModelData()); public static final EntityModelLayer MOA = register("moa", "main", MoaModel.getTexturedModelData()); - public static final EntityModelLayer ROOK = register("rook", "main", RookModel.getTexturedModelData()); - public static final EntityModelLayer ROOK_GLOW = register("rook_glow", "glow", RookModel.getTexturedModelData()); public static final EntityModelLayer AMBYST = register("ambyst", "main", AmbystModel.getTexturedModelData()); public static final EntityModelLayer PHOENIX_ARMOR = register("phoenix_armor", "main", PhoenixArmorModel.getTexturedModelData()); diff --git a/src/main/java/net/id/paradiselost/client/model/entity/RookModel.java b/src/main/java/net/id/paradiselost/client/model/entity/RookModel.java deleted file mode 100644 index f08985a23..000000000 --- a/src/main/java/net/id/paradiselost/client/model/entity/RookModel.java +++ /dev/null @@ -1,80 +0,0 @@ -package net.id.paradiselost.client.model.entity; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.id.paradiselost.component.LUV; -import net.id.paradiselost.entities.misc.RookEntity; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.model.*; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.entity.model.EntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.math.MathHelper; - -@Environment(EnvType.CLIENT) -public class RookModel extends EntityModel { - - private final ModelPart body; - - public float lookAlpha, translation, blinkTicks; - - public RookModel(ModelPart root) { - body = root.getChild("body"); - } - - public static TexturedModelData getTexturedModelData() { - ModelData modelData = new ModelData(); - var mainData = modelData.getRoot(); - mainData.addChild("body", ModelPartBuilder.create().uv(0, 0).cuboid(-16, -8, 0, 32, 32, 0), ModelTransform.NONE); - return TexturedModelData.of(modelData, 64, 64); - } - - @Override - public void setAngles(RookEntity rook, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { - var cameraEntity = MinecraftClient.getInstance().getCameraEntity(); - var cameraPos = cameraEntity.getEyePos(); - var rookPos = rook.getPos(); - - byte luv = 127; - - if (cameraEntity instanceof PlayerEntity player) { - luv = LUV.getLUV(player).getValue(); - } - - - var difX = rook.getX() - cameraEntity.getX(); - var difZ = rook.getZ() - cameraEntity.getZ(); - var angle = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(difZ, difX)) + 90); - - var faceValue = MathHelper.angleBetween(angle, MathHelper.wrapDegrees(cameraEntity.getHeadYaw())) / 180; - - lookAlpha = MathHelper.lerp(faceValue, 0.8F, 0); - - lookAlpha = (float) MathHelper.lerp(cameraPos.distanceTo(rookPos) / 12F, 0, lookAlpha); - - if (lookAlpha < 0.075F || cameraPos.distanceTo(rookPos) < 4.5F) { - lookAlpha = 0F; - } - - if (luv >= 0 && luv < 40) { - lookAlpha = 0F; - } - else if (luv == 127 || luv < 0) { - lookAlpha = 0.7F; - } - - var time = rook.age + MinecraftClient.getInstance().getTickDelta(); - translation = (float) (Math.sin(time / 25) / 8 + 0.125); - - this.blinkTicks = rook.blinkTicks; - } - - @Override - public void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) { - matrices.push(); - matrices.translate(0, -translation, 0); - body.render(matrices, vertices, light, overlay, red, green, blue, lookAlpha); - matrices.pop(); - } -} diff --git a/src/main/java/net/id/paradiselost/client/rendering/block/IncubatorBlockEntityRenderer.java b/src/main/java/net/id/paradiselost/client/rendering/block/IncubatorBlockEntityRenderer.java index a7e531746..4ef3b90d5 100644 --- a/src/main/java/net/id/paradiselost/client/rendering/block/IncubatorBlockEntityRenderer.java +++ b/src/main/java/net/id/paradiselost/client/rendering/block/IncubatorBlockEntityRenderer.java @@ -18,11 +18,11 @@ public IncubatorBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) { @Override public void render(IncubatorBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { - if (!entity.isEmpty()) { + if (entity.hasItem()) { matrices.push(); matrices.translate(0.5, 0.55, 0.5); matrices.scale(0.9F, 0.9F, 0.9F); - MinecraftClient.getInstance().getItemRenderer().renderItem(entity.getStack(0), ModelTransformation.Mode.FIXED, light, overlay, matrices, vertexConsumers, 0); + MinecraftClient.getInstance().getItemRenderer().renderItem(entity.getItem(), ModelTransformation.Mode.FIXED, light, overlay, matrices, vertexConsumers, 0); matrices.pop(); } } diff --git a/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java b/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java index 499d2cb41..396daf0bf 100644 --- a/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java +++ b/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java @@ -5,10 +5,8 @@ import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; import net.id.incubus_core.blocklikeentities.api.client.BlockLikeEntityRenderer; import net.id.paradiselost.client.rendering.entity.hostile.HellenroseRenderer; -import net.id.paradiselost.client.rendering.entity.misc.RookRenderer; import net.id.paradiselost.client.rendering.entity.passive.ParadiseHareRenderer; import net.id.paradiselost.client.rendering.entity.passive.MoaEntityRenderer; -import net.id.paradiselost.client.rendering.entity.projectile.DartRenderer; import net.id.paradiselost.entities.ParadiseLostEntityTypes; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.entity.Entity; @@ -28,14 +26,7 @@ public static void initClient() { register(ParadiseLostEntityTypes.MOA, MoaEntityRenderer::new); register(ParadiseLostEntityTypes.PARADISE_HARE, ParadiseHareRenderer::new); // register(ParadiseLostEntityTypes.AMBYST, AmbystRenderer::new); - // projectile - register(DartRenderer::new, - ParadiseLostEntityTypes.POISON_DART, - ParadiseLostEntityTypes.POISON_NEEDLE - ); - // other - register(ParadiseLostEntityTypes.ROOK, RookRenderer::new); } @SafeVarargs diff --git a/src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookEyeFeatureRenderer.java b/src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookEyeFeatureRenderer.java deleted file mode 100644 index e82007f26..000000000 --- a/src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookEyeFeatureRenderer.java +++ /dev/null @@ -1,56 +0,0 @@ -package net.id.paradiselost.client.rendering.entity.misc; - -import com.google.common.collect.ImmutableList; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.id.paradiselost.ParadiseLost; -import net.id.paradiselost.client.model.entity.RookModel; -import net.id.paradiselost.entities.misc.RookEntity; -import net.minecraft.client.render.OverlayTexture; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.feature.EyesFeatureRenderer; -import net.minecraft.client.render.entity.feature.FeatureRendererContext; -import net.minecraft.client.util.math.MatrixStack; - -import java.util.List; - -@Environment(EnvType.CLIENT) -public class RookEyeFeatureRenderer extends EyesFeatureRenderer { - - public static final List EYES; - private final FeatureRendererContext context; - - public RookEyeFeatureRenderer(FeatureRendererContext featureRendererContext) { - super(featureRendererContext); - this.context = featureRendererContext; - } - - @Override - public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, RookEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { - var model = getContextModel(); - if (model.blinkTicks <= 0 && model.lookAlpha > 0.185F) { - VertexConsumer vertexConsumer = vertexConsumers.getBuffer(this.getEyesTexture(entity)); - this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1); - } - } - - @Override - public RenderLayer getEyesTexture() { - return EYES.get(0); - } - - public RenderLayer getEyesTexture(RookEntity entity) { - return EYES.get(entity.getAscencion()); - } - - static { - EYES = ImmutableList.of( - RenderLayer.getEyes(ParadiseLost.locate("textures/entity/corvid/rook_eye1.png")), - RenderLayer.getEyes(ParadiseLost.locate("textures/entity/corvid/rook_eye2.png")), - RenderLayer.getEyes(ParadiseLost.locate("textures/entity/corvid/rook_eye3.png")), - RenderLayer.getEyes(ParadiseLost.locate("textures/entity/corvid/rook_eye4.png")) - ); - } -} diff --git a/src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookRenderer.java b/src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookRenderer.java deleted file mode 100644 index cfc278672..000000000 --- a/src/main/java/net/id/paradiselost/client/rendering/entity/misc/RookRenderer.java +++ /dev/null @@ -1,54 +0,0 @@ -package net.id.paradiselost.client.rendering.entity.misc; - -import com.google.common.collect.ImmutableList; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.id.paradiselost.ParadiseLost; -import net.id.paradiselost.client.model.ParadiseLostModelLayers; -import net.id.paradiselost.client.model.entity.RookModel; -import net.id.paradiselost.entities.misc.RookEntity; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.EntityRendererFactory; -import net.minecraft.client.render.entity.MobEntityRenderer; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -@Environment(EnvType.CLIENT) -public class RookRenderer extends MobEntityRenderer { - - public static final List TEXTURES; - - public RookRenderer(EntityRendererFactory.Context context) { - super(context, new RookModel(context.getPart(ParadiseLostModelLayers.ROOK)), 0); - //addFeature(new RookEyeFeatureRenderer(this)); - } - - @Override - public void render(RookEntity mobEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) { - super.render(mobEntity, f, g, matrixStack, vertexConsumerProvider, i); - } - - @Nullable - @Override - protected RenderLayer getRenderLayer(RookEntity entity, boolean showBody, boolean translucent, boolean showOutline) { - return RenderLayer.getEntityTranslucent(getTexture(entity)); - } - - @Override - public Identifier getTexture(RookEntity entity) { - return TEXTURES.get(entity.getAscencion()); - } - - static { - TEXTURES = ImmutableList.of( - ParadiseLost.locate("textures/entity/corvid/rook1.png"), - ParadiseLost.locate("textures/entity/corvid/rook2.png"), - ParadiseLost.locate("textures/entity/corvid/rook3.png"), - ParadiseLost.locate("textures/entity/corvid/rook4.png") - ); - } -} diff --git a/src/main/java/net/id/paradiselost/client/rendering/entity/projectile/DartRenderer.java b/src/main/java/net/id/paradiselost/client/rendering/entity/projectile/DartRenderer.java deleted file mode 100644 index 55084d127..000000000 --- a/src/main/java/net/id/paradiselost/client/rendering/entity/projectile/DartRenderer.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.id.paradiselost.client.rendering.entity.projectile; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.id.paradiselost.ParadiseLost; -import net.id.paradiselost.entities.projectile.DartEntity; -import net.id.paradiselost.entities.projectile.PoisonNeedleEntity; -import net.minecraft.client.render.entity.EntityRendererFactory; -import net.minecraft.client.render.entity.ProjectileEntityRenderer; -import net.minecraft.util.Identifier; - -@Environment(EnvType.CLIENT) -public class DartRenderer extends ProjectileEntityRenderer { - - public DartRenderer(EntityRendererFactory.Context renderManager) { - super(renderManager); - this.shadowOpacity = 0.0F; - } - - @Override - public Identifier getTexture(DartEntity entity) { - return ParadiseLost.locate("textures/entity/projectile/dart/poison" + (entity instanceof PoisonNeedleEntity ? "_needle" : "_dart") + ".png"); - } -} diff --git a/src/main/java/net/id/paradiselost/client/rendering/ui/BloodstoneHUDRenderer.java b/src/main/java/net/id/paradiselost/client/rendering/ui/BloodstoneHUDRenderer.java index 04e7952d2..136392a72 100644 --- a/src/main/java/net/id/paradiselost/client/rendering/ui/BloodstoneHUDRenderer.java +++ b/src/main/java/net/id/paradiselost/client/rendering/ui/BloodstoneHUDRenderer.java @@ -3,7 +3,6 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.id.incubus_core.condition.api.Severity; import net.id.paradiselost.ParadiseLost; import net.id.paradiselost.items.tools.bloodstone.*; import net.minecraft.client.MinecraftClient; @@ -137,21 +136,6 @@ private static void renderCondition(MatrixStack matrixStack, MinecraftClient cli RenderSystem.setShaderTexture(0, ParadiseLost.locate("textures/hud/bloodstone/condition_bar.png")); DrawableHelper.drawTexture(matrixStack, -7, -7, 0, 0, 109, 12, 109, 12); matrixStack.pop(); - - Text title = Text.translatable("condition.condition." + conditionData.id()).append(" - ").append(getSeverityWithColor(conditionData.severity())); - renderText(matrixStack, client, title, offsetX + 17, offsetY - 9); - } - - public static Text getSeverityWithColor(Float rawSeverity) { - Severity sev = Severity.getSeverity(rawSeverity); - MutableText text = Text.translatable(sev.getTranslationKey()); - return switch (sev) { - case EXTREME -> text.formatted(Formatting.GRAY); - case DIRE -> text.formatted(Formatting.RED); - case ACUTE -> text.formatted(Formatting.YELLOW); - case MILD -> text.formatted(Formatting.GREEN); - case NEGLIGIBLE -> text.formatted(Formatting.AQUA); - }; } private static void renderRing(MatrixStack matrixStack, int offsetX, int offsetY) { diff --git a/src/main/java/net/id/paradiselost/client/rendering/util/ParadiseLostColorProviders.java b/src/main/java/net/id/paradiselost/client/rendering/util/ParadiseLostColorProviders.java index 3c70c2fc5..35fae9a82 100644 --- a/src/main/java/net/id/paradiselost/client/rendering/util/ParadiseLostColorProviders.java +++ b/src/main/java/net/id/paradiselost/client/rendering/util/ParadiseLostColorProviders.java @@ -19,13 +19,13 @@ public static void initClient() { } private static void initBlocks() { - ColorProviderRegistryImpl.BLOCK.register(((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor()), ParadiseLostBlocks.AUREL_LEAVES, ParadiseLostBlocks.AUREL_LEAF_PILE, ParadiseLostBlocks.SHAMROCK); + ColorProviderRegistryImpl.BLOCK.register(((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getFoliageColor(world, pos) : FoliageColors.getDefaultColor()), ParadiseLostBlocks.AUREL_WOODSTUFF.leaves(), ParadiseLostBlocks.AUREL_LEAF_PILE, ParadiseLostBlocks.SHAMROCK); ColorProviderRegistryImpl.BLOCK.register(((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : GrassColors.getColor(0.5D, 1.0D)), ParadiseLostBlocks.HIGHLANDS_GRASS, ParadiseLostBlocks.GRASS, ParadiseLostBlocks.GRASS_FLOWERING, ParadiseLostBlocks.SHORT_GRASS, ParadiseLostBlocks.TALL_GRASS, ParadiseLostBlocks.FERN, ParadiseLostBlocks.BUSH); ColorProviderRegistryImpl.BLOCK.register(((state, world, pos, tintIndex) -> world != null && pos != null ? BiomeColors.getWaterColor(world, pos) : -1), ParadiseLostBlocks.SPRING_WATER); } private static void initItems() { - ColorProviderRegistryImpl.ITEM.register(((stack, tintIndex) -> 0xf1ff99), ParadiseLostBlocks.AUREL_LEAVES.asItem(), ParadiseLostBlocks.AUREL_LEAF_PILE.asItem(), ParadiseLostBlocks.SHAMROCK.asItem()); + ColorProviderRegistryImpl.ITEM.register(((stack, tintIndex) -> 0xf1ff99), ParadiseLostBlocks.AUREL_WOODSTUFF.leaves().asItem(), ParadiseLostBlocks.AUREL_LEAF_PILE.asItem(), ParadiseLostBlocks.SHAMROCK.asItem()); ColorProviderRegistryImpl.ITEM.register(((stack, tintIndex) -> tintIndex == 0 ? 0xa2dbc2 : -1), ParadiseLostBlocks.HIGHLANDS_GRASS.asItem(), ParadiseLostBlocks.GRASS.asItem(), ParadiseLostBlocks.GRASS_FLOWERING.asItem(), ParadiseLostBlocks.SHORT_GRASS.asItem(), ParadiseLostBlocks.TALL_GRASS.asItem(), ParadiseLostBlocks.FERN.asItem(), ParadiseLostBlocks.BUSH.asItem()); } diff --git a/src/main/java/net/id/paradiselost/commands/LUVCommand.java b/src/main/java/net/id/paradiselost/commands/LUVCommand.java deleted file mode 100644 index eb62abee1..000000000 --- a/src/main/java/net/id/paradiselost/commands/LUVCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.id.paradiselost.commands; - -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.IntegerArgumentType; -import net.id.paradiselost.component.LUV; -import net.id.incubus_core.misc.WorthinessChecker; -import net.minecraft.command.argument.EntityArgumentType; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.text.Text; - -import java.util.Optional; - -import static net.minecraft.server.command.CommandManager.argument; -import static net.minecraft.server.command.CommandManager.literal; - -public class LUVCommand { - - public static void register(CommandDispatcher dispatcher) { - dispatcher.register(literal("LUV") - .requires((source) -> source.hasPermissionLevel(2)) - .then(literal("query") - .then(argument("target", EntityArgumentType.player()) - .executes((context) -> queryLUV(context.getSource(), EntityArgumentType.getPlayer(context, "target"))) - ) - ) - .then(literal("set") - .then(argument("target", EntityArgumentType.player()) - .then(argument("value", IntegerArgumentType.integer(-128, 128)) - .executes((context) -> setLUV(context.getSource(), EntityArgumentType.getPlayer(context, "target"), (byte) IntegerArgumentType.getInteger(context, "value"))) - ) - ) - ) - ); - } - - public static int queryLUV(ServerCommandSource source, PlayerEntity target) { - source.sendFeedback(Text.translatable("commands.paradise_lost.LUV.success.query", LUV.getLUV(target).getValue()), false); - return 1; - } - - public static int setLUV(ServerCommandSource source, PlayerEntity target, byte value) { - if (WorthinessChecker.isPlayerWorthy(target.getUuid(), Optional.of(target))) { - LUV.getLUV(target).setValue(value); - source.sendFeedback(Text.translatable("commands.paradise_lost.LUV.success.set", target.getDisplayName(), LUV.getLUV(target).getValue()), false); - } - else { - source.sendError(Text.translatable("commands.paradise_lost.LUV.failure.set")); - } - return 1; - } -} diff --git a/src/main/java/net/id/paradiselost/commands/ParadiseLostCommands.java b/src/main/java/net/id/paradiselost/commands/ParadiseLostCommands.java index 5d6863eae..dbe279238 100644 --- a/src/main/java/net/id/paradiselost/commands/ParadiseLostCommands.java +++ b/src/main/java/net/id/paradiselost/commands/ParadiseLostCommands.java @@ -13,7 +13,6 @@ public static void init() { register(MoaStatCommand::register); register(FloatingBlockCommand::register); register(LoreCommand::register); - register(LUVCommand::register); } private static void register(Consumer> command) { diff --git a/src/main/java/net/id/paradiselost/component/LUV.java b/src/main/java/net/id/paradiselost/component/LUV.java deleted file mode 100644 index 5bfb8bc62..000000000 --- a/src/main/java/net/id/paradiselost/component/LUV.java +++ /dev/null @@ -1,122 +0,0 @@ -package net.id.paradiselost.component; - -import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent; -import dev.onyxstudios.cca.api.v3.component.tick.CommonTickingComponent; -import dev.onyxstudios.cca.api.v3.entity.PlayerComponent; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.random.Random; -import net.minecraft.world.World; - -/** - * What are you doing here? - * Dawn will soon break... - * Child of light, this is not for you to see. - * - * - * @author why, that is not for you to know, is it? - */ -public class LUV implements AutoSyncedComponent, CommonTickingComponent, PlayerComponent { - - private final PlayerEntity player; - private byte value; - - public LUV(PlayerEntity player) { - value = (byte) player.getRandom().nextInt(128); - this.player = player; - } - - public static LUV getLUV(PlayerEntity player) { - return ParadiseLostComponents.LUV.get(player); - } - - @Override - public void tick() { - var playerPos = player.getBlockPos(); - var world = player.getEntityWorld(); - var random = player.getRandom(); - - if (value >= 36 || world.getMoonPhase() == 0) { - handleRookSpawning(world, playerPos, random); - } - } - - public void handleRookSpawning(World world, BlockPos pos, Random random) { -// var dayTime = world.getTimeOfDay(); -// -// var rookCount = (long) world.getEntitiesByClass(RookEntity.class, Box.of(Vec3d.ofCenter(pos), 64, 64, 64), entity -> true).size(); -// var rookCap = (value == 48 || value == 100 || value >= 126) ? 64 : 16; -// -// var scaling = 0.5 + Math.sqrt(rookCount); -// var luvModifier = 1.0; -// -// if (world.getRegistryKey() == ParadiseLostDimension.PARADISE_LOST_WORLD_KEY) { -// if (value == 48 || (value >= 0 && value < 30)) -// luvModifier = 2; -// else if (value > 100 && value < 110) -// luvModifier = 0.5; -// else if (value < 0) -// luvModifier = 0.25; -// } -// else { -// luvModifier = 4; -// } -// -// if (rookCount < rookCap && world.getTime() % 20 == 0 && (dayTime > 14000 && dayTime < 22000)) { -// var posStream = BlockPos.streamOutwards(pos, 32, 32, 32); -// double finalLuvModifier = luvModifier; -// posStream -// .filter(blockPos -> blockPos.getManhattanDistance(pos) > 22) -// .forEach(blockPos -> { -// var upPos = blockPos.up(); -// var floorPos = blockPos.down(); -// var state = world.getBlockState(blockPos); -// var upState = world.getBlockState(upPos); -// var floorState = blockPos.down(); -// -// if (world.getLightLevel(LightType.BLOCK, blockPos) > 4 || state.isFullCube(world, blockPos) || upState.isFullCube(world, upPos) || world.isAir(floorPos)) -// return; -// -// var roofed = 3; -// -// for (int i = 1; i <= 4; i++) { -// var checkPos = upPos.up(i); -// if (!world.getBlockState(checkPos).isTranslucent(world, checkPos)) { -// roofed = 1; -// break; -// } -// } -// -// if (random.nextInt((int) (30000 * roofed * scaling * finalLuvModifier)) == 0) { -// var rook = new RookEntity(ParadiseLostEntityTypes.ROOK, world); -// rook.setPos(blockPos.getX() + 0.5, blockPos.getY() + 0.1, blockPos.getZ() + 0.5); -// world.spawnEntity(rook); -// } -// }); -// } - } - - public byte getValue() { - return value; - } - - public void setValue(byte value) { - this.value = value; - } - - @Override - public void readFromNbt(NbtCompound tag) { - value = tag.getByte("LUV"); - } - - @Override - public void writeToNbt(NbtCompound tag) { - tag.putByte("LUV", value); - } - - @Override - public boolean shouldCopyForRespawn(boolean lossless, boolean keepInventory, boolean sameCharacter) { - return sameCharacter; - } -} diff --git a/src/main/java/net/id/paradiselost/component/ParadiseLostComponents.java b/src/main/java/net/id/paradiselost/component/ParadiseLostComponents.java index 580511887..74406c2cc 100644 --- a/src/main/java/net/id/paradiselost/component/ParadiseLostComponents.java +++ b/src/main/java/net/id/paradiselost/component/ParadiseLostComponents.java @@ -13,13 +13,10 @@ public class ParadiseLostComponents implements EntityComponentInitializer { public static final ComponentKey MOA_GENETICS_KEY = ComponentRegistry.getOrCreate(ParadiseLost.locate("moa_genetics"), MoaGenes.class); public static final ComponentKey LORE_STATE = ComponentRegistry.getOrCreate(ParadiseLost.locate("lore_state"), LoreState.class); - - public static final ComponentKey LUV = ComponentRegistry.getOrCreate(ParadiseLost.locate("luv"), net.id.paradiselost.component.LUV.class); @Override public void registerEntityComponentFactories(EntityComponentFactoryRegistry registry) { registry.registerFor(MoaEntity.class, MOA_GENETICS_KEY, moa -> new MoaGenes()); registry.registerForPlayers(LORE_STATE, LoreState.Impl::new, RespawnCopyStrategy.ALWAYS_COPY); - registry.registerForPlayers(LUV, net.id.paradiselost.component.LUV::new); } } diff --git a/src/main/java/net/id/paradiselost/effect/ParadiseLostStatusEffects.java b/src/main/java/net/id/paradiselost/effect/ParadiseLostStatusEffects.java deleted file mode 100644 index 22e78334a..000000000 --- a/src/main/java/net/id/paradiselost/effect/ParadiseLostStatusEffects.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.id.paradiselost.effect; - -import net.id.paradiselost.ParadiseLost; -import net.id.paradiselost.registry.ParadiseLostRegistryQueues; -import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.entity.effect.StatusEffectCategory; - -public class ParadiseLostStatusEffects { - - public static void init() { - ParadiseLostRegistryQueues.STATUS_EFFECT.register(); - } - - public static SimmeringStatusEffect SIMMERING = add("simmering", new SimmeringStatusEffect(StatusEffectCategory.BENEFICIAL, 0xFFFFFF)); - - private static V add(String id, V entry) { - return ParadiseLostRegistryQueues.STATUS_EFFECT.add(ParadiseLost.locate(id), entry); - } -} diff --git a/src/main/java/net/id/paradiselost/effect/SimmeringStatusEffect.java b/src/main/java/net/id/paradiselost/effect/SimmeringStatusEffect.java deleted file mode 100644 index a5125e848..000000000 --- a/src/main/java/net/id/paradiselost/effect/SimmeringStatusEffect.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.id.paradiselost.effect; - -import net.id.paradiselost.util.ParadiseLostSoundEvents; -import net.id.incubus_core.condition.api.Condition; -import net.id.incubus_core.condition.api.ConditionModifier; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.entity.effect.StatusEffectCategory; -import net.minecraft.particle.ParticleTypes; - -public class SimmeringStatusEffect extends StatusEffect implements ConditionModifier { - - protected SimmeringStatusEffect(StatusEffectCategory category, int color) { - super(category, color); - } - - @Override - public void applyUpdateEffect(LivingEntity entity, int amplifier) { - var random = entity.getRandom(); - var world = entity.getEntityWorld(); - - if (world.getTime() % (random.nextInt(10) + 6) == 0) { - if (random.nextBoolean()) { - entity.heal(1F); - entity.playSound(ParadiseLostSoundEvents.EFFECT_SIMMERING_SIMMER, random.nextFloat() * 0.4F + 0.4F, random.nextFloat() * 0.5F + 1); - } - world.addParticle(ParticleTypes.CLOUD, entity.getParticleX(1), entity.getRandomBodyY(), entity.getParticleZ(1), 0.0D, 0.1, 0.0D); - } - } - - @Override - public boolean canApplyUpdateEffect(int duration, int amplifier) { - return true; - } - - @Override - public float getDecayMultiplier(Condition condition) { - return 2.25F; - } -} diff --git a/src/main/java/net/id/paradiselost/effect/condition/Conditions.java b/src/main/java/net/id/paradiselost/effect/condition/Conditions.java deleted file mode 100644 index dcbaa3a87..000000000 --- a/src/main/java/net/id/paradiselost/effect/condition/Conditions.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.id.paradiselost.effect.condition; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.id.paradiselost.ParadiseLost; -import net.id.paradiselost.client.rendering.ui.ParadiseLostOverlayRegistrar; -import net.id.incubus_core.condition.IncubusCondition; -import net.id.incubus_core.condition.api.Condition; -import net.id.incubus_core.condition.api.ConditionAPI; -import net.minecraft.util.registry.Registry; - -public class Conditions { - public static final Condition VENOM = register("venom", new VenomCondition()); - - private static Condition register(String id, Condition condition) { - return Registry.register(IncubusCondition.CONDITION_REGISTRY, ParadiseLost.locate(id), condition); - } - - public static void init() { - } - - @Environment(EnvType.CLIENT) - public static void clientInit() { - ParadiseLostOverlayRegistrar.register(new ParadiseLostOverlayRegistrar.Overlay( - ParadiseLost.locate("textures/hud/condition/venom.png"), - (player) -> ConditionAPI.isVisible(VENOM, player), - (player) -> { - var manager = ConditionAPI.getConditionManager(player); - return manager.getScaledSeverity(VENOM); - } - )); - } -} diff --git a/src/main/java/net/id/paradiselost/effect/condition/VenomCondition.java b/src/main/java/net/id/paradiselost/effect/condition/VenomCondition.java deleted file mode 100644 index 8e581b047..000000000 --- a/src/main/java/net/id/paradiselost/effect/condition/VenomCondition.java +++ /dev/null @@ -1,61 +0,0 @@ -package net.id.paradiselost.effect.condition; - -import net.id.paradiselost.client.rendering.particle.ParadiseLostParticles; -import net.id.paradiselost.tag.ParadiseLostEntityTypeTags; -import net.id.incubus_core.condition.api.Condition; -import net.id.incubus_core.condition.api.Severity; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.world.World; - -public class VenomCondition extends Condition { - - public VenomCondition() { - super(ParadiseLostEntityTypeTags.VENOM_IMMUNITY, 300, 300, 0.5F, 0.025F, 400, 0.05F); - } - - @Override - public void tick(World world, LivingEntity entity, Severity severity, float rawSeverity) { - if (rawSeverity > visThreshold && world.getTime() % 20 == 0) { - - StatusEffectInstance poisonEffect = new StatusEffectInstance(StatusEffects.POISON, 100, 0, true, false, true); - if (severity == Severity.MILD) { - poisonEffect = new StatusEffectInstance(StatusEffects.POISON, 100, 1, true, false, true); - } else if (severity == Severity.ACUTE) { - poisonEffect = new StatusEffectInstance(StatusEffects.POISON, 100, 2, true, false, true); - } else if (severity == Severity.DIRE || severity == Severity.EXTREME) { - poisonEffect = new StatusEffectInstance(StatusEffects.POISON, 200, 2, true, false, true); - } - - StatusEffectInstance witherEffect = null; - if (severity == Severity.DIRE || severity == Severity.EXTREME) { - witherEffect = new StatusEffectInstance(StatusEffects.WITHER, 100, 1, true, false, true); - } - - entity.addStatusEffect(poisonEffect); - if (witherEffect != null) { - entity.addStatusEffect(witherEffect); - } - } - } - - @Override - public void tickPlayer(World world, PlayerEntity player, Severity severity, float rawSeverity) { - tick(world, player, severity, rawSeverity); - } - - @Override - public void clientTick(ClientWorld world, LivingEntity entity, Severity severity, float rawSeverity) { - if (severity.isAsOrMoreSevere(Severity.MILD)) { - var random = world.getRandom(); - var self = MinecraftClient.getInstance().player == entity; - if (random.nextFloat() < ((severity.isAsOrMoreSevere(Severity.DIRE) ? 0.6 : 0.2) / (self ? 3 : 1))) { - world.addImportantParticle(ParadiseLostParticles.VENOM_BUBBLE, entity.getParticleX(1), entity.getRandomBodyY(), entity.getParticleZ(1), (entity.getVelocity().x / 15) + ((random.nextDouble() * 0.005) - 0.0025), 0.025 + random.nextDouble() * 0.035, (entity.getVelocity().z / 15) + ((random.nextDouble() * 0.005) - 0.0025)); - } - } - } -} diff --git a/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java b/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java index 5b43b6c35..6fc802789 100644 --- a/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java +++ b/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java @@ -8,12 +8,10 @@ import net.id.paradiselost.entities.block.FloatingBlockEntity; import net.id.paradiselost.entities.block.SliderEntity; import net.id.paradiselost.entities.hostile.HellenroseEntity; -import net.id.paradiselost.entities.misc.RookEntity; import net.id.paradiselost.entities.passive.ParadiseHareEntity; import net.id.paradiselost.entities.passive.ParadiseLostAnimalEntity; import net.id.paradiselost.entities.passive.ambyst.FindLogSensor; import net.id.paradiselost.entities.passive.moa.MoaEntity; -import net.id.paradiselost.entities.projectile.*; import net.id.paradiselost.mixin.brain.ActivityInvoker; import net.id.paradiselost.mixin.brain.MemoryModuleTypeInvoker; import net.id.paradiselost.mixin.brain.SensorTypeInvoker; @@ -59,16 +57,9 @@ public class ParadiseLostEntityTypes { attributes(MoaEntity::createMoaAttributes), spawnRestrictions(ParadiseLostAnimalEntity::isValidNaturalParadiseLostSpawn)); public static final EntityType PARADISE_HARE = add("corsican_hare", of(ParadiseHareEntity::new, CREATURE, changing(0.55F, 0.55F), 5), attributes(ParadiseHareEntity::createParadiseHareAttributes), spawnRestrictions(ParadiseLostAnimalEntity::isValidNaturalParadiseLostSpawn)); - public static final EntityType ROOK = add("rook", of(RookEntity::new, MISC, fixed(0.75F, 1.8F), 5), - attributes(RookEntity::createRookAttributes), spawnRestrictions((type, world, spawnReason, pos, random) -> false)); // public static final EntityType AMBYST = add("ambyst", of(AmbystEntity::new, CREATURE, changing(0.6F, 0.42F), 5), // attributes(AmbystEntity::createAmbystAttributes), spawnRestrictions(ParadiseLostAnimalEntity::isValidNaturalParadiseLostSpawn)); - // Projectile - public static final EntityType POISON_DART = add("poison_dart", of(PoisonDartEntity::new, MISC, changing(0.5F, 0.5F), 5)); - public static final EntityType POISON_NEEDLE = add("poison_needle", of(PoisonNeedleEntity::new, MISC, changing(0.5F, 0.5F), 5)); - - //Brain public static final Activity HIDEINLOG = ActivityInvoker.invokeRegister(ParadiseLost.locate("hideinlog").toString()); diff --git a/src/main/java/net/id/paradiselost/entities/hostile/HellenroseEntity.java b/src/main/java/net/id/paradiselost/entities/hostile/HellenroseEntity.java index 45fd0d496..bd53cfb2e 100644 --- a/src/main/java/net/id/paradiselost/entities/hostile/HellenroseEntity.java +++ b/src/main/java/net/id/paradiselost/entities/hostile/HellenroseEntity.java @@ -1,7 +1,6 @@ package net.id.paradiselost.entities.hostile; import net.id.paradiselost.entities.passive.ParadiseLostAnimalEntity; -import net.id.paradiselost.entities.projectile.PoisonNeedleEntity; import net.id.paradiselost.items.ParadiseLostItems; import net.id.paradiselost.tag.ParadiseLostBlockTags; import net.id.paradiselost.util.ParadiseLostSoundEvents; @@ -20,6 +19,7 @@ import net.minecraft.entity.mob.HostileEntity; import net.minecraft.entity.passive.PassiveEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.projectile.ArrowEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.server.world.ServerWorld; @@ -98,7 +98,7 @@ public static boolean canSpawn(EntityType type, Serv @Override public void attack(LivingEntity targetIn, float distFactor) { - PoisonNeedleEntity needle = new PoisonNeedleEntity(this, this.world); + ArrowEntity needle = new ArrowEntity(this.world, this); double x = targetIn.getX() - this.getX(); double y = targetIn.getBoundingBox().minY + (double) (targetIn.getHeight() / 3.0F) - needle.getY(); double z = targetIn.getZ() - this.getZ(); diff --git a/src/main/java/net/id/paradiselost/entities/misc/RookEntity.java b/src/main/java/net/id/paradiselost/entities/misc/RookEntity.java deleted file mode 100644 index 9398c8579..000000000 --- a/src/main/java/net/id/paradiselost/entities/misc/RookEntity.java +++ /dev/null @@ -1,212 +0,0 @@ -package net.id.paradiselost.entities.misc; - -import net.id.paradiselost.component.LUV; -import net.id.paradiselost.util.ParadiseLostSoundEvents; -import net.minecraft.block.BlockState; -import net.minecraft.entity.*; -import net.minecraft.entity.attribute.DefaultAttributeContainer; -import net.minecraft.entity.attribute.EntityAttributes; -import net.minecraft.entity.damage.DamageSource; -import net.minecraft.entity.data.DataTracker; -import net.minecraft.entity.data.TrackedData; -import net.minecraft.entity.data.TrackedDataHandlerRegistry; -import net.minecraft.entity.mob.MobEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.Packet; -import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket; -import net.minecraft.particle.ParticleEffect; -import net.minecraft.particle.ParticleTypes; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Hand; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; -import net.minecraft.world.LightType; -import net.minecraft.world.LocalDifficulty; -import net.minecraft.world.ServerWorldAccess; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; - -import java.util.Comparator; - -import static net.id.paradiselost.tag.ParadiseLostItemTags.RIGHTEOUS_WEAPONS; -import static net.id.paradiselost.tag.ParadiseLostItemTags.SACRED_WEAPONS; - -public class RookEntity extends MobEntity { - - public static final TrackedData ASCENSION = DataTracker.registerData(RookEntity.class, TrackedDataHandlerRegistry.BYTE); - public int blinkTicks = 0; - - public RookEntity(EntityType type, World world) { - super(type, world); - } - - public static DefaultAttributeContainer.Builder createRookAttributes() { - return createMobAttributes() - .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25D) - .add(EntityAttributes.GENERIC_MAX_HEALTH, 5.0D); - } - - @Override - protected void initDataTracker() { - super.initDataTracker(); - dataTracker.startTracking(ASCENSION, (byte) 0); - } - - @Override - public void tick() { - super.tick(); - - if (blinkTicks > 0) { - blinkTicks--; - } - - if (world.getTimeOfDay() % 24000 < 13000) { - this.remove(RemovalReason.DISCARDED); - } - - world.getPlayers() - .stream() - .min(Comparator.comparing(player -> player.getPos().distanceTo(getPos()))) - .ifPresent(player -> { - getLookControl().lookAt(player, 15, 15); - - if (player.distanceTo(this) < 14) { - byte luv = LUV.getLUV(player).getValue(); - if (!player.isSpectator() && world.getLightLevel(LightType.BLOCK, player.getBlockPos()) < 5 && world.isNight() && world.getTime() % 10 == 0 && (luv > 50 || luv < 0)) { - if (random.nextInt(luv < 0 ? 40 : 200) == 0) { - //player.damage(ParadiseLostDamageSources.NIGHTMARE, 9); - produceParticlesServer(ParticleTypes.SMOKE, random.nextInt(19), 0, 0); - produceParticlesServer(ParticleTypes.LARGE_SMOKE, random.nextInt(8), 0, 0); - player.playSound(ParadiseLostSoundEvents.ENTITY_NIGHTMARE_HURT, SoundCategory.AMBIENT, 1, 0.85F + random.nextFloat() * 0.25F); - } - } - } - }); - bodyYaw = headYaw; - - if (world.getTime() % 20 == 0 && random.nextBoolean()) { - blinkTicks = random.nextInt(5); - } - } - - public void produceParticlesServer(ParticleEffect parameters, int rolls, int maxAmount, float yOffset) { - if (world instanceof ServerWorld server) { - maxAmount = maxAmount + 1; - for (int i = 0; i < rolls; ++i) { - double d = this.random.nextGaussian() * 0.02D; - double e = this.random.nextGaussian() * 0.02D; - double f = this.random.nextGaussian() * 0.02D; - server.spawnParticles(parameters, this.getParticleX(1.0D), this.getRandomBodyY() + yOffset, this.getParticleZ(1.0D), 1 + random.nextInt(maxAmount), d, e, f, 0); - } - } - } - - public int getAscencion() { - return MathHelper.clamp(dataTracker.get(ASCENSION), 0, 3); - } - - @Nullable - @Override - public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable NbtCompound entityNbt) { - if (!(entityData instanceof RookData)) { - entityData = new RookData((byte) random.nextInt(4)); - } - dataTracker.set(ASCENSION, ((RookData) entityData).ascension); - return super.initialize(world, difficulty, spawnReason, entityData, entityNbt); - } - - @Override - public void readCustomDataFromNbt(NbtCompound nbt) { - if (nbt.contains("ascension")) { - dataTracker.set(ASCENSION, nbt.getByte("ascension")); - } - super.readCustomDataFromNbt(nbt); - } - - @Override - public void writeCustomDataToNbt(NbtCompound nbt) { - nbt.putByte("ascension", dataTracker.get(ASCENSION)); - super.writeCustomDataToNbt(nbt); - } - - @Override - public Packet createSpawnPacket() { - return new EntitySpawnS2CPacket(this); - } - - @Override - public boolean damage(DamageSource source, float amount) { - var attacker = source.getAttacker(); - var success = false; - - if (attacker instanceof LivingEntity entity) { - var weapon = entity.getStackInHand(Hand.MAIN_HAND); - if (weapon.isIn(RIGHTEOUS_WEAPONS)) { - amount /= 4; - success = true; - } else if (weapon.isIn(SACRED_WEAPONS)) { - success = true; - } - } - - if (success) { - return super.damage(source, amount); - } - - if (source.isOutOfWorld()) { - remove(RemovalReason.DISCARDED); - } - - return false; - } - - @Override - public void onDeath(DamageSource source) { - super.onDeath(source); - } - - @Nullable - @Override - protected SoundEvent getHurtSound(DamageSource source) { - return null; - } - - @Nullable - @Override - protected SoundEvent getDeathSound() { - return ParadiseLostSoundEvents.ENTITY_NIGHTMARE_DEATH; - } - - @Nullable - @Override - protected SoundEvent getAmbientSound() { - return ParadiseLostSoundEvents.ENTITY_NIGHTMARE_AMBIENT; - } - - @Override - public int getMinAmbientSoundDelay() { - return 250; - } - - @Override - protected void pushAway(Entity entity) { - } - - @Override - public void pushAwayFrom(Entity entity) { - } - - @Override - protected void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition) { - } - - @Override - public boolean handleFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { - return false; - } - - public record RookData(byte ascension) implements EntityData { - } -} diff --git a/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java b/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java index 4603002de..230c3b75c 100644 --- a/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java +++ b/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java @@ -679,7 +679,7 @@ public boolean shouldResetPath() { protected boolean isTargetPos(WorldView world, BlockPos pos) { if (world.getBlockEntity(pos) instanceof FoodBowlBlockEntity foodBowl) { - ItemStack foodStack = foodBowl.getStack(0); + ItemStack foodStack = foodBowl.getContainedItem(); return foodStack.isFood() && foodStack.getItem().getFoodComponent().isMeat(); } return false; @@ -700,7 +700,7 @@ public void tick() { protected void tryEat() { if (world.getBlockEntity(targetPos) instanceof FoodBowlBlockEntity foodBowl) { - ItemStack foodStack = foodBowl.getStack(0); + ItemStack foodStack = foodBowl.getContainedItem(); if (foodStack.isFood() && foodStack.getItem().getFoodComponent().isMeat()) { feedMob(foodStack); } diff --git a/src/main/java/net/id/paradiselost/entities/projectile/DartEntity.java b/src/main/java/net/id/paradiselost/entities/projectile/DartEntity.java deleted file mode 100644 index 51ae16834..000000000 --- a/src/main/java/net/id/paradiselost/entities/projectile/DartEntity.java +++ /dev/null @@ -1,38 +0,0 @@ -package net.id.paradiselost.entities.projectile; - -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.projectile.PersistentProjectileEntity; -import net.minecraft.world.World; - -public abstract class DartEntity extends PersistentProjectileEntity { - protected int ticksInAir; - - public DartEntity(EntityType entityType, double x, double y, double z, World world) { - super(entityType, x, y, z, world); - this.setNoGravity(true); - } - - public DartEntity(EntityType entityType, LivingEntity owner, World world) { - super(entityType, owner, world); - this.setNoGravity(true); - } - - public DartEntity(EntityType entityType, World world) { - super(entityType, world); - this.setNoGravity(true); - } - - @Override - public void tick() { - super.tick(); - - if (!this.onGround) { - this.ticksInAir++; - } - - if (this.ticksInAir > 500) { - this.discard(); - } - } -} diff --git a/src/main/java/net/id/paradiselost/entities/projectile/PoisonDartEntity.java b/src/main/java/net/id/paradiselost/entities/projectile/PoisonDartEntity.java deleted file mode 100644 index 27749dcda..000000000 --- a/src/main/java/net/id/paradiselost/entities/projectile/PoisonDartEntity.java +++ /dev/null @@ -1,42 +0,0 @@ -package net.id.paradiselost.entities.projectile; - -import net.id.paradiselost.effect.condition.Conditions; -import net.id.paradiselost.entities.ParadiseLostEntityTypes; -import net.id.incubus_core.condition.api.ConditionAPI; -import net.id.incubus_core.condition.api.Persistence; -import net.id.incubus_core.condition.base.ConditionManager; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class PoisonDartEntity extends DartEntity { - public PoisonDartEntity(EntityType entityType, World world) { - super(entityType, world); - } - - protected PoisonDartEntity(EntityType entityType, double x, double y, double z, World world) { - super(entityType, x, y, z, world); - } - - protected PoisonDartEntity(EntityType entityType, LivingEntity owner, World world) { - super(entityType, owner, world); - } - - public PoisonDartEntity(LivingEntity owner, World world) { - this(ParadiseLostEntityTypes.POISON_DART, owner, world); - } - - @Override - protected void onHit(LivingEntity target) { - super.onHit(target); - - ConditionManager manager = ConditionAPI.getConditionManager(target); - manager.add(Conditions.VENOM, Persistence.TEMPORARY, 120F); // this is probably an appropriate value - } - - @Override - protected ItemStack asItemStack() { - return ItemStack.EMPTY; - } -} diff --git a/src/main/java/net/id/paradiselost/entities/projectile/PoisonNeedleEntity.java b/src/main/java/net/id/paradiselost/entities/projectile/PoisonNeedleEntity.java deleted file mode 100644 index 3f077ceda..000000000 --- a/src/main/java/net/id/paradiselost/entities/projectile/PoisonNeedleEntity.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.id.paradiselost.entities.projectile; - -import net.id.paradiselost.entities.ParadiseLostEntityTypes; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class PoisonNeedleEntity extends PoisonDartEntity { - public PoisonNeedleEntity(EntityType entityType, World world) { - super(entityType, world); - this.setNoGravity(false); - } - - public PoisonNeedleEntity(double x, double y, double z, World world) { - super(ParadiseLostEntityTypes.POISON_NEEDLE, x, y, z, world); - this.setNoGravity(false); - } - - public PoisonNeedleEntity(LivingEntity owner, World world) { - super(ParadiseLostEntityTypes.POISON_NEEDLE, owner, world); - this.setNoGravity(false); - } - - @Override - protected ItemStack asItemStack() { - return ItemStack.EMPTY; - } -} diff --git a/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java b/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java index 374e1080e..58f20f9ab 100644 --- a/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java +++ b/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java @@ -17,7 +17,6 @@ import net.id.paradiselost.items.tools.bloodstone.CherineBloodstoneItem; import net.id.paradiselost.items.tools.bloodstone.SurtrumBloodstoneItem; import net.id.paradiselost.items.tools.bloodstone.OlviteBloodstoneItem; -import net.id.paradiselost.items.utils.ParadiseLostRarity; import net.id.paradiselost.registry.ParadiseLostRegistryQueues; import net.id.incubus_core.util.RegistryQueue.Action; import net.minecraft.block.Block; @@ -72,7 +71,6 @@ private static Settings tool() { private static final Settings tool = tool(); private static final Settings rareTool = tool().rarity(RARE); - private static final Settings paradiseLostLootTool = tool().rarity(ParadiseLostRarity.PARADISE_LOST_LOOT); private static Settings unstackableTool() { return tool().maxCount(1); } @@ -118,7 +116,6 @@ private static Settings wearable() { private static final Settings WEARABLE = wearable(); private static final Settings RARE_WEARABLE = wearable().rarity(RARE); - private static final Settings PARADISE_LOST_LOOT_WEARABLE = wearable().rarity(ParadiseLostRarity.PARADISE_LOST_LOOT); // Olvite public static final ArmorItem OLVITE_HELMET = add("olvite_helmet", new ArmorItem(ParadiseLostArmorMaterials.OLVITE, HEAD, WEARABLE)); @@ -213,10 +210,10 @@ private static FabricItemSettings building_block() { public static final BlockItem PINK_CLOUD = add("pink_cloud", ParadiseLostBlocks.PINK_CLOUD, building_block()); public static final BlockItem GOLDEN_CLOUD = add("golden_cloud", ParadiseLostBlocks.GOLDEN_CLOUD, building_block()); // planks - public static final BlockItem AUREL_PLANKS = add("aurel_planks", ParadiseLostBlocks.AUREL_PLANKS, building_block()); - public static final BlockItem MOTHER_AUREL_PLANKS = add("mother_aurel_planks", ParadiseLostBlocks.MOTHER_AUREL_PLANKS, building_block()); - public static final BlockItem ORANGE_PLANKS = add("orange_planks", ParadiseLostBlocks.ORANGE_PLANKS, building_block()); - public static final BlockItem WISTERIA_PLANKS = add("wisteria_planks", ParadiseLostBlocks.WISTERIA_PLANKS, building_block()); + public static final BlockItem AUREL_PLANKS = add("aurel_planks", ParadiseLostBlocks.AUREL_WOODSTUFF.plank(), building_block()); + public static final BlockItem MOTHER_AUREL_PLANKS = add("mother_aurel_planks", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.plank(), building_block()); + public static final BlockItem ORANGE_PLANKS = add("orange_planks", ParadiseLostBlocks.ORANGE_WOODSTUFF.plank(), building_block()); + public static final BlockItem WISTERIA_PLANKS = add("wisteria_planks", ParadiseLostBlocks.WISTERIA_WOODSTUFF.plank(), building_block()); public static final BlockItem AUREL_BOOKSHELF = add("aurel_bookshelf", ParadiseLostBlocks.AUREL_BOOKSHELF, building_block()); // ores public static final BlockItem CHERINE_ORE = add("cherine_ore", ParadiseLostBlocks.CHERINE_ORE, building_block()); @@ -231,34 +228,34 @@ private static FabricItemSettings building_block() { // move this somewhere else public static final BlockItem LEVITATOR = add("levitator", ParadiseLostBlocks.LEVITATOR, building_block()); // logs - public static final BlockItem AUREL_LOG = add("aurel_log", ParadiseLostBlocks.AUREL_LOG, building_block()); + public static final BlockItem AUREL_LOG = add("aurel_log", ParadiseLostBlocks.AUREL_WOODSTUFF.log(), building_block()); public static final BlockItem MOTTLED_AUREL_LOG = add("mottled_aurel_log", ParadiseLostBlocks.MOTTLED_AUREL_LOG, building_block()); public static final BlockItem MOTTLED_AUREL_FALLEN_LOG = add("mottled_aurel_fallen_log", ParadiseLostBlocks.MOTTLED_AUREL_FALLEN_LOG, building_block()); - public static final BlockItem MOTHER_AUREL_LOG = add("mother_aurel_log", ParadiseLostBlocks.MOTHER_AUREL_LOG, building_block()); - public static final BlockItem ORANGE_LOG = add("orange_log", ParadiseLostBlocks.ORANGE_LOG, building_block()); - public static final BlockItem WISTERIA_LOG = add("wisteria_log", ParadiseLostBlocks.WISTERIA_LOG, building_block()); + public static final BlockItem MOTHER_AUREL_LOG = add("mother_aurel_log", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.log(), building_block()); + public static final BlockItem ORANGE_LOG = add("orange_log", ParadiseLostBlocks.ORANGE_WOODSTUFF.log(), building_block()); + public static final BlockItem WISTERIA_LOG = add("wisteria_log", ParadiseLostBlocks.WISTERIA_WOODSTUFF.log(), building_block()); // stripped logs - public static final BlockItem STRIPPED_AUREL_LOG = add("stripped_aurel_log", ParadiseLostBlocks.STRIPPED_AUREL_LOG, building_block()); - public static final BlockItem STRIPPED_MOTHER_AUREL_LOG = add("stripped_mother_aurel_log", ParadiseLostBlocks.STRIPPED_MOTHER_AUREL_LOG, building_block()); - public static final BlockItem STRIPPED_ORANGE_LOG = add("stripped_orange_log", ParadiseLostBlocks.STRIPPED_ORANGE_LOG, building_block()); - public static final BlockItem STRIPPED_WISTERIA_LOG = add("stripped_wisteria_log", ParadiseLostBlocks.STRIPPED_WISTERIA_LOG, building_block()); + public static final BlockItem STRIPPED_AUREL_LOG = add("stripped_aurel_log", ParadiseLostBlocks.AUREL_WOODSTUFF.strippedLog(), building_block()); + public static final BlockItem STRIPPED_MOTHER_AUREL_LOG = add("stripped_mother_aurel_log", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.strippedLog(), building_block()); + public static final BlockItem STRIPPED_ORANGE_LOG = add("stripped_orange_log", ParadiseLostBlocks.ORANGE_WOODSTUFF.strippedLog(), building_block()); + public static final BlockItem STRIPPED_WISTERIA_LOG = add("stripped_wisteria_log", ParadiseLostBlocks.WISTERIA_WOODSTUFF.strippedLog(), building_block()); // stripped wood - public static final BlockItem STRIPPED_AUREL_WOOD = add("stripped_aurel_wood", ParadiseLostBlocks.STRIPPED_AUREL_WOOD, building_block()); - public static final BlockItem STRIPPED_MOTHER_AUREL_WOOD = add("stripped_mother_aurel_wood", ParadiseLostBlocks.STRIPPED_MOTHER_AUREL_WOOD, building_block()); - public static final BlockItem STRIPPED_ORANGE_WOOD = add("stripped_orange_wood", ParadiseLostBlocks.STRIPPED_ORANGE_WOOD, building_block()); - public static final BlockItem STRIPPED_WISTERIA_WOOD = add("stripped_wisteria_wood", ParadiseLostBlocks.STRIPPED_WISTERIA_WOOD, building_block()); + public static final BlockItem STRIPPED_AUREL_WOOD = add("stripped_aurel_wood", ParadiseLostBlocks.AUREL_WOODSTUFF.strippedWood(), building_block()); + public static final BlockItem STRIPPED_MOTHER_AUREL_WOOD = add("stripped_mother_aurel_wood", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.strippedWood(), building_block()); + public static final BlockItem STRIPPED_ORANGE_WOOD = add("stripped_orange_wood", ParadiseLostBlocks.ORANGE_WOODSTUFF.strippedWood(), building_block()); + public static final BlockItem STRIPPED_WISTERIA_WOOD = add("stripped_wisteria_wood", ParadiseLostBlocks.WISTERIA_WOODSTUFF.strippedWood(), building_block()); // wood - public static final BlockItem AUREL_WOOD = add("aurel_wood", ParadiseLostBlocks.AUREL_WOOD, building_block()); - public static final BlockItem MOTHER_AUREL_WOOD = add("mother_aurel_wood", ParadiseLostBlocks.MOTHER_AUREL_WOOD, building_block()); - public static final BlockItem ORANGE_WOOD = add("orange_wood", ParadiseLostBlocks.ORANGE_WOOD, building_block()); - public static final BlockItem WISTERIA_WOOD = add("wisteria_wood", ParadiseLostBlocks.WISTERIA_WOOD, building_block()); + public static final BlockItem AUREL_WOOD = add("aurel_wood", ParadiseLostBlocks.AUREL_WOODSTUFF.wood(), building_block()); + public static final BlockItem MOTHER_AUREL_WOOD = add("mother_aurel_wood", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.wood(), building_block()); + public static final BlockItem ORANGE_WOOD = add("orange_wood", ParadiseLostBlocks.ORANGE_WOODSTUFF.wood(), building_block()); + public static final BlockItem WISTERIA_WOOD = add("wisteria_wood", ParadiseLostBlocks.WISTERIA_WOODSTUFF.wood(), building_block()); // glass // slabs - public static final BlockItem AUREL_SLAB = add("aurel_slab", ParadiseLostBlocks.AUREL_SLAB, building_block()); - public static final BlockItem MOTHER_AUREL_SLAB = add("mother_aurel_slab", ParadiseLostBlocks.MOTHER_AUREL_SLAB, building_block()); - public static final BlockItem ORANGE_SLAB = add("orange_slab", ParadiseLostBlocks.ORANGE_SLAB, building_block()); - public static final BlockItem WISTERIA_SLAB = add("wisteria_slab", ParadiseLostBlocks.WISTERIA_SLAB, building_block()); + public static final BlockItem AUREL_SLAB = add("aurel_slab", ParadiseLostBlocks.AUREL_WOODSTUFF.plankSlab(), building_block()); + public static final BlockItem MOTHER_AUREL_SLAB = add("mother_aurel_slab", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.plankSlab(), building_block()); + public static final BlockItem ORANGE_SLAB = add("orange_slab", ParadiseLostBlocks.ORANGE_WOODSTUFF.plankSlab(), building_block()); + public static final BlockItem WISTERIA_SLAB = add("wisteria_slab", ParadiseLostBlocks.WISTERIA_WOODSTUFF.plankSlab(), building_block()); // smooth stuff // cobble variants public static final BlockItem MOSSY_FLOESTONE = add("mossy_floestone", ParadiseLostBlocks.MOSSY_FLOESTONE, building_block()); @@ -280,10 +277,10 @@ private static FabricItemSettings building_block() { public static final BlockItem GOLDEN_AMBER_TILE = add("golden_amber_tile", ParadiseLostBlocks.GOLDEN_AMBER_TILE, building_block()); // stairs - public static final BlockItem AUREL_STAIRS = add("aurel_stairs", ParadiseLostBlocks.AUREL_STAIRS, building_block()); - public static final BlockItem MOTHER_AUREL_STAIRS = add("mother_aurel_stairs", ParadiseLostBlocks.MOTHER_AUREL_STAIRS, building_block()); - public static final BlockItem ORANGE_STAIRS = add("orange_stairs", ParadiseLostBlocks.ORANGE_STAIRS, building_block()); - public static final BlockItem WISTERIA_STAIRS = add("wisteria_stairs", ParadiseLostBlocks.WISTERIA_STAIRS, building_block()); + public static final BlockItem AUREL_STAIRS = add("aurel_stairs", ParadiseLostBlocks.AUREL_WOODSTUFF.plankStairs(), building_block()); + public static final BlockItem MOTHER_AUREL_STAIRS = add("mother_aurel_stairs", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.plankStairs(), building_block()); + public static final BlockItem ORANGE_STAIRS = add("orange_stairs", ParadiseLostBlocks.ORANGE_WOODSTUFF.plankStairs(), building_block()); + public static final BlockItem WISTERIA_STAIRS = add("wisteria_stairs", ParadiseLostBlocks.WISTERIA_WOODSTUFF.plankStairs(), building_block()); // stone stairs + slabs public static final BlockItem FLOESTONE_STAIRS = add("floestone_stairs", ParadiseLostBlocks.FLOESTONE_STAIRS, building_block()); public static final BlockItem COBBLED_FLOESTONE_STAIRS = add("cobbled_floestone_stairs", ParadiseLostBlocks.COBBLED_FLOESTONE_STAIRS, building_block()); @@ -316,16 +313,16 @@ private static FabricItemSettings decoration() { private static final FabricItemSettings hat = decoration().equipmentSlot(stack -> HEAD); // saplings - public static final BlockItem AUREL_SAPLING = add("aurel_sapling", ParadiseLostBlocks.AUREL_SAPLING, decoration, compostable30); - public static final BlockItem MOTHER_AUREL_SAPLING = add("mother_aurel_sapling", ParadiseLostBlocks.MOTHER_AUREL_SAPLING, decoration, compostable30); - public static final BlockItem ORANGE_SAPLING = add("orange_sapling", ParadiseLostBlocks.ORANGE_SAPLING, decoration, compostable30); + public static final BlockItem AUREL_SAPLING = add("aurel_sapling", ParadiseLostBlocks.AUREL_WOODSTUFF.sapling(), decoration, compostable30); + public static final BlockItem MOTHER_AUREL_SAPLING = add("mother_aurel_sapling", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.sapling(), decoration, compostable30); + public static final BlockItem ORANGE_SAPLING = add("orange_sapling", ParadiseLostBlocks.ORANGE_WOODSTUFF.sapling(), decoration, compostable30); public static final BlockItem ROSE_WISTERIA_SAPLING = add("rose_wisteria_sapling", ParadiseLostBlocks.ROSE_WISTERIA_SAPLING, decoration, compostable30); public static final BlockItem FROST_WISTERIA_SAPLING = add("frost_wisteria_sapling", ParadiseLostBlocks.FROST_WISTERIA_SAPLING, decoration, compostable30); public static final BlockItem LAVENDER_WISTERIA_SAPLING = add("lavender_wisteria_sapling", ParadiseLostBlocks.LAVENDER_WISTERIA_SAPLING, decoration, compostable30); // leaves - public static final BlockItem AUREL_LEAVES = add("aurel_leaves", ParadiseLostBlocks.AUREL_LEAVES, decoration, compostable30); - public static final BlockItem MOTHER_AUREL_LEAVES = add("mother_aurel_leaves", ParadiseLostBlocks.MOTHER_AUREL_LEAVES, decoration, compostable30); - public static final BlockItem ORANGE_LEAVES = add("orange_leaves", ParadiseLostBlocks.ORANGE_LEAVES, decoration, compostable30); + public static final BlockItem AUREL_LEAVES = add("aurel_leaves", ParadiseLostBlocks.AUREL_WOODSTUFF.leaves(), decoration, compostable30); + public static final BlockItem MOTHER_AUREL_LEAVES = add("mother_aurel_leaves", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.leaves(), decoration, compostable30); + public static final BlockItem ORANGE_LEAVES = add("orange_leaves", ParadiseLostBlocks.ORANGE_WOODSTUFF.leaves(), decoration, compostable30); public static final BlockItem ROSE_WISTERIA_LEAVES = add("rose_wisteria_leaves", ParadiseLostBlocks.ROSE_WISTERIA_LEAVES, decoration, compostable30); public static final BlockItem FROST_WISTERIA_LEAVES = add("frost_wisteria_leaves", ParadiseLostBlocks.FROST_WISTERIA_LEAVES, decoration, compostable30); public static final BlockItem LAVENDER_WISTERIA_LEAVES = add("lavender_wisteria_leaves", ParadiseLostBlocks.LAVENDER_WISTERIA_LEAVES, decoration, compostable30); @@ -381,25 +378,25 @@ private static FabricItemSettings decoration() { public static final BlockItem CHERINE_CAMPFIRE = add("cherine_campfire", ParadiseLostBlocks.CHERINE_CAMPFIRE, decoration); // door-like things - public static final BlockItem AUREL_DOOR = add("aurel_door", ParadiseLostBlocks.AUREL_DOOR, decoration); - public static final BlockItem MOTHER_AUREL_DOOR = add("mother_aurel_door", ParadiseLostBlocks.MOTHER_AUREL_DOOR, decoration); - public static final BlockItem ORANGE_DOOR = add("orange_door", ParadiseLostBlocks.ORANGE_DOOR, decoration); - public static final BlockItem WISTERIA_DOOR = add("wisteria_door", ParadiseLostBlocks.WISTERIA_DOOR, decoration); - - public static final BlockItem AUREL_TRAPDOOR = add("aurel_trapdoor", ParadiseLostBlocks.AUREL_TRAPDOOR, decoration); - public static final BlockItem MOTHER_AUREL_TRAPDOOR = add("mother_aurel_trapdoor", ParadiseLostBlocks.MOTHER_AUREL_TRAPDOOR, decoration); - public static final BlockItem ORANGE_TRAPDOOR = add("orange_trapdoor", ParadiseLostBlocks.ORANGE_TRAPDOOR, decoration); - public static final BlockItem WISTERIA_TRAPDOOR = add("wisteria_trapdoor", ParadiseLostBlocks.WISTERIA_TRAPDOOR, decoration); - - public static final BlockItem AUREL_FENCE_GATE = add("aurel_fence_gate", ParadiseLostBlocks.AUREL_FENCE_GATE, decoration); - public static final BlockItem MOTHER_AUREL_FENCE_GATE = add("mother_aurel_fence_gate", ParadiseLostBlocks.MOTHER_AUREL_FENCE_GATE, decoration); - public static final BlockItem ORANGE_FENCE_GATE = add("orange_fence_gate", ParadiseLostBlocks.ORANGE_FENCE_GATE, decoration); - public static final BlockItem WISTERIA_FENCE_GATE = add("wisteria_fence_gate", ParadiseLostBlocks.WISTERIA_FENCE_GATE, decoration); + public static final BlockItem AUREL_DOOR = add("aurel_door", ParadiseLostBlocks.AUREL_WOODSTUFF.door(), decoration); + public static final BlockItem MOTHER_AUREL_DOOR = add("mother_aurel_door", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.door(), decoration); + public static final BlockItem ORANGE_DOOR = add("orange_door", ParadiseLostBlocks.ORANGE_WOODSTUFF.door(), decoration); + public static final BlockItem WISTERIA_DOOR = add("wisteria_door", ParadiseLostBlocks.WISTERIA_WOODSTUFF.door(), decoration); + + public static final BlockItem AUREL_TRAPDOOR = add("aurel_trapdoor", ParadiseLostBlocks.AUREL_WOODSTUFF.trapdoor(), decoration); + public static final BlockItem MOTHER_AUREL_TRAPDOOR = add("mother_aurel_trapdoor", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.trapdoor(), decoration); + public static final BlockItem ORANGE_TRAPDOOR = add("orange_trapdoor", ParadiseLostBlocks.ORANGE_WOODSTUFF.trapdoor(), decoration); + public static final BlockItem WISTERIA_TRAPDOOR = add("wisteria_trapdoor", ParadiseLostBlocks.WISTERIA_WOODSTUFF.trapdoor(), decoration); + + public static final BlockItem AUREL_FENCE_GATE = add("aurel_fence_gate", ParadiseLostBlocks.AUREL_WOODSTUFF.fenceGate(), decoration); + public static final BlockItem MOTHER_AUREL_FENCE_GATE = add("mother_aurel_fence_gate", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.fenceGate(), decoration); + public static final BlockItem ORANGE_FENCE_GATE = add("orange_fence_gate", ParadiseLostBlocks.ORANGE_WOODSTUFF.fenceGate(), decoration); + public static final BlockItem WISTERIA_FENCE_GATE = add("wisteria_fence_gate", ParadiseLostBlocks.WISTERIA_WOODSTUFF.fenceGate(), decoration); // fences - public static final BlockItem AUREL_FENCE = add("aurel_fence", ParadiseLostBlocks.AUREL_FENCE, decoration); - public static final BlockItem MOTHER_AUREL_FENCE = add("mother_aurel_fence", ParadiseLostBlocks.MOTHER_AUREL_FENCE, decoration); - public static final BlockItem ORANGE_FENCE = add("orange_fence", ParadiseLostBlocks.ORANGE_FENCE, decoration); - public static final BlockItem WISTERIA_FENCE = add("wisteria_fence", ParadiseLostBlocks.WISTERIA_FENCE, decoration); + public static final BlockItem AUREL_FENCE = add("aurel_fence", ParadiseLostBlocks.AUREL_WOODSTUFF.fence(), decoration); + public static final BlockItem MOTHER_AUREL_FENCE = add("mother_aurel_fence", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.fence(), decoration); + public static final BlockItem ORANGE_FENCE = add("orange_fence", ParadiseLostBlocks.ORANGE_WOODSTUFF.fence(), decoration); + public static final BlockItem WISTERIA_FENCE = add("wisteria_fence", ParadiseLostBlocks.WISTERIA_WOODSTUFF.fence(), decoration); // walls public static final BlockItem FLOESTONE_WALL = add("floestone_wall", ParadiseLostBlocks.FLOESTONE_WALL, decoration); public static final BlockItem COBBLED_FLOESTONE_WALL = add("cobbled_floestone_wall", ParadiseLostBlocks.COBBLED_FLOESTONE_WALL, decoration); @@ -417,38 +414,32 @@ private static FabricItemSettings decoration() { public static final BlockItem FARMLAND = add("farmland", ParadiseLostBlocks.FARMLAND, decoration); public static final BlockItem DIRT_PATH = add("grass_path", ParadiseLostBlocks.DIRT_PATH, decoration); // signs, wall stuff. - public static final SignItem AUREL_SIGN = add("aurel_sign", new SignItem(sign, ParadiseLostBlocks.AUREL_SIGN, ParadiseLostBlocks.AUREL_WALL_SIGN)); - public static final SignItem MOTHER_AUREL_SIGN = add("mother_aurel_sign", new SignItem(sign, ParadiseLostBlocks.MOTHER_AUREL_SIGN, ParadiseLostBlocks.MOTHER_AUREL_WALL_SIGN)); - public static final SignItem ORANGE_SIGN = add("orange_sign", new SignItem(sign, ParadiseLostBlocks.ORANGE_SIGN, ParadiseLostBlocks.ORANGE_WALL_SIGN)); - public static final SignItem WISTERIA_SIGN = add("wisteria_sign", new SignItem(sign, ParadiseLostBlocks.WISTERIA_SIGN, ParadiseLostBlocks.WISTERIA_WALL_SIGN)); + public static final SignItem AUREL_SIGN = add("aurel_sign", new SignItem(sign, ParadiseLostBlocks.AUREL_SIGNS.sign(), ParadiseLostBlocks.AUREL_SIGNS.wallSign())); + public static final SignItem MOTHER_AUREL_SIGN = add("mother_aurel_sign", new SignItem(sign, ParadiseLostBlocks.MOTHER_AUREL_SIGNS.sign(), ParadiseLostBlocks.MOTHER_AUREL_SIGNS.wallSign())); + public static final SignItem ORANGE_SIGN = add("orange_sign", new SignItem(sign, ParadiseLostBlocks.ORANGE_SIGNS.sign(), ParadiseLostBlocks.ORANGE_SIGNS.wallSign())); + public static final SignItem WISTERIA_SIGN = add("wisteria_sign", new SignItem(sign, ParadiseLostBlocks.WISTERIA_SIGNS.sign(), ParadiseLostBlocks.WISTERIA_SIGNS.wallSign())); // beds // etc. - public static final BlockItem AUREL_BUTTON = add("aurel_button", ParadiseLostBlocks.AUREL_BUTTON, decoration); - public static final BlockItem MOTHER_AUREL_BUTTON = add("mother_aurel_button", ParadiseLostBlocks.MOTHER_AUREL_BUTTON, decoration); - public static final BlockItem ORANGE_BUTTON = add("orange_button", ParadiseLostBlocks.ORANGE_BUTTON, decoration); - public static final BlockItem WISTERIA_BUTTON = add("wisteria_button", ParadiseLostBlocks.WISTERIA_BUTTON, decoration); + public static final BlockItem AUREL_BUTTON = add("aurel_button", ParadiseLostBlocks.AUREL_WOODSTUFF.button(), decoration); + public static final BlockItem MOTHER_AUREL_BUTTON = add("mother_aurel_button", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.button(), decoration); + public static final BlockItem ORANGE_BUTTON = add("orange_button", ParadiseLostBlocks.ORANGE_WOODSTUFF.button(), decoration); + public static final BlockItem WISTERIA_BUTTON = add("wisteria_button", ParadiseLostBlocks.WISTERIA_WOODSTUFF.button(), decoration); - public static final BlockItem AUREL_PRESSURE_PLATE = add("aurel_pressure_plate", ParadiseLostBlocks.AUREL_PRESSURE_PLATE, decoration); - public static final BlockItem MOTHER_AUREL_PRESSURE_PLATE = add("mother_aurel_pressure_plate", ParadiseLostBlocks.MOTHER_AUREL_PRESSURE_PLATE, decoration); - public static final BlockItem ORANGE_PRESSURE_PLATE = add("orange_pressure_plate", ParadiseLostBlocks.ORANGE_PRESSURE_PLATE, decoration); - public static final BlockItem WISTERIA_PRESSURE_PLATE = add("wisteria_pressure_plate", ParadiseLostBlocks.WISTERIA_PRESSURE_PLATE, decoration); + public static final BlockItem AUREL_PRESSURE_PLATE = add("aurel_pressure_plate", ParadiseLostBlocks.AUREL_WOODSTUFF.pressurePlate(), decoration); + public static final BlockItem MOTHER_AUREL_PRESSURE_PLATE = add("mother_aurel_pressure_plate", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.pressurePlate(), decoration); + public static final BlockItem ORANGE_PRESSURE_PLATE = add("orange_pressure_plate", ParadiseLostBlocks.ORANGE_WOODSTUFF.pressurePlate(), decoration); + public static final BlockItem WISTERIA_PRESSURE_PLATE = add("wisteria_pressure_plate", ParadiseLostBlocks.WISTERIA_WOODSTUFF.pressurePlate(), decoration); //TODO: Implement dungeon switch block // public static final BlockItem DUNGEON_SWITCH = add("dungeonswitch", ParadiseLostBlocks.DUNGEON_SWITCH, decoration); - // these should be moved... somewhere? - public static final BoatItem AUREL_BOAT = ParadiseLostBlocks.AUREL.boatFactory(boat).item; - public static final BoatItem MOTHER_AUREL_BOAT = ParadiseLostBlocks.MOTHER_AUREL.boatFactory(boat).item; - public static final BoatItem ORANGE_BOAT = ParadiseLostBlocks.ORANGE.boatFactory(boat).item; - public static final BoatItem WISTERIA_BOAT = ParadiseLostBlocks.WISTERIA.boatFactory(boat).item; - // Chests - public static final BlockItem AUREL_CHEST = add("skyroot_chest", ParadiseLostBlocks.AUREL_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); - public static final BlockItem MOTHER_AUREL_CHEST = add("golden_oak_chest", ParadiseLostBlocks.MOTHER_AUREL_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); - public static final BlockItem ORANGE_CHEST = add("orange_chest", ParadiseLostBlocks.ORANGE_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); - public static final BlockItem CRYSTAL_CHEST = add("crystal_chest", ParadiseLostBlocks.CRYSTAL_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); - public static final BlockItem WISTERIA_CHEST = add("wisteria_chest", ParadiseLostBlocks.WISTERIA_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); +// public static final BlockItem AUREL_CHEST = add("skyroot_chest", ParadiseLostBlocks.AUREL_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); +// public static final BlockItem MOTHER_AUREL_CHEST = add("golden_oak_chest", ParadiseLostBlocks.MOTHER_AUREL_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); +// public static final BlockItem ORANGE_CHEST = add("orange_chest", ParadiseLostBlocks.ORANGE_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); +// public static final BlockItem CRYSTAL_CHEST = add("crystal_chest", ParadiseLostBlocks.CRYSTAL_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); +// public static final BlockItem WISTERIA_CHEST = add("wisteria_chest", ParadiseLostBlocks.WISTERIA_CHEST, new FabricItemSettings().group(ParadiseLostItemGroups.PARADISE_LOST_DECORATIONS)); public static void init() { ParadiseLostRegistryQueues.ITEM.register(); diff --git a/src/main/java/net/id/paradiselost/items/tools/bloodstone/BloodstoneCapturedData.java b/src/main/java/net/id/paradiselost/items/tools/bloodstone/BloodstoneCapturedData.java index 0fc74a480..f9e25568e 100644 --- a/src/main/java/net/id/paradiselost/items/tools/bloodstone/BloodstoneCapturedData.java +++ b/src/main/java/net/id/paradiselost/items/tools/bloodstone/BloodstoneCapturedData.java @@ -2,8 +2,6 @@ import net.id.paradiselost.entities.passive.moa.MoaAttributes; import net.id.paradiselost.entities.passive.moa.MoaEntity; -import net.id.incubus_core.condition.api.ConditionAPI; -import net.id.incubus_core.condition.base.ConditionManager; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.nbt.NbtCompound; @@ -128,14 +126,6 @@ public static BloodstoneCapturedData fromEntity(LivingEntity entity) { bloodstoneCapturedData.DF = "" + entity.getArmor(); bloodstoneCapturedData.TF = "" + MathHelper.floor(entity.getAttributeValue(EntityAttributes.GENERIC_ARMOR_TOUGHNESS)); - //abstentine - ConditionManager condMan = ConditionAPI.getConditionManager(entity); - ConditionAPI.getValidConditions(entity.getType()).forEach(condition -> { - float severity = condMan.getScaledSeverity(condition); - if (severity > 0) - bloodstoneCapturedData.conditionDataList.add(new ConditionData(condition.getId().getPath(), severity)); - - }); return bloodstoneCapturedData; } diff --git a/src/main/java/net/id/paradiselost/items/utils/ParadiseLostRarity.java b/src/main/java/net/id/paradiselost/items/utils/ParadiseLostRarity.java deleted file mode 100644 index 8e5ab7dae..000000000 --- a/src/main/java/net/id/paradiselost/items/utils/ParadiseLostRarity.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.id.paradiselost.items.utils; - -import net.id.incubus_core.util.EnumExtender; -import net.minecraft.util.Formatting; -import net.minecraft.util.Rarity; - -public class ParadiseLostRarity { - public static Rarity PARADISE_LOST_LOOT = EnumExtender.add(Rarity.class, "PARADISE_LOST_LOOT", Formatting.GREEN); -} diff --git a/src/main/java/net/id/paradiselost/mixin/Plugin.java b/src/main/java/net/id/paradiselost/mixin/Plugin.java index b5a737442..525b6b054 100644 --- a/src/main/java/net/id/paradiselost/mixin/Plugin.java +++ b/src/main/java/net/id/paradiselost/mixin/Plugin.java @@ -1,7 +1,6 @@ package net.id.paradiselost.mixin; import net.fabricmc.loader.api.FabricLoader; -import net.id.paradiselost.util.CompatConfig; import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; @@ -23,12 +22,6 @@ public String getRefMapperConfig() { @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { - if (mixinClassName.equals("net.id.paradiselost.mixin.client.ClientPlayerEntityMixin")) { - return !CompatConfig.SPECTRUM_WORKAROUND; - } - if (isDevel) { - return true; - } return !mixinClassName.startsWith("net.id.paradiselost.mixin.devel."); } diff --git a/src/main/java/net/id/paradiselost/mixin/block/BlockEntityTypeMixin.java b/src/main/java/net/id/paradiselost/mixin/block/BlockEntityTypeMixin.java new file mode 100644 index 000000000..ebbca5089 --- /dev/null +++ b/src/main/java/net/id/paradiselost/mixin/block/BlockEntityTypeMixin.java @@ -0,0 +1,34 @@ +package net.id.paradiselost.mixin.block; + +import com.google.common.collect.ImmutableSet; +import net.minecraft.block.Block; +import net.minecraft.block.entity.BlockEntityType; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.HashSet; +import java.util.Set; + +@Mixin(BlockEntityType.class) +public class BlockEntityTypeMixin { + @Mutable + @Shadow + @Final + private Set blocks; + + /** + * Makes the set of blocks in the BlockEntityTypes mutable, so that they can be modified. + * Only do this once the set has been created (made immutable). + */ + @Inject(method = "", at = @At("RETURN")) + private void makeBlocksMutable(CallbackInfo ci) { + if (this.blocks instanceof ImmutableSet) { + this.blocks = new HashSet<>(this.blocks); + } + } +} diff --git a/src/main/java/net/id/paradiselost/mixin/client/render/EntityRenderDispatcherMixin.java b/src/main/java/net/id/paradiselost/mixin/client/render/EntityRenderDispatcherMixin.java deleted file mode 100644 index 65a6c8df1..000000000 --- a/src/main/java/net/id/paradiselost/mixin/client/render/EntityRenderDispatcherMixin.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.id.paradiselost.mixin.client.render; - -import net.id.paradiselost.entities.misc.RookEntity; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.entity.EntityRenderDispatcher; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.Entity; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(EntityRenderDispatcher.class) -public class EntityRenderDispatcherMixin { - @Inject( - method = "renderHitbox", - at = @At("HEAD"), - cancellable = true - ) - private static void renderHitbox(MatrixStack matrices, VertexConsumer vertices, Entity entity, float tickDelta, CallbackInfo ci) { - if (entity instanceof RookEntity) { - ci.cancel(); - } - } -} diff --git a/src/main/java/net/id/paradiselost/mixin/entity/EntityMixin.java b/src/main/java/net/id/paradiselost/mixin/entity/EntityMixin.java index 7949d9863..f08b723a7 100644 --- a/src/main/java/net/id/paradiselost/mixin/entity/EntityMixin.java +++ b/src/main/java/net/id/paradiselost/mixin/entity/EntityMixin.java @@ -1,7 +1,6 @@ package net.id.paradiselost.mixin.entity; import net.id.paradiselost.blocks.ParadiseLostBlocks; -import net.id.paradiselost.effect.ParadiseLostStatusEffects; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; @@ -14,9 +13,9 @@ @Mixin(Entity.class) public abstract class EntityMixin { - @Redirect(method = "getVelocityMultiplier", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getVelocityMultiplier()F"), require = 2) - private float getVelocityMultiplier(Block target) { - //TODO: reimplement if we re-add slippery blocks +// @Redirect(method = "getVelocityMultiplier", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getVelocityMultiplier()F"), require = 2) +// private float getVelocityMultiplier(Block target) { +// TODO: reimplement if we re-add slippery blocks // if (target == ParadiseLostBlocks.QUICKSOIL || target == ParadiseLostBlocks.QUICKSOIL_GLASS || target == ParadiseLostBlocks.QUICKSOIL_GLASS_PANE) { // Entity entity = ((Entity) (Object) this); // boolean isVehicle = entity instanceof BoatEntity || entity instanceof MinecartEntity; @@ -31,21 +30,6 @@ private float getVelocityMultiplier(Block target) { // return (1 + Math.max(calculatedChange, 0)); // } // } - return target.getVelocityMultiplier(); - } - - @Inject(method = "baseTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;updateSwimming()V")) - private void springWaterEffects(CallbackInfo ci) { - Entity entity = ((Entity) (Object) this); - - if (entity instanceof LivingEntity livingEntity) { - if (entity.world.getStatesInBoxIfLoaded(entity.getBoundingBox().contract(1.0E-6D)).anyMatch( - (state) -> state.getBlock().equals(ParadiseLostBlocks.SPRING_WATER)) - ) { - livingEntity.addStatusEffect(new StatusEffectInstance(ParadiseLostStatusEffects.SIMMERING, 6000000, 0, true, false, true)); - } else if (livingEntity.hasStatusEffect(ParadiseLostStatusEffects.SIMMERING)) { - livingEntity.removeStatusEffect(ParadiseLostStatusEffects.SIMMERING); - } - } - } +// return target.getVelocityMultiplier(); +// } } diff --git a/src/main/java/net/id/paradiselost/mixin/entity/LivingEntityMixin.java b/src/main/java/net/id/paradiselost/mixin/entity/LivingEntityMixin.java index c558a78dc..0c0352839 100644 --- a/src/main/java/net/id/paradiselost/mixin/entity/LivingEntityMixin.java +++ b/src/main/java/net/id/paradiselost/mixin/entity/LivingEntityMixin.java @@ -4,7 +4,6 @@ import dev.emi.trinkets.api.TrinketsApi; import net.id.paradiselost.entities.ParadiseLostEntityExtensions; import net.id.paradiselost.entities.ParadiseLostEntityTypes; -import net.id.paradiselost.entities.misc.RookEntity; import net.id.paradiselost.entities.passive.moa.MoaAttributes; import net.id.paradiselost.entities.passive.moa.MoaEntity; import net.id.paradiselost.tag.ParadiseLostItemTags; @@ -105,27 +104,4 @@ private void getMoaMaxHealth(CallbackInfoReturnable cir) { cir.cancel(); } } - - @SuppressWarnings("ConstantConditions") - @Inject(method = "addDeathParticles", at = @At("HEAD"), cancellable = true) - private void applyCustomDeathParticles(CallbackInfo ci) { - if (((LivingEntity) ((Object) this)) instanceof RookEntity) { - for (int i = 0; i < 20 + random.nextInt(20); ++i) { - double d = this.random.nextGaussian() * 0.02D; - double e = this.random.nextGaussian() * 0.02D; - double f = this.random.nextGaussian() * 0.02D; - if (random.nextInt(3) == 0) { - this.world.addParticle(ParticleTypes.LARGE_SMOKE, this.getParticleX(1.0D), this.getRandomBodyY(), this.getParticleZ(1.0D), d, e, f); - } - else { - this.world.addParticle(ParticleTypes.SMOKE, this.getParticleX(1.0D), this.getRandomBodyY(), this.getParticleZ(1.0D), d, e, f); - } - - if (random.nextInt(3) == 0) { - this.world.addParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, this.getParticleX(1.0D), this.getRandomBodyY(), this.getParticleZ(1.0D), d / 3, e, f / 3); - } - } - ci.cancel(); - } - } } diff --git a/src/main/java/net/id/paradiselost/mixin/item/AxeItemMixin.java b/src/main/java/net/id/paradiselost/mixin/item/AxeItemMixin.java index 56abc03e5..10b2ffb71 100644 --- a/src/main/java/net/id/paradiselost/mixin/item/AxeItemMixin.java +++ b/src/main/java/net/id/paradiselost/mixin/item/AxeItemMixin.java @@ -28,7 +28,7 @@ public void useOnBlock(ItemUsageContext context, CallbackInfoReturnable items = supplier.generateLoot(new LootContext.Builder(server) diff --git a/src/main/java/net/id/paradiselost/mixin/util/RarityMixin.java b/src/main/java/net/id/paradiselost/mixin/util/RarityMixin.java deleted file mode 100644 index 0b4a85e6b..000000000 --- a/src/main/java/net/id/paradiselost/mixin/util/RarityMixin.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.id.paradiselost.mixin.util; - -import net.id.incubus_core.util.EnumExtender; -import net.minecraft.util.Formatting; -import net.minecraft.util.Rarity; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; - -import java.util.Arrays; - -@Mixin(Rarity.class) -public final class RarityMixin { - @SuppressWarnings("ShadowTarget") - @Shadow(aliases = "field_8905") - @Mutable - @Final private static Rarity[] VALUES; - - static { - EnumExtender.register(Rarity.class, (name, args) -> { - Rarity entry = (Rarity) (Object) new RarityMixin(name, VALUES.length, (Formatting) args[0]); - VALUES = Arrays.copyOf(VALUES, VALUES.length + 1); - return VALUES[VALUES.length - 1] = entry; - }); - } - - private RarityMixin(String valueName, int ordinal, Formatting formatting) { - throw new AssertionError(); - } -} diff --git a/src/main/java/net/id/paradiselost/mixin/util/SignTypeAccessor.java b/src/main/java/net/id/paradiselost/mixin/util/SignTypeAccessor.java new file mode 100644 index 000000000..24fe43b99 --- /dev/null +++ b/src/main/java/net/id/paradiselost/mixin/util/SignTypeAccessor.java @@ -0,0 +1,13 @@ +package net.id.paradiselost.mixin.util; + +import net.minecraft.util.SignType; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(SignType.class) +public interface SignTypeAccessor { + @Invoker + static SignType callRegister(SignType type) { + throw new AssertionError(); + } +} diff --git a/src/main/java/net/id/paradiselost/util/CompatConfig.java b/src/main/java/net/id/paradiselost/util/CompatConfig.java deleted file mode 100644 index a5c0a42e5..000000000 --- a/src/main/java/net/id/paradiselost/util/CompatConfig.java +++ /dev/null @@ -1,12 +0,0 @@ -package net.id.paradiselost.util; - -import static net.id.incubus_core.util.Config.getBoolean; -import static net.id.incubus_core.util.Config.isLoaded; -import static net.id.paradiselost.ParadiseLost.locate; - -public final class CompatConfig { - private CompatConfig() { - } - - public static final boolean SPECTRUM_WORKAROUND = getBoolean(locate("spectrum_workaround"), isLoaded("spectrum")); -} diff --git a/src/main/java/net/id/paradiselost/util/ParadiseLostSignType.java b/src/main/java/net/id/paradiselost/util/ParadiseLostSignType.java new file mode 100644 index 000000000..99f3fe031 --- /dev/null +++ b/src/main/java/net/id/paradiselost/util/ParadiseLostSignType.java @@ -0,0 +1,9 @@ +package net.id.paradiselost.util; + +import net.minecraft.util.SignType; + +public class ParadiseLostSignType extends SignType { + public ParadiseLostSignType(String name) { + super(name); + } +} diff --git a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostTreeConfiguredFeatures.java b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostTreeConfiguredFeatures.java index 137aef5cb..2d2b8abdc 100644 --- a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostTreeConfiguredFeatures.java +++ b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostTreeConfiguredFeatures.java @@ -58,7 +58,7 @@ public class ParadiseLostTreeConfiguredFeatures extends ParadiseLostConfiguredFe public static final RegistryEntry> FALLEN_LAVENDER_LEAVES = register("fallen_lavender_leaves", ParadiseLostFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(new WeightedBlockStateProvider(DataPool.builder().add(LAVENDER_WISTERIA_LEAF_PILE.getDefaultState(), 10).add(LAVENDER_WISTERIA_LEAVES.getDefaultState().with(LeavesBlock.PERSISTENT, true), 2).build()), UniformIntProvider.create(4, 10), ConstantIntProvider.create(7), UniformIntProvider.create(3, 6), 1.2)); public static final RegistryEntry> SHIELD_FALLEN_LEAVES = register("shield_fallen_leaves", Feature.RANDOM_PATCH, Configs.FALLEN_LEAVES_CONFIG); // Logs - public static final RegistryEntry> THICKET_FALLEN_LOG = register("thicket_fallen_log", ParadiseLostFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 6), BlockStateProvider.of(AUREL_LOG), BlockStateProvider.of(LIVERWORT_CARPET), BlockStateProvider.of(LIVERWORT_CARPET), 0.5F, 0.35F, Configs.GENERIC_FLOOR_WHITELIST)); + public static final RegistryEntry> THICKET_FALLEN_LOG = register("thicket_fallen_log", ParadiseLostFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 6), BlockStateProvider.of(AUREL_WOODSTUFF.log()), BlockStateProvider.of(LIVERWORT_CARPET), BlockStateProvider.of(LIVERWORT_CARPET), 0.5F, 0.35F, Configs.GENERIC_FLOOR_WHITELIST)); public static final RegistryEntry> MOTTLED_FALLEN_LOG = register("mottled_fallen_log", ParadiseLostFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 5), BlockStateProvider.of(MOTTLED_AUREL_LOG), BlockStateProvider.of(GRASS), BlockStateProvider.of(ROOTCAP), 0.3F, 0.15F, Configs.GENERIC_FLOOR_WHITELIST)); public static final RegistryEntry> MOTTLED_HOLLOW_FALLEN_LOG = register("mottled_hollow_fallen_log", ParadiseLostFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 5), BlockStateProvider.of(MOTTLED_AUREL_FALLEN_LOG), BlockStateProvider.of(GRASS_FLOWERING), BlockStateProvider.of(ROOTCAP), 0.4F, 0.25F, Configs.GENERIC_FLOOR_WHITELIST)); @@ -116,7 +116,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl private static final RandomPatchFeatureConfig FALLEN_LEAVES_CONFIG = blockPatch(96, 10, 7, new WeightedBlockStateProvider( DataPool.builder() .add(AUREL_LEAF_PILE.getDefaultState(), 8) - .add(AUREL_LEAVES.getDefaultState().with(LeavesBlock.PERSISTENT, true), 1) + .add(AUREL_WOODSTUFF.leaves().getDefaultState().with(LeavesBlock.PERSISTENT, true), 1) )); /* @@ -124,42 +124,42 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl */ //Aurels private static final TreeFeatureConfig AUREL_CONFIG = generateTree( - AUREL_LOG.getDefaultState(), AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + AUREL_WOODSTUFF.log().getDefaultState(), AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new StraightTrunkPlacer(4, 2, 0), new BlobFoliagePlacer(ConstantIntProvider.create(2), ConstantIntProvider.create(0), 3), new TwoLayersFeatureSize(1, 0, 1), true, false ); private static final TreeFeatureConfig FANCY_AUREL_CONFIG = generateTree( - AUREL_LOG.getDefaultState(), AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + AUREL_WOODSTUFF.log().getDefaultState(), AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new LargeOakTrunkPlacer(4, 11, 0), new LargeOakFoliagePlacer(ConstantIntProvider.create(2), ConstantIntProvider.create(4), 4), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)), true, false ); private static final TreeFeatureConfig THICKET_AUREL_CONFIG = generateTree( - AUREL_LOG.getDefaultState(), AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + AUREL_WOODSTUFF.log().getDefaultState(), AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new LargeOakTrunkPlacer(12, 4, 1), new BlobFoliagePlacer(ConstantIntProvider.create(4), ConstantIntProvider.create(4), 3), new TwoLayersFeatureSize(0, 0, 0, OptionalInt.of(4)), true, false ); private static final TreeFeatureConfig AUREL_SHRUB_CONFIG = generateTree( - AUREL_LOG.getDefaultState(), AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + AUREL_WOODSTUFF.log().getDefaultState(), AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new StraightTrunkPlacer(1, 1, 0), new BlobFoliagePlacer(UniformIntProvider.create(1, 3), ConstantIntProvider.create(0), 1), new TwoLayersFeatureSize(1, 0, 1), true, false ); private static final TreeFeatureConfig MOTTLED_AUREL_CONFIG = generateTree( - MOTTLED_AUREL_LOG.getDefaultState(), AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + MOTTLED_AUREL_LOG.getDefaultState(), AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new OvergrownTrunkPlacer(5, 10, 0, BlockStateProvider.of(ROOTCAP), 1 / 14F), new BlobFoliagePlacer(UniformIntProvider.create(2, 3), ConstantIntProvider.create(0), 3), new TwoLayersFeatureSize(1, 0, 1), true, false ); private static final TreeFeatureConfig DWARF_MOTTLED_AUREL_CONFIG = generateTree( - MOTTLED_AUREL_LOG.getDefaultState(), AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + MOTTLED_AUREL_LOG.getDefaultState(), AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new BendingTrunkPlacer(5, 3, 2, 4, UniformIntProvider.create(1, 3)), new RandomSpreadFoliagePlacer(UniformIntProvider.create(3, 4), ConstantIntProvider.create(0), ConstantIntProvider.create(3), 68), new TwoLayersFeatureSize(1, 0, 1), @@ -168,19 +168,19 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl //Fruit trees private static final TreeFeatureConfig ORANGE_TREE_SAPLING_CONFIG = generateTree( - ORANGE_LOG.getDefaultState(), ORANGE_LEAVES.getDefaultState(), DIRT.getDefaultState(), + ORANGE_WOODSTUFF.log().getDefaultState(), ORANGE_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new BendingTrunkPlacer(3, 2, 1, 3, UniformIntProvider.create(1, 2)), new RandomSpreadFoliagePlacer(UniformIntProvider.create(3, 4), ConstantIntProvider.create(0), ConstantIntProvider.create(3), 63), new TwoLayersFeatureSize(1, 0, 1), false, false ); - private static final BlockState ORANGE_LEAVES_BASIC = ORANGE_LEAVES.getDefaultState().with(FruitingLeavesBlock.CAPPED, true).with(FruitingLeavesBlock.NATURAL, true); - private static final BlockState ORANGE_LEAVES_FLOWERING = ORANGE_LEAVES.getDefaultState().with(FruitingLeavesBlock.CAPPED, true).with(FruitingLeavesBlock.NATURAL, true).with(FruitingLeavesBlock.GROWTH, 1); - private static final BlockState ORANGE_LEAVES_FRUITING = ORANGE_LEAVES.getDefaultState().with(FruitingLeavesBlock.CAPPED, true).with(FruitingLeavesBlock.NATURAL, true).with(FruitingLeavesBlock.GROWTH, 2); + private static final BlockState ORANGE_LEAVES_BASIC = ORANGE_WOODSTUFF.leaves().getDefaultState().with(FruitingLeavesBlock.CAPPED, true).with(FruitingLeavesBlock.NATURAL, true); + private static final BlockState ORANGE_LEAVES_FLOWERING = ORANGE_WOODSTUFF.leaves().getDefaultState().with(FruitingLeavesBlock.CAPPED, true).with(FruitingLeavesBlock.NATURAL, true).with(FruitingLeavesBlock.GROWTH, 1); + private static final BlockState ORANGE_LEAVES_FRUITING = ORANGE_WOODSTUFF.leaves().getDefaultState().with(FruitingLeavesBlock.CAPPED, true).with(FruitingLeavesBlock.NATURAL, true).with(FruitingLeavesBlock.GROWTH, 2); private static final TreeFeatureConfig ORANGE_TREE_WILD_CONFIG = generateTree( - BlockStateProvider.of(ORANGE_LOG), + BlockStateProvider.of(ORANGE_WOODSTUFF.log()), new WeightedBlockStateProvider( DataPool.builder() .add(ORANGE_LEAVES_BASIC, 2) @@ -196,7 +196,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl //Wisterias private static final TreeFeatureConfig ROSE_WISTERIA_CONFIG = generateTree( - WISTERIA_LOG.getDefaultState(), ROSE_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), + WISTERIA_WOODSTUFF.log().getDefaultState(), ROSE_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), new WisteriaTrunkPlacer( UniformIntProvider.create(3, 4), UniformIntProvider.create(3, 4), // branch count @@ -209,7 +209,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl true, false ); private static final TreeFeatureConfig LAVENDER_WISTERIA_CONFIG = generateTree( - WISTERIA_LOG.getDefaultState(), LAVENDER_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), + WISTERIA_WOODSTUFF.log().getDefaultState(), LAVENDER_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), new WisteriaTrunkPlacer( UniformIntProvider.create(3, 4), UniformIntProvider.create(3, 4), // branch count @@ -222,7 +222,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl true, false ); private static final TreeFeatureConfig FROST_WISTERIA_CONFIG = generateTree( - WISTERIA_LOG.getDefaultState(), FROST_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), + WISTERIA_WOODSTUFF.log().getDefaultState(), FROST_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), new WisteriaTrunkPlacer( UniformIntProvider.create(3, 4), UniformIntProvider.create(3, 4), // branch count @@ -235,7 +235,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl true, false ); private static final TreeFeatureConfig FANCY_ROSE_WISTERIA_CONFIG = generateTree( - WISTERIA_LOG.getDefaultState(), ROSE_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), + WISTERIA_WOODSTUFF.log().getDefaultState(), ROSE_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), new WisteriaTrunkPlacer( UniformIntProvider.create(3, 4), UniformIntProvider.create(3, 4), // branch count @@ -248,7 +248,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl true, false ); private static final TreeFeatureConfig FANCY_LAVENDER_WISTERIA_CONFIG = generateTree( - WISTERIA_LOG.getDefaultState(), LAVENDER_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), + WISTERIA_WOODSTUFF.log().getDefaultState(), LAVENDER_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), new WisteriaTrunkPlacer( UniformIntProvider.create(3, 4), UniformIntProvider.create(3, 4), // branch count @@ -261,7 +261,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl true, false ); private static final TreeFeatureConfig FANCY_FROST_WISTERIA_CONFIG = generateTree( - WISTERIA_LOG.getDefaultState(), FROST_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), + WISTERIA_WOODSTUFF.log().getDefaultState(), FROST_WISTERIA_LEAVES.getDefaultState(), DIRT.getDefaultState(), new WisteriaTrunkPlacer( UniformIntProvider.create(3, 4), UniformIntProvider.create(3, 4), // branch count @@ -276,7 +276,7 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl //Special trees private static final TreeFeatureConfig MOTHER_AUREL_CONFIG = generateTree( - MOTHER_AUREL_LOG.getDefaultState(), MOTHER_AUREL_LEAVES.getDefaultState(), DIRT.getDefaultState(), + MOTHER_AUREL_WOODSTUFF.log().getDefaultState(), MOTHER_AUREL_WOODSTUFF.leaves().getDefaultState(), DIRT.getDefaultState(), new LargeOakTrunkPlacer(8, 1, 1), new BlobFoliagePlacer(ConstantIntProvider.create(3), ConstantIntProvider.create(2), 3), new TwoLayersFeatureSize(3, 0, 3, OptionalInt.of(2)), @@ -308,70 +308,70 @@ private static RandomFeatureEntry entry(RegistryEntry AUREL_TREE = register("aurel_tree", ParadiseLostTreeConfiguredFeatures.AUREL_TREE, placed(AUREL_SAPLING)); - public static final RegistryEntry MOTHER_AUREL_TREE = register("mother_aurel_tree", ParadiseLostTreeConfiguredFeatures.MOTHER_AUREL_TREE, placed(MOTHER_AUREL_SAPLING)); - public static final RegistryEntry ORANGE_TREE = register("orange_tree", ParadiseLostTreeConfiguredFeatures.ORANGE_TREE, placed(ORANGE_SAPLING)); + public static final RegistryEntry AUREL_TREE = register("aurel_tree", ParadiseLostTreeConfiguredFeatures.AUREL_TREE, placed(AUREL_WOODSTUFF.sapling())); + public static final RegistryEntry MOTHER_AUREL_TREE = register("mother_aurel_tree", ParadiseLostTreeConfiguredFeatures.MOTHER_AUREL_TREE, placed(MOTHER_AUREL_WOODSTUFF.sapling())); + public static final RegistryEntry ORANGE_TREE = register("orange_tree", ParadiseLostTreeConfiguredFeatures.ORANGE_TREE, placed(ORANGE_WOODSTUFF.sapling())); // Wisteria public static final RegistryEntry ROSE_WISTERIA_TREE = register("rose_wisteria_tree", ParadiseLostTreeConfiguredFeatures.ROSE_WISTERIA_TREE, placed(ROSE_WISTERIA_SAPLING)); public static final RegistryEntry LAVENDER_WISTERIA_TREE = register("lavender_wisteria_tree", ParadiseLostTreeConfiguredFeatures.LAVENDER_WISTERIA_TREE, placed(LAVENDER_WISTERIA_SAPLING)); @@ -38,7 +38,7 @@ public class ParadiseLostTreePlacedFeatures extends ParadiseLostPlacedFeatures { public static final RegistryEntry FANCY_ROSE_WISTERIA_TREE = register("fancy_rose_wisteria_tree", ParadiseLostTreeConfiguredFeatures.FANCY_ROSE_WISTERIA_TREE, placed(ROSE_WISTERIA_SAPLING)); public static final RegistryEntry FANCY_LAVENDER_WISTERIA_TREE = register("fancy_lavender_wisteria_tree", ParadiseLostTreeConfiguredFeatures.FANCY_LAVENDER_WISTERIA_TREE, placed(LAVENDER_WISTERIA_SAPLING)); public static final RegistryEntry FANCY_FROST_WISTERIA_TREE = register("fancy_frost_wisteria_tree", ParadiseLostTreeConfiguredFeatures.FANCY_FROST_WISTERIA_TREE, placed(FROST_WISTERIA_SAPLING)); - public static final RegistryEntry FANCY_AUREL_TREE = register("fancy_aurel_tree", ParadiseLostTreeConfiguredFeatures.FANCY_AUREL_TREE, placed(AUREL_SAPLING)); + public static final RegistryEntry FANCY_AUREL_TREE = register("fancy_aurel_tree", ParadiseLostTreeConfiguredFeatures.FANCY_AUREL_TREE, placed(AUREL_WOODSTUFF.sapling())); // Tree Assortments public static final RegistryEntry SCATTERED_TREES = register("scattered_trees", ParadiseLostTreeConfiguredFeatures.SCATTERED_TREES, CountMultilayerPlacementModifier.of(6), CountPlacementModifier.of(UniformIntProvider.create(0, 6))); public static final RegistryEntry SHIELD_TREES = register("shield_trees", ParadiseLostTreeConfiguredFeatures.SHIELD_TREES, CountMultilayerPlacementModifier.of(5), CountPlacementModifier.of(UniformIntProvider.create(0, 6))); diff --git a/src/main/java/net/id/paradiselost/world/feature/structure/generator/AurelTowerGenerator.java b/src/main/java/net/id/paradiselost/world/feature/structure/generator/AurelTowerGenerator.java index cbed39680..d45ec5c8c 100644 --- a/src/main/java/net/id/paradiselost/world/feature/structure/generator/AurelTowerGenerator.java +++ b/src/main/java/net/id/paradiselost/world/feature/structure/generator/AurelTowerGenerator.java @@ -58,11 +58,11 @@ protected void handleMetadata(String metadata, BlockPos pos, ServerWorldAccess w @Override public void generate(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos pos) { // Fill in pillars - fillSupport(world, pos.down().north(2).east(2), ParadiseLostBlocks.AUREL_LOG.getDefaultState()); - fillSupport(world, pos.down().north(2).east(-2), ParadiseLostBlocks.AUREL_LOG.getDefaultState()); - fillSupport(world, pos.down().north(-2).east(2), ParadiseLostBlocks.AUREL_LOG.getDefaultState()); - fillSupport(world, pos.down().north(-2).east(-2), ParadiseLostBlocks.AUREL_LOG.getDefaultState()); - fillSupport(world, pos.down(), ParadiseLostBlocks.STRIPPED_AUREL_LOG.getDefaultState()); + fillSupport(world, pos.down().north(2).east(2), ParadiseLostBlocks.AUREL_WOODSTUFF.log().getDefaultState()); + fillSupport(world, pos.down().north(2).east(-2), ParadiseLostBlocks.AUREL_WOODSTUFF.log().getDefaultState()); + fillSupport(world, pos.down().north(-2).east(2), ParadiseLostBlocks.AUREL_WOODSTUFF.log().getDefaultState()); + fillSupport(world, pos.down().north(-2).east(-2), ParadiseLostBlocks.AUREL_WOODSTUFF.log().getDefaultState()); + fillSupport(world, pos.down(), ParadiseLostBlocks.AUREL_WOODSTUFF.strippedLog().getDefaultState()); // Add path blocks for (int x = -2; x <= 2; x++) { for (int z = -2; z <= 2; z++) { diff --git a/src/main/resources/paradise_lost.mixins.json b/src/main/resources/paradise_lost.mixins.json index 9d215eeb7..2b612a0d1 100644 --- a/src/main/resources/paradise_lost.mixins.json +++ b/src/main/resources/paradise_lost.mixins.json @@ -4,6 +4,7 @@ "package": "net.id.paradiselost.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ + "block.BlockEntityTypeMixin", "block.BlockMixin", "block.CropBlockMixin", "block.EnchantingTableBlockMixin", @@ -32,7 +33,7 @@ "world.ExplosionMixin", "util.DefaultedRegistryMixin", "util.NbtCompoundAccessor", - "util.RarityMixin", + "util.SignTypeAccessor", "util.SlotAccessor", "brain.MemoryModuleTypeInvoker", "brain.ActivityInvoker", @@ -47,7 +48,6 @@ "client.render.BackgroundRendererMixin", "client.render.CloudRendererMixin", "client.render.EntityModelsMixin", - "client.render.EntityRenderDispatcherMixin", "client.render.FluidRendererMixin", "client.render.InGameHudMixin", "client.render.InGameOverlayRendererMixin",