From 9476b5634ccc499397e6aa8a9247429b9eb69a48 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 25 Sep 2022 00:14:29 +0200 Subject: [PATCH] Added granny smith apple trees and more related log blocks for zap apple trees * Earth ponies can now kick zap and granny smith trees * Kicking these types of trees will dislodge their fruit rather than spawn apples --- .../ability/EarthPonyKickAbility.java | 22 ++- .../unicopia/block/FruitBearingBlock.java | 142 ++++++++++++++++++ .../unicopia/block/FruitBlock.java | 32 +++- .../unicopia/block/TintedBlock.java | 53 +++++++ .../minelittlepony/unicopia/block/Tree.java | 118 +++++++++++++++ .../unicopia/block/UBlocks.java | 56 +++++-- .../unicopia/block/UTreeGen.java | 55 ++++--- .../unicopia/block/ZapAppleLeavesBlock.java | 52 +++---- .../unicopia/block/ZapAppleLogBlock.java | 35 ++++- .../unicopia/block/ZapBlock.java | 86 +++++++++++ .../unicopia/client/URenderers.java | 23 ++- .../minelittlepony/unicopia/item/UItems.java | 9 +- .../unicopia/blockstates/green_apple.json | 7 + .../blockstates/green_apple_leaves.json | 7 + .../blockstates/green_apple_sapling.json | 7 + .../blockstates/stripped_zap_log.json | 16 ++ .../blockstates/stripped_zap_wood.json | 7 + .../assets/unicopia/blockstates/zap_wood.json | 7 + .../resources/assets/unicopia/lang/en_us.json | 9 +- .../unicopia/models/block/green_apple.json | 6 + .../models/block/green_apple_leaves.json | 6 + .../models/block/green_apple_sapling.json | 6 + .../models/block/stripped_zap_log.json | 7 + .../block/stripped_zap_log_horizontal.json | 7 + .../models/block/stripped_zap_wood.json | 6 + .../unicopia/models/block/zap_wood.json | 6 + .../models/item/green_apple_leaves.json | 3 + .../models/item/green_apple_sapling.json | 6 + .../models/item/stripped_zap_log.json | 3 + .../models/item/stripped_zap_wood.json | 3 + .../unicopia/models/item/zap_leaves.json | 3 + .../assets/unicopia/models/item/zap_log.json | 3 + .../assets/unicopia/models/item/zap_wood.json | 3 + .../textures/block/green_apple_leaves.png | Bin 0 -> 1466 bytes .../textures/block/stripped_zap_log.png | Bin 0 -> 2025 bytes .../textures/block/stripped_zap_log_top.png | Bin 0 -> 1699 bytes .../textures/item/green_apple_sapling.png | Bin 0 -> 1976 bytes .../data/minecraft/tags/blocks/leaves.json | 7 + .../data/minecraft/tags/blocks/logs.json | 9 ++ .../data/minecraft/tags/items/leaves.json | 7 + .../data/minecraft/tags/items/logs.json | 9 ++ .../loot_tables/blocks/green_apple.json | 20 +++ .../blocks/green_apple_leaves.json | 116 ++++++++++++++ .../blocks/green_apple_sapling.json | 20 +++ .../loot_tables/blocks/zap_leaves.json | 116 ++++++++++++++ .../unicopia/loot_tables/blocks/zap_log.json | 20 +++ .../unicopia/loot_tables/blocks/zap_wood.json | 20 +++ .../data/unicopia/tree_types/dark_oak.json | 4 +- .../data/unicopia/tree_types/green_apple.json | 6 + .../data/unicopia/tree_types/zap_apple.json | 6 + 50 files changed, 1078 insertions(+), 93 deletions(-) create mode 100644 src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java create mode 100644 src/main/java/com/minelittlepony/unicopia/block/TintedBlock.java create mode 100644 src/main/java/com/minelittlepony/unicopia/block/Tree.java create mode 100644 src/main/java/com/minelittlepony/unicopia/block/ZapBlock.java create mode 100644 src/main/resources/assets/unicopia/blockstates/green_apple.json create mode 100644 src/main/resources/assets/unicopia/blockstates/green_apple_leaves.json create mode 100644 src/main/resources/assets/unicopia/blockstates/green_apple_sapling.json create mode 100644 src/main/resources/assets/unicopia/blockstates/stripped_zap_log.json create mode 100644 src/main/resources/assets/unicopia/blockstates/stripped_zap_wood.json create mode 100644 src/main/resources/assets/unicopia/blockstates/zap_wood.json create mode 100644 src/main/resources/assets/unicopia/models/block/green_apple.json create mode 100644 src/main/resources/assets/unicopia/models/block/green_apple_leaves.json create mode 100644 src/main/resources/assets/unicopia/models/block/green_apple_sapling.json create mode 100644 src/main/resources/assets/unicopia/models/block/stripped_zap_log.json create mode 100644 src/main/resources/assets/unicopia/models/block/stripped_zap_log_horizontal.json create mode 100644 src/main/resources/assets/unicopia/models/block/stripped_zap_wood.json create mode 100644 src/main/resources/assets/unicopia/models/block/zap_wood.json create mode 100644 src/main/resources/assets/unicopia/models/item/green_apple_leaves.json create mode 100644 src/main/resources/assets/unicopia/models/item/green_apple_sapling.json create mode 100644 src/main/resources/assets/unicopia/models/item/stripped_zap_log.json create mode 100644 src/main/resources/assets/unicopia/models/item/stripped_zap_wood.json create mode 100644 src/main/resources/assets/unicopia/models/item/zap_leaves.json create mode 100644 src/main/resources/assets/unicopia/models/item/zap_log.json create mode 100644 src/main/resources/assets/unicopia/models/item/zap_wood.json create mode 100644 src/main/resources/assets/unicopia/textures/block/green_apple_leaves.png create mode 100644 src/main/resources/assets/unicopia/textures/block/stripped_zap_log.png create mode 100644 src/main/resources/assets/unicopia/textures/block/stripped_zap_log_top.png create mode 100644 src/main/resources/assets/unicopia/textures/item/green_apple_sapling.png create mode 100644 src/main/resources/data/minecraft/tags/blocks/leaves.json create mode 100644 src/main/resources/data/minecraft/tags/blocks/logs.json create mode 100644 src/main/resources/data/minecraft/tags/items/leaves.json create mode 100644 src/main/resources/data/minecraft/tags/items/logs.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/green_apple.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/green_apple_leaves.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/green_apple_sapling.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/zap_leaves.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/zap_log.json create mode 100644 src/main/resources/data/unicopia/loot_tables/blocks/zap_wood.json create mode 100644 src/main/resources/data/unicopia/tree_types/green_apple.json create mode 100644 src/main/resources/data/unicopia/tree_types/zap_apple.json diff --git a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyKickAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyKickAbility.java index c831eae5..8254d64c 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyKickAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/EarthPonyKickAbility.java @@ -29,6 +29,7 @@ import net.minecraft.entity.passive.BeeEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.predicate.entity.EntityPredicates; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; @@ -200,7 +201,9 @@ public class EarthPonyKickAbility implements Ability { }, (world, state, position, recurse) -> { affectBlockChange(player, position); - if (world.getBlockState(position.down()).isAir()) { + BlockState below = world.getBlockState(position.down()); + + if (below.isAir()) { ItemStack stack = tree.pickRandomStack(state); if (!stack.isEmpty()) { world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, position, Block.getRawIdFromState(state)); @@ -212,6 +215,19 @@ public class EarthPonyKickAbility implements Ability { stack )); } + } else if (below.getBlock() instanceof Buckable buckable) { + List stacks = buckable.onBucked((ServerWorld)world, state, pos); + if (!stacks.isEmpty()) { + world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, position, Block.getRawIdFromState(state)); + stacks.forEach(stack -> { + capturedDrops.add(new ItemEntity(world, + position.getX() + world.random.nextFloat(), + position.getY() - 0.5, + position.getZ() + world.random.nextFloat(), + stack + )); + }); + } } }); @@ -254,4 +270,8 @@ public class EarthPonyKickAbility implements Ability { } }, PosHelper.HORIZONTAL); } + + public interface Buckable { + List onBucked(ServerWorld world, BlockState state, BlockPos pos); + } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java b/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java new file mode 100644 index 00000000..8a9d6135 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/FruitBearingBlock.java @@ -0,0 +1,142 @@ +package com.minelittlepony.unicopia.block; + +import java.util.*; +import java.util.function.Supplier; + +import org.jetbrains.annotations.Nullable; + +import com.minelittlepony.unicopia.USounds; + +import net.minecraft.block.*; +import net.minecraft.item.ItemStack; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.sound.SoundCategory; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.*; +import net.minecraft.state.property.Properties; +import net.minecraft.util.StringIdentifiable; +import net.minecraft.util.math.*; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.*; +import net.minecraft.world.event.GameEvent; + +public class FruitBearingBlock extends LeavesBlock implements TintedBlock { + public static final IntProperty AGE = Properties.AGE_25; + public static final int WITHER_AGE = 15; + public static final EnumProperty STAGE = EnumProperty.of("stage", Stage.class); + + public static final List REGISTRY = new ArrayList<>(); + + private final Supplier fruit; + private final Supplier rottenFruitSupplier; + + private final int overlay; + + public FruitBearingBlock(Settings settings, int overlay, Supplier fruit, Supplier rottenFruitSupplier) { + super(settings + .ticksRandomly() + .nonOpaque() + .allowsSpawning(UBlocks::canSpawnOnLeaves) + .suffocates(UBlocks::never) + .blockVision(UBlocks::never)); + setDefaultState(getDefaultState().with(STAGE, Stage.IDLE)); + this.overlay = overlay; + this.fruit = fruit; + this.rottenFruitSupplier = rottenFruitSupplier; + REGISTRY.add(this); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(STAGE).add(AGE); + } + + @Override + public boolean hasRandomTicks(BlockState state) { + return true; + } + + @Override + public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + super.randomTick(state, world, pos, random); + + if (shouldDecay(state)) { + return; + } + + if (world.isDay()) { + BlockSoundGroup group = getSoundGroup(state); + + if (state.get(STAGE) == Stage.FRUITING) { + state = state.cycle(AGE); + if (state.get(AGE) > 20) { + state = state.with(AGE, 0).cycle(STAGE); + } + } else { + state = state.with(AGE, 0).cycle(STAGE); + } + world.setBlockState(pos, state, Block.NOTIFY_ALL); + BlockPos fruitPosition = pos.down(); + + Stage stage = state.get(STAGE); + + if (stage == Stage.FRUITING && isPositionValidForFruit(state, pos)) { + if (world.isAir(fruitPosition)) { + world.setBlockState(fruitPosition, fruit.get().getDefaultState(), Block.NOTIFY_ALL); + } + } + + BlockState fruitState = world.getBlockState(fruitPosition); + + if (stage == Stage.WITHERING && fruitState.isOf(fruit.get())) { + if (world.random.nextInt(2) == 0) { + Block.dropStack(world, fruitPosition, rottenFruitSupplier.get()); + } else { + Block.dropStacks(fruitState, world, fruitPosition, fruitState.hasBlockEntity() ? world.getBlockEntity(fruitPosition) : null, null, ItemStack.EMPTY); + } + + if (world.removeBlock(fruitPosition, false)) { + world.emitGameEvent(GameEvent.BLOCK_DESTROY, pos, GameEvent.Emitter.of(fruitState)); + } + + world.playSound(null, pos, USounds.ITEM_APPLE_ROT, SoundCategory.BLOCKS, group.getVolume(), group.getPitch()); + } + } + } + + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + BlockState newState = super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); + + return newState; + } + + @Override + public int getTint(BlockState state, @Nullable BlockRenderView world, @Nullable BlockPos pos, int foliageColor) { + return TintedBlock.blend(foliageColor, overlay); + } + + private boolean isPositionValidForFruit(BlockState state, BlockPos pos) { + return state.getRenderingSeed(pos) % 3 == 1; + } + + public enum Stage implements StringIdentifiable { + IDLE, + FLOWERING, + FRUITING, + WITHERING; + + private static final Stage[] VALUES = values(); + + public Stage getNext() { + return VALUES[(ordinal() + 1) % VALUES.length]; + } + + @Override + public String asString() { + return name().toLowerCase(Locale.ROOT); + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/FruitBlock.java b/src/main/java/com/minelittlepony/unicopia/block/FruitBlock.java index 65b4fdba..f5a75aeb 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/FruitBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/FruitBlock.java @@ -1,19 +1,26 @@ package com.minelittlepony.unicopia.block; +import java.util.ArrayList; +import java.util.List; + +import com.minelittlepony.unicopia.ability.EarthPonyKickAbility.Buckable; + import net.minecraft.block.*; +import net.minecraft.item.ItemStack; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.BlockView; -import net.minecraft.world.WorldView; +import net.minecraft.world.*; -public class FruitBlock extends Block { +public class FruitBlock extends Block implements Buckable { public static final int DEFAULT_FRUIT_SIZE = 8; public static final VoxelShape DEFAULT_SHAPE = createFruitShape(DEFAULT_FRUIT_SIZE); + public static final List REGISTRY = new ArrayList<>(); + private final Direction attachmentFace; private final Block stem; private final VoxelShape shape; @@ -30,6 +37,7 @@ public class FruitBlock extends Block { this.attachmentFace = attachmentFace; this.stem = stem; this.shape = shape; + REGISTRY.add(this); } @Override @@ -41,7 +49,16 @@ public class FruitBlock extends Block { public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { BlockPos attachedPos = pos.offset(attachmentFace.getOpposite()); BlockState attachedState = world.getBlockState(attachedPos); - return canAttachTo(attachedState) && attachedState.isSideSolidFullSquare(world, attachedPos, attachmentFace); + return canAttachTo(attachedState); + } + + @Deprecated + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + if (!state.canPlaceAt(world, pos)) { + return Blocks.AIR.getDefaultState(); + } + return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); } @Override @@ -54,4 +71,11 @@ public class FruitBlock extends Block { protected boolean canAttachTo(BlockState state) { return state.isOf(stem); } + + @Override + public List onBucked(ServerWorld world, BlockState state, BlockPos pos) { + List stacks = Block.getDroppedStacks(state, world, pos, null); + world.breakBlock(pos, false); + return stacks; + } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/TintedBlock.java b/src/main/java/com/minelittlepony/unicopia/block/TintedBlock.java new file mode 100644 index 00000000..e46e43b2 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/TintedBlock.java @@ -0,0 +1,53 @@ +package com.minelittlepony.unicopia.block; + +import java.util.ArrayList; +import java.util.List; + +import org.jetbrains.annotations.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.BlockRenderView; + +public interface TintedBlock { + List REGISTRY = new ArrayList<>(); + + int MAX_BIT_SHIFT = 8 * 3; + int WHITE = 0xFFFFFF; + + int getTint(BlockState state, @Nullable BlockRenderView world, @Nullable BlockPos pos, int foliageColor); + + /** + * Rotates a color's components by a given number of bytes. + */ + static int rotate(int color, int bitShift) { + bitShift = MathHelper.clamp(bitShift, -MAX_BIT_SHIFT, MAX_BIT_SHIFT); + return WHITE & ( + (color << bitShift) + | ((color >> (MAX_BIT_SHIFT - bitShift)) & ~(WHITE << bitShift)) + ); + } + + /** + * Blends two colors together using the overlay color's opacity value + */ + static int blend(int color, int overlay) { + return blend(color, overlay & WHITE, ((overlay >> MAX_BIT_SHIFT) & 0xFF) / 255F); + } + + /** + * Blends two colors an alpha ratio to determine the opacity of the overlay. + */ + static int blend(int color, int overlay, float blend) { + return blendComponent(color & 0xFF, overlay & 0xFF, blend) + | (blendComponent((color >> 8) & 0xFF, (overlay >> 8) & 0xFF, blend) << 8) + | (blendComponent((color >> 16) & 0xFF, (overlay >> 16) & 0xFF, blend) << 16); + + } + + private static int blendComponent(int color, int overlay, float blend) { + return (int)((color * (1F - blend)) + (overlay * blend)); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/Tree.java b/src/main/java/com/minelittlepony/unicopia/block/Tree.java new file mode 100644 index 00000000..e0cca8d8 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/Tree.java @@ -0,0 +1,118 @@ +package com.minelittlepony.unicopia.block; + +import java.util.*; +import java.util.function.Predicate; +import java.util.function.Supplier; + +import net.fabricmc.fabric.api.biome.v1.*; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.block.*; +import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.item.*; +import net.minecraft.tag.BiomeTags; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.random.Random; +import net.minecraft.util.registry.*; +import net.minecraft.world.gen.GenerationStep; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; +import net.minecraft.world.gen.foliage.FoliagePlacer; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; +import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.trunk.TrunkPlacer; + +public record Tree ( + RegistryEntry> configuredFeature, + Optional> placedFeature, + Optional sapling + ) { + public static final List REGISTRY = new ArrayList<>(); + + public static class Builder { + public static final Predicate IS_FOREST = BiomeSelectors.foundInOverworld().and(BiomeSelectors.tag(BiomeTags.IS_FOREST)); + + public static Builder create(Identifier id, TrunkPlacer trunkPlacer, FoliagePlacer foliagePlacer) { + return new Builder(id, trunkPlacer, foliagePlacer); + } + + private Block logType = Blocks.OAK_LOG; + private Block leavesType = Blocks.OAK_LEAVES; + private Optional saplingId = Optional.empty(); + + private final TrunkPlacer trunkPlacer; + private final FoliagePlacer foliagePlacer; + + private final Identifier id; + + private Optional> selector = Optional.empty(); + private Optional countModifier = Optional.empty(); + private Optional> configSupplier = Optional.empty(); + + private Builder(Identifier id, TrunkPlacer trunkPlacer, FoliagePlacer foliagePlacer) { + this.id = id; + this.trunkPlacer = trunkPlacer; + this.foliagePlacer = foliagePlacer; + } + + public Builder log(Block log) { + this.logType = log; + return this; + } + + public Builder leaves(Block leaves) { + this.leavesType = leaves; + return this; + } + + public Builder sapling(Identifier saplingId) { + this.saplingId = Optional.of(saplingId); + return this; + } + + public Builder count(int count, float extraChance, int extraCount) { + countModifier = Optional.of(PlacedFeatures.createCountExtraModifier(count, extraChance, extraCount)); + return this; + } + + public Builder biomes(Predicate selector) { + this.selector = Optional.of(selector); + return this; + } + + public Builder shape(Supplier shape) { + this.configSupplier = Optional.of(shape); + return this; + } + + public Tree build() { + RegistryEntry> configuredFeature = ConfiguredFeatures.register(id.toString(), Feature.TREE, configSupplier.map(Supplier::get) + .orElseGet(() -> new TreeFeatureConfig.Builder( + BlockStateProvider.of(logType), + trunkPlacer, + BlockStateProvider.of(leavesType), + foliagePlacer, + new TwoLayersFeatureSize(6, 0, 16) + ).forceDirt()).build()); + + Optional sapling = saplingId.map(id -> UBlocks.register(id, new SaplingBlock(new SaplingGenerator() { + @Override + protected RegistryEntry> getTreeFeature(Random rng, boolean flowersNearby) { + return configuredFeature; + } + }, FabricBlockSettings.copy(Blocks.OAK_SAPLING)), ItemGroup.DECORATIONS)); + + Optional> placedFeature = selector.map(selector -> { + var pf = PlacedFeatures.register(id.toString() + "_checked", configuredFeature, + VegetationPlacedFeatures.modifiersWithWouldSurvive(countModifier.orElseThrow(), sapling.orElse(Blocks.OAK_SAPLING)) + ); + BiomeModifications.addFeature(selector, GenerationStep.Feature.VEGETAL_DECORATION, pf.getKey().get()); + return pf; + }); + + Tree tree = new Tree(configuredFeature, placedFeature, sapling); + + REGISTRY.add(tree); + return tree; + } + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index 53b3987e..6e75221c 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -1,20 +1,21 @@ package com.minelittlepony.unicopia.block; import com.minelittlepony.unicopia.Unicopia; +import com.minelittlepony.unicopia.item.UItems; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricMaterialBuilder; +import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; +import net.fabricmc.fabric.api.registry.StrippableBlockRegistry; import net.minecraft.block.*; -import net.minecraft.block.sapling.SaplingGenerator; import net.minecraft.entity.EntityType; +import net.minecraft.item.*; import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.minecraft.util.math.random.Random; import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.BlockView; -import net.minecraft.world.gen.feature.ConfiguredFeature; public interface UBlocks { Block ROCKS = register("rocks", new RockCropBlock(FabricBlockSettings.of( @@ -27,24 +28,49 @@ public interface UBlocks { Block FROSTED_OBSIDIAN = register("frosted_obsidian", new FrostedObsidianBlock(FabricBlockSettings.copy(Blocks.OBSIDIAN).ticksRandomly())); - Block ZAPLING = register("zapling", new SaplingBlock(new SaplingGenerator() { - @Override - protected RegistryEntry> getTreeFeature(Random rng, boolean flowersNearby) { - return UTreeGen.ZAP_APPLE_TREE; - } - }, FabricBlockSettings.copy(Blocks.OAK_SAPLING))); + Block ZAP_LOG = register("zap_log", new ZapAppleLogBlock(Blocks.OAK_LOG, MapColor.GRAY, MapColor.DEEPSLATE_GRAY), ItemGroup.MATERIALS); + Block ZAP_WOOD = register("zap_wood", new ZapBlock(AbstractBlock.Settings.of(Material.WOOD, MapColor.DEEPSLATE_GRAY).sounds(BlockSoundGroup.WOOD), Blocks.OAK_WOOD), ItemGroup.MATERIALS); - Block ZAP_LOG = register("zap_log", new ZapAppleLogBlock(MapColor.GRAY, MapColor.DEEPSLATE_GRAY)); - Block ZAP_LEAVES = register("zap_leaves", new ZapAppleLeavesBlock()); + Block STRIPPED_ZAP_LOG = register("stripped_zap_log", new ZapAppleLogBlock(Blocks.STRIPPED_OAK_LOG, MapColor.LIGHT_GRAY, MapColor.GRAY), ItemGroup.MATERIALS); + Block STRIPPED_ZAP_WOOD = register("stripped_zap_wood", new ZapBlock(AbstractBlock.Settings.of(Material.WOOD, MapColor.DEEPSLATE_GRAY).sounds(BlockSoundGroup.WOOD), Blocks.STRIPPED_OAK_WOOD), ItemGroup.MATERIALS); + + Block ZAP_LEAVES = register("zap_leaves", new ZapAppleLeavesBlock(), ItemGroup.DECORATIONS); Block ZAP_BULB = register("zap_bulb", new FruitBlock(FabricBlockSettings.of(Material.GOURD, MapColor.GRAY).strength(500, 1200).sounds(BlockSoundGroup.AZALEA_LEAVES), Direction.DOWN, ZAP_LEAVES, FruitBlock.DEFAULT_SHAPE)); Block ZAP_APPLE = register("zap_apple", new FruitBlock(FabricBlockSettings.of(Material.GOURD, MapColor.GRAY).sounds(BlockSoundGroup.AZALEA_LEAVES), Direction.DOWN, ZAP_LEAVES, FruitBlock.DEFAULT_SHAPE)); - private static T register(String name, T item) { - return Registry.register(Registry.BLOCK, Unicopia.id(name), item); + Block GREEN_APPLE_LEAVES = register("green_apple_leaves", new FruitBearingBlock(FabricBlockSettings.copy(Blocks.OAK_LEAVES), + 0xE5FFFF88, + () -> UBlocks.GREEN_APPLE, + () -> UItems.GREEN_APPLE.getDefaultStack() + ), ItemGroup.DECORATIONS); + Block GREEN_APPLE = register("green_apple", new FruitBlock(FabricBlockSettings.of(Material.GOURD, MapColor.GREEN).sounds(BlockSoundGroup.WOOD), Direction.DOWN, GREEN_APPLE_LEAVES, FruitBlock.DEFAULT_SHAPE)); + + static T register(String name, T item) { + return register(Unicopia.id(name), item); } - static void bootstrap() {} + static T register(String name, T block, ItemGroup group) { + return register(Unicopia.id(name), block, group); + } + static T register(Identifier id, T block, ItemGroup group) { + UItems.register(id, new BlockItem(block, new Item.Settings().group(group))); + return register(id, block); + } + + static T register(Identifier id, T block) { + if (block instanceof TintedBlock) { + TintedBlock.REGISTRY.add(block); + } + return Registry.register(Registry.BLOCK, id, block); + } + + static void bootstrap() { + StrippableBlockRegistry.register(ZAP_LOG, STRIPPED_ZAP_LOG); + StrippableBlockRegistry.register(ZAP_WOOD, STRIPPED_ZAP_WOOD); + FlammableBlockRegistry.getDefaultInstance().add(GREEN_APPLE_LEAVES, 30, 60); + FlammableBlockRegistry.getDefaultInstance().add(GREEN_APPLE, 20, 50); + } static boolean never(BlockState state, BlockView world, BlockPos pos) { return false; diff --git a/src/main/java/com/minelittlepony/unicopia/block/UTreeGen.java b/src/main/java/com/minelittlepony/unicopia/block/UTreeGen.java index 13b021a9..18ae4002 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UTreeGen.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UTreeGen.java @@ -1,41 +1,48 @@ package com.minelittlepony.unicopia.block; -import net.fabricmc.fabric.api.biome.v1.*; -import net.minecraft.tag.BiomeTags; +import com.minelittlepony.unicopia.Unicopia; + +import net.minecraft.block.*; import net.minecraft.tag.BlockTags; import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.math.intprovider.UniformIntProvider; -import net.minecraft.util.registry.*; -import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.feature.*; -import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; +import net.minecraft.util.registry.Registry; +import net.minecraft.world.gen.foliage.BlobFoliagePlacer; import net.minecraft.world.gen.foliage.JungleFoliagePlacer; -import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.trunk.StraightTrunkPlacer; import net.minecraft.world.gen.trunk.UpwardsBranchingTrunkPlacer; public interface UTreeGen { - RegistryEntry> ZAP_APPLE_TREE = ConfiguredFeatures.register("unicopia:zap_apple_tree", Feature.TREE, new TreeFeatureConfig.Builder( - BlockStateProvider.of(UBlocks.ZAP_LOG), - new UpwardsBranchingTrunkPlacer(7, 2, 3, - UniformIntProvider.create(3, 6), 0.3f, + Tree ZAP_APPLE_TREE = Tree.Builder.create(Unicopia.id("zap_apple_tree"), new UpwardsBranchingTrunkPlacer( + 7, 2, 3, + UniformIntProvider.create(3, 6), + 0.3f, UniformIntProvider.create(1, 3), Registry.BLOCK.getOrCreateEntryList(BlockTags.MANGROVE_LOGS_CAN_GROW_THROUGH) - ), - BlockStateProvider.of(UBlocks.ZAP_LEAVES), - new JungleFoliagePlacer( + ), new JungleFoliagePlacer( ConstantIntProvider.create(3), ConstantIntProvider.create(2), 3 - ), - new TwoLayersFeatureSize(6, 0, 16) - ).forceDirt() - .build() - ); - RegistryEntry TREES_ZAP = PlacedFeatures.register("unicopia:trees_zap", ZAP_APPLE_TREE, - VegetationPlacedFeatures.modifiersWithWouldSurvive(PlacedFeatures.createCountExtraModifier(0, 0.01F, 1), UBlocks.ZAPLING) - ); + ) + ) + .log(UBlocks.ZAP_LOG) + .leaves(UBlocks.ZAP_LEAVES) + .sapling(Unicopia.id("zapling")) + .biomes(Tree.Builder.IS_FOREST) + .count(0, 0.01F, 1) + .build(); + Tree GREEN_APPLE_TREE = createAppleTree("green_apple", UBlocks.GREEN_APPLE_LEAVES); - static void bootstrap() { - BiomeModifications.addFeature(BiomeSelectors.foundInOverworld().and(BiomeSelectors.tag(BiomeTags.IS_FOREST)), GenerationStep.Feature.VEGETAL_DECORATION, TREES_ZAP.getKey().get()); + static Tree createAppleTree(String name, Block leaves) { + return Tree.Builder.create(Unicopia.id(name + "_tree"), + new StraightTrunkPlacer(4, 6, 2), + new BlobFoliagePlacer(ConstantIntProvider.create(3), ConstantIntProvider.create(0), 3) + ) + .log(Blocks.OAK_LOG) + .leaves(leaves) + .sapling(Unicopia.id(name + "_sapling")) + .build(); } + + static void bootstrap() { } } diff --git a/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java index df76bcf0..ee5cc025 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLeavesBlock.java @@ -1,29 +1,24 @@ package com.minelittlepony.unicopia.block; +import org.jetbrains.annotations.Nullable; + import com.minelittlepony.unicopia.block.data.ZapAppleStageStore; import com.minelittlepony.unicopia.entity.player.Pony; -import com.minelittlepony.unicopia.particle.ParticleUtils; -import com.minelittlepony.unicopia.particle.UParticles; - import net.minecraft.block.*; -import net.minecraft.entity.*; -import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemPlacementContext; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.state.StateManager; -import net.minecraft.state.property.EnumProperty; +import net.minecraft.state.property.*; import net.minecraft.util.math.*; import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.BlockView; -import net.minecraft.world.World; -import net.minecraft.world.event.GameEvent; +import net.minecraft.world.*; -public class ZapAppleLeavesBlock extends LeavesBlock { +public class ZapAppleLeavesBlock extends LeavesBlock implements TintedBlock { public static final EnumProperty STAGE = EnumProperty.of("stage", ZapAppleStageStore.Stage.class); ZapAppleLeavesBlock() { @@ -118,7 +113,7 @@ public class ZapAppleLeavesBlock extends LeavesBlock { @Override public void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) { - triggerLightning(state, world, pos, player); + ZapBlock.triggerLightning(state, world, pos, player); } @Deprecated @@ -149,9 +144,23 @@ public class ZapAppleLeavesBlock extends LeavesBlock { return state.get(STAGE) == ZapAppleStageStore.Stage.HIBERNATING; } + @Override + public int getTint(BlockState state, @Nullable BlockRenderView world, @Nullable BlockPos pos, int foliageColor) { + + if (pos == null) { + return 0x4C7EFA; + } + + return TintedBlock.blend(TintedBlock.rotate(foliageColor, 2), 0x0000FF, 0.3F); + } + @Deprecated @Override public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) { + if (state.get(PERSISTENT)) { + return Blocks.OAK_LEAVES.calcBlockBreakingDelta(Blocks.OAK_LEAVES.getDefaultState(), player, world, pos); + } + float delta = super.calcBlockBreakingDelta(state, player, world, pos); if (Pony.of(player).getSpecies().canUseEarth()) { @@ -164,25 +173,4 @@ public class ZapAppleLeavesBlock extends LeavesBlock { return MathHelper.clamp(delta, 0, 0.9F); } - - public static void triggerLightning(BlockState state, World world, BlockPos pos, PlayerEntity player) { - if (world instanceof ServerWorld serverWorld) { - Vec3d center = Vec3d.ofCenter(pos); - LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(world); - world.getOtherEntities(null, Box.from(center).expand(7)).forEach(other -> { - float dist = (float)other.getPos().distanceTo(center); - if (dist < 4) { - other.onStruckByLightning(serverWorld, lightning); - } else { - float damage = 3 / dist; - if (damage > 1) { - other.damage(DamageSource.LIGHTNING_BOLT, damage); - } - } - }); - } - world.emitGameEvent(GameEvent.LIGHTNING_STRIKE, pos, GameEvent.Emitter.of(state)); - ParticleUtils.spawnParticle(world, UParticles.LIGHTNING_BOLT, Vec3d.ofCenter(pos), Vec3d.ZERO); - } - } diff --git a/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLogBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLogBlock.java index 25f16e79..6fe481ad 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLogBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/ZapAppleLogBlock.java @@ -4,25 +4,54 @@ import com.minelittlepony.unicopia.entity.player.Pony; import net.minecraft.block.*; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemPlacementContext; import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Properties; import net.minecraft.util.math.*; import net.minecraft.world.BlockView; import net.minecraft.world.World; public class ZapAppleLogBlock extends PillarBlock { - ZapAppleLogBlock(MapColor topMapColor, MapColor sideMapColor) { - super(AbstractBlock.Settings.of(Material.WOOD, state -> state.get(PillarBlock.AXIS) == Direction.Axis.Y ? topMapColor : sideMapColor).strength(2.0f).sounds(BlockSoundGroup.WOOD).strength(500, 1200)); + public static final BooleanProperty NATURAL = Properties.PERSISTENT; + + private final Block artifialModelBlock; + + ZapAppleLogBlock(Block artifialModelBlock, MapColor topMapColor, MapColor sideMapColor) { + super(AbstractBlock.Settings.of(Material.WOOD, + state -> state.get(PillarBlock.AXIS) == Direction.Axis.Y ? topMapColor : sideMapColor + ) + .sounds(BlockSoundGroup.WOOD) + .strength(500, 1200)); + setDefaultState(getDefaultState().with(NATURAL, true)); + this.artifialModelBlock = artifialModelBlock; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(NATURAL); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return getDefaultState().with(NATURAL, false); } @Deprecated @Override public void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) { - ZapAppleLeavesBlock.triggerLightning(state, world, pos, player); + ZapBlock.triggerLightning(state, world, pos, player); } @Deprecated @Override public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) { + if (!state.get(NATURAL)) { + return artifialModelBlock.calcBlockBreakingDelta(artifialModelBlock.getDefaultState(), player, world, pos); + } + float delta = super.calcBlockBreakingDelta(state, player, world, pos); if (Pony.of(player).getSpecies().canUseEarth()) { diff --git a/src/main/java/com/minelittlepony/unicopia/block/ZapBlock.java b/src/main/java/com/minelittlepony/unicopia/block/ZapBlock.java new file mode 100644 index 00000000..39accea8 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/ZapBlock.java @@ -0,0 +1,86 @@ +package com.minelittlepony.unicopia.block; + +import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.particle.ParticleUtils; +import com.minelittlepony.unicopia.particle.UParticles; + +import net.minecraft.block.*; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LightningEntity; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.util.math.*; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import net.minecraft.world.event.GameEvent; + +public class ZapBlock extends Block { + public static final BooleanProperty NATURAL = Properties.PERSISTENT; + + private final Block artificialModelBlock; + + ZapBlock(Settings settings, Block artificialModelBlock) { + super(settings.strength(500, 1200)); + setDefaultState(getDefaultState().with(NATURAL, true)); + this.artificialModelBlock = artificialModelBlock; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(NATURAL); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return getDefaultState().with(NATURAL, false); + } + + @Deprecated + @Override + public void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) { + triggerLightning(state, world, pos, player); + } + + @Deprecated + @Override + public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) { + if (!state.get(NATURAL)) { + return artificialModelBlock.calcBlockBreakingDelta(artificialModelBlock.getDefaultState(), player, world, pos); + } + + float delta = super.calcBlockBreakingDelta(state, player, world, pos); + + if (Pony.of(player).getSpecies().canUseEarth()) { + delta *= 50; + } + + return MathHelper.clamp(delta, 0, 0.9F); + } + + + public static void triggerLightning(BlockState state, World world, BlockPos pos, PlayerEntity player) { + if (world instanceof ServerWorld serverWorld) { + Vec3d center = Vec3d.ofCenter(pos); + LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(world); + world.getOtherEntities(null, Box.from(center).expand(7)).forEach(other -> { + float dist = (float)other.getPos().distanceTo(center); + if (dist < 4) { + other.onStruckByLightning(serverWorld, lightning); + } else { + float damage = 3 / dist; + if (damage > 1) { + other.damage(DamageSource.LIGHTNING_BOLT, damage); + } + } + }); + } + world.emitGameEvent(GameEvent.LIGHTNING_STRIKE, pos, GameEvent.Emitter.of(state)); + ParticleUtils.spawnParticle(world, UParticles.LIGHTNING_BOLT, Vec3d.ofCenter(pos), Vec3d.ZERO); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/client/URenderers.java b/src/main/java/com/minelittlepony/unicopia/client/URenderers.java index 78cb633a..2c0b4784 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/URenderers.java +++ b/src/main/java/com/minelittlepony/unicopia/client/URenderers.java @@ -1,6 +1,6 @@ package com.minelittlepony.unicopia.client; -import com.minelittlepony.unicopia.block.UBlocks; +import com.minelittlepony.unicopia.block.*; import com.minelittlepony.unicopia.client.particle.ChangelingMagicParticle; import com.minelittlepony.unicopia.client.particle.CloudsEscapingParticle; import com.minelittlepony.unicopia.client.particle.DiskParticle; @@ -27,7 +27,9 @@ import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry.Pendin import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; +import net.minecraft.block.Block; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.color.block.BlockColorProvider; import net.minecraft.client.color.world.BiomeColors; import net.minecraft.client.color.world.FoliageColors; import net.minecraft.client.item.ModelPredicateProviderRegistry; @@ -41,7 +43,7 @@ import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.world.ClientWorld; import net.minecraft.fluid.Fluids; -import net.minecraft.item.DyeableItem; +import net.minecraft.item.*; import net.minecraft.particle.ParticleEffect; import net.minecraft.util.Identifier; @@ -120,20 +122,27 @@ public interface URenderers { ColorProviderRegistry.ITEM.register((stack, i) -> { return i > 0 || !GemstoneItem.isEnchanted(stack) ? -1 : GemstoneItem.getSpellKey(stack).getColor(); }, UItems.GEMSTONE); - ColorProviderRegistry.BLOCK.register((state, view, pos, color) -> { + + BlockColorProvider tintedProvider = (state, view, pos, color) -> { if (view == null || pos == null) { color = FoliageColors.getDefaultColor(); } else { color = BiomeColors.getFoliageColor(view, pos); } - return (color << 2) | ((color >> 4) & 0xFF); - }, UBlocks.ZAP_LEAVES); + return ((TintedBlock)state.getBlock()).getTint(state, view, pos, color); + }; + ColorProviderRegistry.BLOCK.register(tintedProvider, TintedBlock.REGISTRY.stream().toArray(Block[]::new)); + ColorProviderRegistry.ITEM.register((stack, i) -> { + Block block = Block.getBlockFromItem(stack.getItem()); + return block instanceof TintedBlock ? tintedProvider.getColor(block.getDefaultState(), null, null, i) : FoliageColors.getDefaultColor(); + }, TintedBlock.REGISTRY.stream().map(Block::asItem).filter(i -> i != Items.AIR).toArray(Item[]::new)); + + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayers.getTranslucent(), FruitBlock.REGISTRY.stream().toArray(FruitBlock[]::new)); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayers.getTranslucent(), Tree.REGISTRY.stream().flatMap(tree -> tree.sapling().stream()).toArray(Block[]::new)); // for lava boats BlockRenderLayerMap.INSTANCE.putFluids(RenderLayers.getTranslucent(), Fluids.LAVA, Fluids.FLOWING_LAVA); - - BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayers.getTranslucent(), UBlocks.ZAP_BULB, UBlocks.ZAP_APPLE, UBlocks.ZAPLING); } static PendingParticleFactory createFactory(ParticleSupplier supplier) { diff --git a/src/main/java/com/minelittlepony/unicopia/item/UItems.java b/src/main/java/com/minelittlepony/unicopia/item/UItems.java index ab2b18f8..81ca8677 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/item/UItems.java @@ -16,6 +16,7 @@ import net.minecraft.item.Item.Settings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.registry.FuelRegistry; import net.minecraft.sound.SoundEvent; +import net.minecraft.util.Identifier; import net.minecraft.util.Rarity; import net.minecraft.util.registry.Registry; @@ -100,8 +101,6 @@ public interface UItems { Item SPELLBOOK = register("spellbook", new SpellbookItem(new Item.Settings().maxCount(1).rarity(Rarity.UNCOMMON).group(ItemGroup.TOOLS))); - Item ZAPLING = register("zapling", new BlockItem(UBlocks.ZAPLING, new Item.Settings().group(ItemGroup.DECORATIONS))); - AmuletItem PEGASUS_AMULET = register("pegasus_amulet", new AmuletItem(new FabricItemSettings() .maxCount(1) .maxDamage(890) @@ -114,11 +113,15 @@ public interface UItems { .group(ItemGroup.DECORATIONS))); static T register(String name, T item) { + return register(Unicopia.id(name), item); + } + + static T register(Identifier id, T item) { ITEMS.add(item); if (item instanceof BlockItem) { ((BlockItem)item).appendBlocks(Item.BLOCK_ITEMS, item); } - return Registry.register(Registry.ITEM, Unicopia.id(name), item); + return Registry.register(Registry.ITEM, id, item); } static MusicDiscItem register(String name, SoundEvent sound, int seconds) { diff --git a/src/main/resources/assets/unicopia/blockstates/green_apple.json b/src/main/resources/assets/unicopia/blockstates/green_apple.json new file mode 100644 index 00000000..45274496 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/green_apple.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/green_apple" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/green_apple_leaves.json b/src/main/resources/assets/unicopia/blockstates/green_apple_leaves.json new file mode 100644 index 00000000..9b6325d5 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/green_apple_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/green_apple_leaves" + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/green_apple_sapling.json b/src/main/resources/assets/unicopia/blockstates/green_apple_sapling.json new file mode 100644 index 00000000..cf5496de --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/green_apple_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/green_apple_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/blockstates/stripped_zap_log.json b/src/main/resources/assets/unicopia/blockstates/stripped_zap_log.json new file mode 100644 index 00000000..06956a0e --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/stripped_zap_log.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "unicopia:block/stripped_zap_log_horizontal", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "unicopia:block/stripped_zap_log" + }, + "axis=z": { + "model": "unicopia:block/stripped_zap_log_horizontal", + "x": 90 + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/stripped_zap_wood.json b/src/main/resources/assets/unicopia/blockstates/stripped_zap_wood.json new file mode 100644 index 00000000..c99ab1cc --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/stripped_zap_wood.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/stripped_zap_wood" + } + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/zap_wood.json b/src/main/resources/assets/unicopia/blockstates/zap_wood.json new file mode 100644 index 00000000..30090bc9 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/zap_wood.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "unicopia:block/zap_wood" + } + } +} diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index 2484bc1c..67df2c27 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -89,10 +89,15 @@ "block.unicopia.rocks": "Rocks", "block.unicopia.zapling": "Zapling", - "block.unicopia.zap_log": "Zap Log", - "block.unicopia.zap_leaves": "Zap Leaves", + "block.unicopia.zap_log": "Zap Apple Log", + "block.unicopia.zap_wood": "Zap Apple Wood", + "block.unicopia.stripped_zap_log": "Stripped Zap Apple Log", + "block.unicopia.stripped_zap_wood": "Stripped Zap Apple Wood", + "block.unicopia.zap_leaves": "Zap Apple Leaves", "block.unicopia.zap_apple": "Zap Apple", "block.unicopia.zap_bulb": "Unripened Zap Apple", + "block.unicopia.green_apple_leaves": "Granny Smith Leaves", + "block.unicopia.green_apple_sapling": "Granny Smith Sapling", "entity.unicopia.butterfly": "Butterfly", "entity.unicopia.twittermite": "Twittermite", diff --git a/src/main/resources/assets/unicopia/models/block/green_apple.json b/src/main/resources/assets/unicopia/models/block/green_apple.json new file mode 100644 index 00000000..5c22c73d --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/green_apple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "unicopia:item/green_apple" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/green_apple_leaves.json b/src/main/resources/assets/unicopia/models/block/green_apple_leaves.json new file mode 100644 index 00000000..9320d8ab --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/green_apple_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/leaves", + "textures": { + "all": "unicopia:block/green_apple_leaves" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/green_apple_sapling.json b/src/main/resources/assets/unicopia/models/block/green_apple_sapling.json new file mode 100644 index 00000000..347f7658 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/green_apple_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "unicopia:item/green_apple_sapling" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/stripped_zap_log.json b/src/main/resources/assets/unicopia/models/block/stripped_zap_log.json new file mode 100644 index 00000000..8aee8c31 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/stripped_zap_log.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "unicopia:block/stripped_zap_log_top", + "side": "unicopia:block/stripped_zap_log" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/stripped_zap_log_horizontal.json b/src/main/resources/assets/unicopia/models/block/stripped_zap_log_horizontal.json new file mode 100644 index 00000000..533ace01 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/stripped_zap_log_horizontal.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column_horizontal", + "textures": { + "end": "unicopia:block/stripped_zap_log_top", + "side": "unicopia:block/stripped_zap_log" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/stripped_zap_wood.json b/src/main/resources/assets/unicopia/models/block/stripped_zap_wood.json new file mode 100644 index 00000000..c0b91a20 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/stripped_zap_wood.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "unicopia:block/stripped_zap_log" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/zap_wood.json b/src/main/resources/assets/unicopia/models/block/zap_wood.json new file mode 100644 index 00000000..5f3e076a --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/zap_wood.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "unicopia:block/zap_log" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/green_apple_leaves.json b/src/main/resources/assets/unicopia/models/item/green_apple_leaves.json new file mode 100644 index 00000000..ddc130e2 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/green_apple_leaves.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/green_apple_leaves" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/green_apple_sapling.json b/src/main/resources/assets/unicopia/models/item/green_apple_sapling.json new file mode 100644 index 00000000..fa137acd --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/green_apple_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:item/green_apple_sapling" + } +} diff --git a/src/main/resources/assets/unicopia/models/item/stripped_zap_log.json b/src/main/resources/assets/unicopia/models/item/stripped_zap_log.json new file mode 100644 index 00000000..808e8d26 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/stripped_zap_log.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/stripped_zap_log" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/stripped_zap_wood.json b/src/main/resources/assets/unicopia/models/item/stripped_zap_wood.json new file mode 100644 index 00000000..f1d170f0 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/stripped_zap_wood.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/stripped_zap_wood" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/zap_leaves.json b/src/main/resources/assets/unicopia/models/item/zap_leaves.json new file mode 100644 index 00000000..6a481c2e --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/zap_leaves.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/zap_leaves" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/zap_log.json b/src/main/resources/assets/unicopia/models/item/zap_log.json new file mode 100644 index 00000000..13676b25 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/zap_log.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/zap_log" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/zap_wood.json b/src/main/resources/assets/unicopia/models/item/zap_wood.json new file mode 100644 index 00000000..31ae309b --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/zap_wood.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/zap_wood" +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/textures/block/green_apple_leaves.png b/src/main/resources/assets/unicopia/textures/block/green_apple_leaves.png new file mode 100644 index 0000000000000000000000000000000000000000..5a8900de7d20a01cb4e0f8d782599c5fa0d0d215 GIT binary patch literal 1466 zcmV;r1x5OaP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1Y=lJq7F{I65w2uR|29E?rXcY_>14SvoH_Rc0T z>xB|R65WzKwEX?2(qDMQSWni4=#%#bk4-j7#v+>YS++SDQ`_3&68_woLKSQxR;YA{D!Fq>&LF*!bSOQ{pBP;{8>dN|CR z0YC)b4#BX30pnR6dnAKMU(ONz|P5xD8;IJkQ1f(#+krfSDdV3ln{t; z>NS9xq#0aU>sqY^8<9iVsk6>G?}Cdix$M!vbB$G~da+9CJ6sI)hg7hi2xZ+DFv80k|mRV;z zyV=iSj&qvx!V6Mqv5Q;$5|+56C0C?c)oQD&zJ?lWs`+58vq~?VeKPmV8gHzDFzTFH zDDA949KvpbTRU-$GcYEW!FXs4AfcskW+GcFjX7$ZnIxzRCy3HDa%OIffkC^lxXK52 zCvzXX5$gWm@+Md2s8RQSFh`BL0dt?c4Op97e=n^L4H{c3!v?BRlwWaKVwRLFTZcb% z$5`gRj!759+P0(7#rtE~rPS7DuszSYEr8Uqt4o&{fEKzN5nExUOVMg&-8MC>R#Ggx z2)F7hD;FQ;ZPvNjqUIE(-=jCkhxJCH0J~c?@o)-X+56o`kS*d>m7a8U({&dIMf?_| zc|n0*VK~(;$R4{Oc)R=Oo$18=4Q}(w%1@T)Uboa$#&JgwpO=HJcLbX3A7mi z{t_jvVfy_*99G4s@-8XYYJ|4bJ$XAcFZ>OP^u0DWj7}1su{kU7BJ5p(T3ZAV0-}cs`jWl11nBj`gVy$4wbQ9@w2o=8{6Mi@T10Lh*J69=mivR!tOi4sRR5;6BQ_HP{FbtfacaJCmi2`z= zBcyc$h#C+LIMQ~s7Yaa12`Clh9UkLnHkU|_KQrS=kXaf4=v#wkZSsFuSYvWtT0Ab23mdGhSMx<=~cg=Efy0+U%hj03zEIMr{Z zoaJu|ww{}3y(+%F;J3oVA<(SG-JE&H)@8Lf-ri6hp&XyXbnvMBR3h?zFn$bpO}ud5 z`Y`uV@V$S(dww==aRC1!YSwmq4s#%j*JW+|NJQlkcU}|^kCW?FQLk!7vbTHaFQX$y UQvcF%2><{907*qoM6N<$f>(gQ&Hw-a literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/unicopia/textures/block/stripped_zap_log.png b/src/main/resources/assets/unicopia/textures/block/stripped_zap_log.png new file mode 100644 index 0000000000000000000000000000000000000000..ffa3e0f6064ab519a3f6b19279ac07f12dba2254 GIT binary patch literal 2025 zcmV zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1b@vg9ZZ{Ld-o2p}W@$Kk_{*cduK)h$c7Na^PwZGy)}rchap6K0FWJA>WzXXMJ>MC>V6t$ug8Sve zehaw2$qCPhXI#RwUz~>G#{xai@J$}%H+ekU&@Ue4Z3sbs%BB0{Kd=1$?tA1LF}tbF zl@<9>3u=e*yg{)cG4WZZxD$SY_w?KaclOnH7uXNqeZ$>D2^6Bg1BVf6xWn~4d*~Av zx+vjE)G0o)91|7l(Z>+kMUEV9O0mQdbEMemiV;#ezJzDr@@&^b#>OK+lLCwdtaxs> zU;fwotD*buGerT>?_9wzq6tHoS&Z{9v;auBH;?2=@V_-0BNPQsUW?N(14t3}7B~|k5bzqJ1PwkBr4W$E416j)r|6g(AP6Ef;3aX43UD&b zy|E^RN0)?_7$pQCBx+26ro;-Yn1$7G;tUQ|iNYeHk|ax!s!>@*Rg=zItSKf=k~F21 zQ%N<)%vrMLlyfe*xR15Kj{U5Sk`tJ_lx+$hnD`FNCTPf|oME8DSy@ z1o;XicR1L+$o;_0q3-`JZuE(qo6!9~kaH8dFUbAG?F(vS_V+&P(4(=KOxu=k7zku3&%bvPCpM3_^@pQr=&w%Im7Io_#{Wg|<-)8COr+k6g z5SEAW>@BdGdxcvvZ@}BUl41GtZ2q~fay@&L08X#BvXcv0Tq}|9cJl4b z&-&q=`*iPj@50(FtBPf+ce97##I`F|)dw|9MN1@jX^cW1WhGu2<-27s-wXtFVDs5k zRPtsKs<;@aXakm^NMk{coEazmeu^#hSHfJ|tkY;d&?a3UhgD(BuJS~WmXZt+1??;r zy}B)8 zqGDKOQUjb%Df+ZL%pV@EgyDP?cUsBnc|yU9$k?pP4o;0*CBMwO&0KYsnQ}5%-(K>8 z@hN|PtJO+m)wY|(U9AFQpf{z-Qrdg5RC!g4nqPp$7NFLw8vOPRMs_t|1g(nlyJjcJ zO-(<5Y)@mG+_oB2JXbiVeLn4_iQ$Znv>?Z9i6tym0MxA3at8&?i}W?Tu?zLeM3&XQ zBkj4h-H-a)-E?R8P%jU^h2D(kUrI-LEFR%38mvf*r)Yi8w{jvfNO2IgY|TDl)!ZhO z=24Wt8Z*z7u}-ae88nrP)dwoUFZf|Ow{32x8Z*8e7mYa>D|{K%lEKLs*=t{Cw8DQ9 zWLNx#{7kYBBu@j`TtRMi^&^}j-U*faF5;Ko`LIxT*S+59VGyyigkmmlwxXoAm&Yed z2s(#1?nFAH5T~LwX^~Y!YBI*^8`I19gu^E7_7snqV#!1&zE)`ZcF@EA`qAWe#@=Rk zoI25u5gzz~uT7oVOVmytqi+J>Jh zMmAXW4?MKY;_Nl!SkrEMsk46E6PbYmlD>y4wRWkAcMIEPAE1{R!ht#Ft`b!X*Fz0p3YOK~y-)ZIfGW+b|GC4=GZVWLLJ)I8A^S z{pmuwoNgt{EQ$g_n!>hhJt*u+GiNr@k7y<9W~Y3mSl3u|cL%zbV?AlB#dU?s|b8T|`RF zxAGo_A^Td~Vf&WM ztdU)CtV~KFG>vbFG2(`61rE)q%xzlEvBAX=LGS~$?Uw-=dSZawYod!BL{08BLHHNa z5^UQooaKq(Q?>zMqgL-~KmGlwuP|P6(3W*kpb|Bbc&6pKy8uv-%sUanz%GuD*3H=U zpe>iC;m`3Ir7~peElt}ZLKsO5%N|Ule80Y-79G2|;?gXVix8$!_LTVtB+Hl%*3TO_ z$vWA(DA;drXk3SsiN+|!-jtMSF&9mjC!5y$i{5dkHgo(RtESzEx-kio00000NkvXX Hu0mjf8Z+;5 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/unicopia/textures/block/stripped_zap_log_top.png b/src/main/resources/assets/unicopia/textures/block/stripped_zap_log_top.png new file mode 100644 index 0000000000000000000000000000000000000000..ca01db3464f812881ef0fcdb5c34b749a08256b4 GIT binary patch literal 1699 zcmV;U23+}xP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1Y?lI$i7{Ld+J1SABA<6y9>a)TT{jrsD~3KomYXqGvAb z?m2al6BlP4IWbP0(8bXuSDiX`g-_=&%L@zL=cfC(LW+YcVJ8!m5hU(r=HS1!S4G!V znu`e5PhSBSbEAQp7hU_uE)YW3j3a+Lc(%_E#6pQ+S97z%z-*7M;_$R%%bA;Khm9V+ zbm3Ts0=Nigdw?Ma25cbbDUglKkqCZN@RNa@oe@4j0eR0AC|R5fAV;~K4Vg&yUiRFl zkwPHCyWk?INiKsc5ih|=6h#bW@4R^LgO6T)@;SI5!G{oHXt|i9ixPbdF-DCkW_2p+ zHE2}Tq}e1+4!P=6NHJ+jDQ6s-p*cf3YsSREhdbo(M>yi4M>=vr_!KF=gc6IERI;gD zU6txna+G6)Gl|)<*#tXORse0#oEoP`NG+E=Kh&A8mxgZ zb8{xxG+D!Rj8g@*a^f3jV2p*pcx((Hpt*5ol|;BPXBuZVF|xulQ2ItrrN$T-l#|$B zw7A>MedEm_@Bb}t{AA8F>i!SrOr!3Fx$nHauvS}rFD(x(3R_FV=2YvDey0zbS#yOj za~p9MW#317aJWY)2|VLTJhNzSA_jKZ)TJ{@);++LaWCfJ$@i&Nf0jCX57a)7GM|gz zH#xYg4UcTk`nhdwH*fg&T({&9WHR-kLr6{GCq(nA-+_T!ES2+Nl8bqIFgxz!Qi^TM z=HU_iK75qy0Frf2y<2DWv3IH&o`6NTXY9td0KXtJ4O$(p2re&7GX3}@E?`W^?$@{L@Z&2Y*$=8i7k?xKE{`01I1 zbg90(122!hj51QP90Pa=rB7!%(#T&_y(L9mxec)nGC~-Q-*ZvA6HtC; z$ZZaHjy$q)qc3+gGp(HOTK&McEq=}5&onSU<;Q3LD_YGPuXrrn!-ztYeVF$U-uyEt zvrZ4pnq*|VU@qF9`UQ$tMO&4{yp)!Y%JK-iC%TV&%6z%IezQKm^`@7@Yn-2x4vN~_ zZ2I9Cjx5oCn)~q44xAM(tEjKFQSp)bH0($5*Qca;bu+!;+IPkqJ?5921{%S$BKKW3 zJc`8%$j5DSbe|X0(H`I;OWTEqUNV0J^o+IAdoFT!0004ANklo_BdOI{@Q?lmd`w*IK1qbud)yXjb2agxY+5P-}&XqN1sB&cupE;zdzP(wU45 z9v}RK&0K=;Pel6hJO4LsMA{W9iYgNZKC5@ZZReox0{NqEd_(j3L1mVyIZB9zPv#&m zil)_6zsictw$C`46-RhJwg8Jz($ejg0KwMSVPu6+8SmXKu{2StfzZ<1bgjfIo002ovPDHLkV1k`WI|~2+ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/unicopia/textures/item/green_apple_sapling.png b/src/main/resources/assets/unicopia/textures/item/green_apple_sapling.png new file mode 100644 index 0000000000000000000000000000000000000000..b268c7d0e1af8784f84e271d54aa3ad46acc1c61 GIT binary patch literal 1976 zcmV;p2S@mcP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+Pzm>ax5nd{bv>$g};n6)a_FVfq zNu|4NXb|E^M-q(Dzy2KN4?K>dH9jPXIYx`eXP;d`N9^O#(`IYO?0fvt8KYZ@%*({p zBfRg%9a=`qd+^?mry_n@5bu`WjZ^qA&i6L%1(95e9NwpKWt;5tBago^x(wKCrnE0U z!awmCb(yky5Ug+vuVoQ$!e2l?tvBNpTWmArZMV%W zXpA;pM6mwy6>vE>X`tyvp8p{QLTFrZ6qbXp_u~U%p~ORKx>;agv30AcfgZ8NW)aO0 z3~2pcocd7!7h&%JFvMWMM&dw`Y;rCU!H)ud3XnTC-c?XQA-E2d&ND}lBW~`EHHnt2 z3vLf1g+N5$$O+VBF5t@h;G^-$3u34Q4nBksLkbddD3PO&A;y^E%*B#8`4m!2DM`wy z2#c2>QId#cDJHwj$kmWzPFZr!rC`$n%>}EA6bw{Xx%wJvtf@-PwKRlJ^DVU4Qj?Zj zG2M0UzK0%r>e6#BN{UcYuR)_G70p@(LT&KyBaArGkda5ZSzD}{7tTI2_cd#DSOZ~Z zapoa(v4-K4E)_J(Ntm30G3N=4r^x^U+D*=^koRsfXC`MhJ7h(0Kp7@EohD;o&?~tx z=;rRh+$Y`)^8TOl=AM}|le+(cIWwty!`x@y-munZeQz@lEehLA!|7DZNIwXu6eo~y zKWoiT7yJ*3M(VTYszz8=k+W;2iEU|51k25qH9EkZ=6A}>m%EJ;;#QEEHMTEQn_ny$ zVEhQSXAHw1T}`+JyZShk%2s4i_s=pX8lb2gYb$o}PvUP|?pDRDUrRQ_1nGh4IAdg{VM4S&Ni&C zed-H1&QT-A>c?UePWm;BZa_&}AHn1ie9G&Cf)>)0d)?SHWM%4h&EbN8O1b3h6K3c4 z&TQa@HV$J|q#+d59jAkH{Wge>73MOd9o4}}I}Ruf1iG=oI-5|~mKE8htjC0$n@a^I zn9Bw^7FgOc(+8-iisO5GC$*l{!du5zfoj@a@AF{Ow(8*})pq&dciV+!Lov@-+A$;I z#%8yK4fz$}CtU}zIgsU2hPe9*W9qIROEV0Lk@tqh2&oNws&k&J%b8P;vm4Ue!_rhv zwydPnlXU4Mo%uzf(yphjG(`1@>0%Lb2e8(xopfCIOoK5o30?MpCifulmRn+XJRW5k zZau!#sR#$@=SbawdKpk~fPP5#Q!|+MsObU4@q&&BEbO*X^9sMMEkt@!Eg=|NdLVwd z*G&K3l+<_}02#`y@2@^@m}lvgqccUHszf-&AD?OOo-Jp4B@0UNu08@{>Ke@%*U1fE zd_0v$W@O{ObBYDh!Q~IJ@E+?ObcL@v(~N##4DLurv7|&=j$*-;Bj%f=#nHVD3ZU5* z+t5#mj}PRJ3N~-m+VfFq@tgD3A$hAdiu$9MFTZPP_!IUk_;7>U#+2+$;)C52oOhBo zfv=|w*2@>Lww3qkXrA)%m3;g<+pDYMiuP?`G4HiJ)hrE%)iQzRr~2|-b*kBY)XP@s zhag^B^OJH&hx)8gTo!G@saCO(g?$v#Fpxp->uE`nKNE|^F zeg8-*!5f0>a$D?q;0Y0OLeiu#p2Zd^(wqx9Fc566_EM#>v{&mi5=dZ+i;bm)r=~Pu z6dMJTD>m%9Ugl0N3Aper&KdXcOoV(GnECVHpZDMY1N^7aU4k61z@{Y-_!1lCueW1f zZBMb|6*zfT`)nn{Y9;-tWCC9J2GbJy)#P34>^J7(5lp_$Bk-k8elPi2;7gbQs&0YT zHckNt5Ho@SU_Sj2t#${zAYm?!;0A*@BvN&*Jvc?FY3O?A$VRK(K^RGV9=o78B>M1d zi+U1xZXIz*6#GP_rh)X}0A`Ce%TH2^_Oafer_aX_G$hKk;@`Vab-NlIpZFNfSy--J ztFOSGTfb(I>_E1X;Z<$`0MaYtIC$BO5i^3bl?;1s9cS@R)(jNTv;>T0scO}Vo0h=N z`y-T^2Es_9ef|r7-depSOfOB~<}3}~e{vsrrz>(wfdL@z z82J9~2ZfOYUA3y!?f`%WuYZXsH$F_UPq$BGxmLvV(gd=V3|HL(zj!>vO1LEB8R&%GjHK>)Kf45xch&A6Qs#F60000< KMNUMnLSTZ>ImCtl literal 0 HcmV?d00001 diff --git a/src/main/resources/data/minecraft/tags/blocks/leaves.json b/src/main/resources/data/minecraft/tags/blocks/leaves.json new file mode 100644 index 00000000..154300bb --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/leaves.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "unicopia:zap_leaves", + "unicopia:green_apple_leaves" + ] +} diff --git a/src/main/resources/data/minecraft/tags/blocks/logs.json b/src/main/resources/data/minecraft/tags/blocks/logs.json new file mode 100644 index 00000000..37a121dc --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/logs.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "unicopia:zap_log", + "unicopia:zap_wood", + "unicopia:stripped_zap_log", + "unicopia:stripped_zap_wood" + ] +} diff --git a/src/main/resources/data/minecraft/tags/items/leaves.json b/src/main/resources/data/minecraft/tags/items/leaves.json new file mode 100644 index 00000000..154300bb --- /dev/null +++ b/src/main/resources/data/minecraft/tags/items/leaves.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "unicopia:zap_leaves", + "unicopia:green_apple_leaves" + ] +} diff --git a/src/main/resources/data/minecraft/tags/items/logs.json b/src/main/resources/data/minecraft/tags/items/logs.json new file mode 100644 index 00000000..37a121dc --- /dev/null +++ b/src/main/resources/data/minecraft/tags/items/logs.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "unicopia:zap_log", + "unicopia:zap_wood", + "unicopia:stripped_zap_log", + "unicopia:stripped_zap_wood" + ] +} diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/green_apple.json b/src/main/resources/data/unicopia/loot_tables/blocks/green_apple.json new file mode 100644 index 00000000..6f593d84 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/green_apple.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:green_apple" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/green_apple_leaves.json b/src/main/resources/data/unicopia/loot_tables/blocks/green_apple_leaves.json new file mode 100644 index 00000000..01dc262b --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/green_apple_leaves.json @@ -0,0 +1,116 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + ], + "name": "unicopia:green_apple_leaves" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "conditions": [ + { + "chances": [ + 0.02, + 0.022222223, + 0.025, + 0.033333335, + 0.1 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 2.0, + "min": 1.0 + }, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "minecraft:stick" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/green_apple_sapling.json b/src/main/resources/data/unicopia/loot_tables/blocks/green_apple_sapling.json new file mode 100644 index 00000000..2b74e8cb --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/green_apple_sapling.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:green_apple_sapling" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/zap_leaves.json b/src/main/resources/data/unicopia/loot_tables/blocks/zap_leaves.json new file mode 100644 index 00000000..4405e063 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/zap_leaves.json @@ -0,0 +1,116 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + ], + "name": "unicopia:zap_leaves" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:alternative", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "enchantments": [ + { + "enchantment": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + ] + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "conditions": [ + { + "chances": [ + 0.02, + 0.022222223, + 0.025, + 0.033333335, + 0.1 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 2.0, + "min": 1.0 + }, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "minecraft:stick" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/zap_log.json b/src/main/resources/data/unicopia/loot_tables/blocks/zap_log.json new file mode 100644 index 00000000..c8e82cb7 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/zap_log.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:zap_log" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/zap_wood.json b/src/main/resources/data/unicopia/loot_tables/blocks/zap_wood.json new file mode 100644 index 00000000..7eaab0a0 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/zap_wood.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:zap_wood" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/tree_types/dark_oak.json b/src/main/resources/data/unicopia/tree_types/dark_oak.json index b8f0a424..c7f9a29f 100644 --- a/src/main/resources/data/unicopia/tree_types/dark_oak.json +++ b/src/main/resources/data/unicopia/tree_types/dark_oak.json @@ -3,8 +3,8 @@ "leaves": [ "minecraft:dark_oak_leaves" ], "wideTrunk": true, "drops": [ - { "weight": 1, "item": "unicopia:rottenn_apple" }, + { "weight": 1, "item": "unicopia:rotten_apple" }, { "weight": 2, "item": "unicopia:sweet_apple" }, - { "weight": 5, "item": "unicopia:zap_apple" } + { "weight": 5, "item": "minecraft:apple" } ] } \ No newline at end of file diff --git a/src/main/resources/data/unicopia/tree_types/green_apple.json b/src/main/resources/data/unicopia/tree_types/green_apple.json new file mode 100644 index 00000000..cccd1ad4 --- /dev/null +++ b/src/main/resources/data/unicopia/tree_types/green_apple.json @@ -0,0 +1,6 @@ +{ + "logs": [ "minecraft:oak_log", "minecraft:oak_wood" ], + "leaves": [ "unicopia:green_apple_leaves" ], + "wideTrunk": false, + "drops": [] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/tree_types/zap_apple.json b/src/main/resources/data/unicopia/tree_types/zap_apple.json new file mode 100644 index 00000000..e6f3ad61 --- /dev/null +++ b/src/main/resources/data/unicopia/tree_types/zap_apple.json @@ -0,0 +1,6 @@ +{ + "logs": [ "unicopia:zap_log" ], + "leaves": [ "unicopia:zap_leaves" ], + "wideTrunk": false, + "drops": [] +} \ No newline at end of file