diff --git a/assets/models/hive_core.bbmodel b/assets/models/hive_core.bbmodel new file mode 100644 index 00000000..0d1d6e1c --- /dev/null +++ b/assets/models/hive_core.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.5","model_format":"java_block","box_uv":false},"name":"hive_core","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"core","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[1,1,1],"to":[15,15,15],"autouv":0,"color":6,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,16,16],"texture":0},"east":{"uv":[0,0,16,16],"texture":0},"south":{"uv":[0,0,16,16],"texture":0},"west":{"uv":[0,0,16,16],"texture":0},"up":{"uv":[0,0,16,16],"texture":0},"down":{"uv":[0,0,16,16],"texture":0}},"type":"cube","uuid":"494e4b71-f1df-46c1-f373-aa720b94be5e"},{"name":"activity","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[0,0,0],"to":[16,16,2],"autouv":0,"color":1,"origin":[0,0,0],"faces":{"north":{"uv":[0,0,16,16],"texture":1},"east":{"uv":[14,0,16,16],"texture":1},"south":{"uv":[0,0,16,16],"texture":1},"west":{"uv":[0,0,2,16],"texture":1},"up":{"uv":[16,2,0,0],"texture":1},"down":{"uv":[16,14,0,16],"texture":1}},"type":"cube","uuid":"13733a81-bd87-34dc-d9b6-05392c74222a"}],"outliner":["494e4b71-f1df-46c1-f373-aa720b94be5e","13733a81-bd87-34dc-d9b6-05392c74222a"],"textures":[{"path":"/home/sollace/Desktop/hive_core.png","name":"hive_core.png","folder":"","namespace":"unicopia","id":"0","particle":true,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"b6416600-de7b-5a1b-2752-6724918266ab","relative_path":"../../../../../../../Desktop/hive_core.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAqBJREFUOE9tk0tvHEUURs+t6qqenkfs8Qy2I4GwRCQiFJIYzCKxQLDgB8Ce/w0SYgFexMFtu3um3111UTtIySLLKtWt+u6tc+TLp89UVQlBERFmswznPGdnX3B9fcVdnuO8w1rPbl8ynbVWHs4aY5EXLy80RmUYBo6Ojui7jmpXcvLJKUNVIQJVWXBy9oSq3XOT5yTOYYww1cn3P/ysef4W72fUZYFXxUkkljsSa8nmc/q6YjAJQ5Iw3x5Tdw3rzTFVtUcuvrvU6ZUwDoRyD/lb5qkjiiUMA6vlgr7tGIaewTr84SF+fUgThaZtkGdfX6j3jiq/YVbeYw3MjMEnnr7vcM4Sgz70romjt0IggaMNbj5Hzr95rfX+HtO2LMJIliZoWYEBExVjLWMYkcQRxNBqwPoZ7vgxu65Ffvn1N/33zRXXf/1BFkcWUZAYiUaYOw+q9BqQEBliRMQQ5gvG1YqTz58gry5/0qEoGIs7tCqxEQQlS1OcTgkMVgzNOEKakqYZTddgtqfoYoV89fS5ZmFE6x02RrquBYVHzpGa6SolBhhFHuZjjHkYZphl9MsVcv78W+2LO2Yu5dFyw+0/vxNUWfgUh+CNPKw1BrxNGKISZ3NClnEXAnJ+/koPFkvyv//EVnv6EPDGYjXibMJEkhEhhJE0y1AS6jjgjrasHn+GvL78Udu6ocuvkWFAx5FsijsGkqlwShAFf3BAW9xiXIKs1iTrNWVTvwPJGiFRpb0vcDIidUdT7Zj24xR/Yt7P0YmA5RJ1KaQz2r57j3KWZgxNQyqGsSmJdYM1hnHoiYnF+Ix+amu5IghstqfvUP5Qpu1mwziMNLuC7eaYIr+hbvY0Xcfxp2fTf1BMvvj0vUwf09n/r/Ob6ytuP9B5/xGd/wPFiXTP8ca0JAAAAABJRU5ErkJggg=="},{"path":"/home/sollace/Desktop/hive_activity.png","name":"hive_activity.png","folder":"","namespace":"unicopia","id":"1","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"8c57b642-7139-0ef2-7e98-d580239ce477","relative_path":"../../../../../../../Desktop/hive_activity.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAkhJREFUOE+tk0tv00AUhb9x4vgV23k1LW1FKlV9SLSlhbIoFQgW/ADY87ORULsh0JamwUkcxxk7TjIog+APlJFmNXfOPefcc8XB4ZFSSrFYKIQQ2LaDaVbY2dnlvnfDIIqoVExKpQqTyZhVbakkdK1hlBDPT8/VcqkoioJms8l8viBNJ2xv75AkY9J0dVM6nV2kTIiiCNM0MQzB6p948/aDiqIHLMtByqnuXq1WyWczAr/GaNRHKUG5bJKmCY7jkueSZrOtG4nzV5dqhWYYBnlekCQJ29tbOG4VEBhigefVub7+Cigsy2S5XOruMpOIo+Nz5Xku0+kUKTM6nQ7z+ZzZLKdUKmuwm5tbFos5lYpFuVym2+3iODau6yLOXrxWRZHh+wGWZeF6LvFoRdUijke0Wm2iqE8QhEiZE9Z8pumUPM+1R+Ljp89KypSH/j3r60/43u2yXBaEtYB6rYHvhyRJzHA0IB6NMQyTp50Ovd5P2msbiIvL98oQJW2e47r07m+xbZtGo649mC/nlI2y1j8YDMmyjPWNLeR0SlHMEAeHJ2qlRwjY3NzSUuJ4jO/7jCcxf09QXTFJCMNAU7+7u0UpEMcnL9UK1fOq7O8/YzCMaDXr2g8p5T8Ax3G07l/RkEa9ydXVlz9jPD27UK3WGsNhpBE9zyEIaxRFThj4TCaSatUhHieYpsU4HpGmUjOu15uI15fvVJbNSNOYRqOtR2PZFbrffmDbFfb29uhHI2ZZqlM6GDzgeaF+i8fxfwjSo6P86GV67Dr/BkQRecNu1A/UAAAAAElFTkSuQmCC"}]} \ No newline at end of file diff --git a/assets/models/hive_core.json b/assets/models/hive_core.json new file mode 100644 index 00000000..ace6646f --- /dev/null +++ b/assets/models/hive_core.json @@ -0,0 +1,35 @@ +{ + "textures": { + "0": "unicopia:hive_core", + "1": "unicopia:hive_activity", + "particle": "unicopia:hive_core" + }, + "elements": [ + { + "name": "core", + "from": [1, 1, 1], + "to": [15, 15, 15], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#0"} + } + }, + { + "name": "activity", + "from": [0, 0, 0], + "to": [16, 16, 2], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "west": {"uv": [0, 0, 2, 16], "texture": "#1"}, + "up": {"uv": [16, 2, 0, 0], "texture": "#1"}, + "down": {"uv": [16, 14, 0, 16], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/unicopia/EquineContext.java b/src/main/java/com/minelittlepony/unicopia/EquineContext.java new file mode 100644 index 00000000..a28433c4 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/EquineContext.java @@ -0,0 +1,31 @@ +package com.minelittlepony.unicopia; + +import com.google.common.base.MoreObjects; +import com.minelittlepony.unicopia.entity.Equine; +import com.minelittlepony.unicopia.entity.player.Pony; + +import net.minecraft.block.ShapeContext; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemUsageContext; + +public interface EquineContext { + EquineContext ABSENT = () -> Race.UNSET; + + Race getSpecies(); + + default Race.Composite getCompositeRace() { + return getSpecies().composite(); + } + + static EquineContext of(ShapeContext context) { + return context instanceof EquineContext c ? c : ABSENT; + } + + static EquineContext of(ItemUsageContext context) { + return MoreObjects.firstNonNull(Pony.of(context.getPlayer()), ABSENT); + } + + static EquineContext of(Entity entity) { + return MoreObjects.firstNonNull(Equine.of(entity).orElse(null), ABSENT); + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/HiveBlock.java b/src/main/java/com/minelittlepony/unicopia/block/HiveBlock.java new file mode 100644 index 00000000..35b2f1af --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/HiveBlock.java @@ -0,0 +1,125 @@ +package com.minelittlepony.unicopia.block; + +import java.util.Collection; + +import com.minelittlepony.unicopia.EquineContext; +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.USounds; +import com.minelittlepony.unicopia.entity.player.Pony; +import com.minelittlepony.unicopia.particle.ParticleUtils; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.ConnectingBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.particle.ParticleTypes; +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.state.property.Property; +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.World; +import net.minecraft.world.WorldAccess; + +public class HiveBlock extends ConnectingBlock { + static final BooleanProperty AWAKE = BooleanProperty.of("awake"); + static final Collection PROPERTIES = FACING_PROPERTIES.values(); + + public HiveBlock(Settings settings) { + super(0.5F, settings); + setDefaultState(getDefaultState().with(AWAKE, false)); + PROPERTIES.forEach(property -> { + setDefaultState(getDefaultState().with(property, true)); + }); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(PROPERTIES.toArray(Property[]::new)); + builder.add(AWAKE); + } + + @Override + public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { + super.randomDisplayTick(state, world, pos, random); + + if (random.nextInt(250) == 0) { + world.playSoundAtBlockCenter(pos, USounds.BLOCK_CHITIN_AMBIENCE, SoundCategory.BLOCKS, 0.13F, 0.2F, true); + + for (int i = 0; i < 9; i++) { + world.addParticle(random.nextInt(2) == 0 ? ParticleTypes.SPORE_BLOSSOM_AIR : ParticleTypes.CRIMSON_SPORE, + pos.getX() + random.nextDouble(), + pos.getY() + 1.1, pos.getZ() + random.nextDouble(), + random.nextDouble() - 0.5, 0, random.nextDouble() - 0.5 + ); + } + } + } + + @Deprecated + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + boolean connected = !neighborState.isAir(); + state = state.with(FACING_PROPERTIES.get(direction), connected); + + if (!connected) { + return state.with(AWAKE, true); + } + + return state; + } + + @Override + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + if (!state.get(AWAKE)) { + return; + } + + for (var property : FACING_PROPERTIES.entrySet()) { + if (!state.get(property.getValue())) { + BlockPos neighborPos = pos.offset(property.getKey()); + //world.setBlockState(neighborPos, getDefaultState()); + world.setBlockState(neighborPos, UBlocks.CHITIN.getDefaultState()); + + world.playSound(null, neighborPos, USounds.Vanilla.BLOCK_SLIME_BLOCK_PLACE, SoundCategory.BLOCKS); + world.playSound(null, neighborPos, USounds.BLOCK_CHITIN_AMBIENCE, SoundCategory.BLOCKS, 0.13F, 0.2F); + + for (int i = 0; i < 9; i++) { + ParticleUtils.spawnParticle(world, random.nextInt(2) == 0 ? ParticleTypes.SPORE_BLOSSOM_AIR : ParticleTypes.CRIMSON_SPORE, + neighborPos.getX() + random.nextDouble(), + neighborPos.getY() + 1.1, pos.getZ() + random.nextDouble(), + random.nextDouble() - 0.5, 0, random.nextDouble() - 0.5 + ); + } + } + } + } + + @Deprecated + @Override + public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { + world.scheduleBlockTick(pos, this, 15); + super.neighborUpdate(state, world, pos, sourceBlock, sourcePos, notify); + } + + @Deprecated + @Override + public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return EquineContext.of(context).getSpecies() == Race.CHANGELING ? VoxelShapes.empty() : super.getCollisionShape(state, world, pos, context); + } + + @Deprecated + @Override + public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) { + float delta = super.calcBlockBreakingDelta(state, player, world, pos); + delta *= Pony.of(player).getSpecies() == Race.CHANGELING ? 2 : 1; + return delta; + } +} diff --git a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java index 5f38e656..2e5d6b23 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/block/UBlocks.java @@ -121,6 +121,7 @@ public interface UBlocks { Block CHISELLED_CHITIN_SLAB = register("chiselled_chitin_slab", new SlabBlock(Settings.copy(CHISELLED_CHITIN)), ItemGroups.BUILDING_BLOCKS); Block CHISELLED_CHITIN_STAIRS = register("chiselled_chitin_stairs", new StairsBlock(CHISELLED_CHITIN.getDefaultState(), Settings.copy(CHISELLED_CHITIN)), ItemGroups.BUILDING_BLOCKS); Block CHISELLED_CHITIN_HULL = register("chiselled_chitin_hull", new OrientedBlock(Settings.copy(CHISELLED_CHITIN)), ItemGroups.BUILDING_BLOCKS); + Block HIVE = register("hive", new HiveBlock(Settings.create().mapColor(MapColor.PURPLE).hardness(6).ticksRandomly().sounds(BlockSoundGroup.CORAL)), ItemGroups.NATURAL); Block MYSTERIOUS_EGG = register("mysterious_egg", new PileBlock(Settings.copy(Blocks.SLIME_BLOCK), PileBlock.MYSTERIOUS_EGG_SHAPES), ItemGroups.NATURAL); SegmentedCropBlock OATS = register("oats", SegmentedCropBlock.create(11, 5, AbstractBlock.Settings.copy(Blocks.WHEAT), () -> UItems.OAT_SEEDS, null, null)); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Equine.java b/src/main/java/com/minelittlepony/unicopia/entity/Equine.java index b7219517..a9cf3707 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Equine.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Equine.java @@ -6,6 +6,7 @@ import java.util.function.Predicate; import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.EntityConvertable; +import com.minelittlepony.unicopia.EquineContext; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.projectile.ProjectileImpactListener; import com.minelittlepony.unicopia.util.NbtSerialisable; @@ -13,17 +14,11 @@ import com.minelittlepony.unicopia.util.Tickable; import net.minecraft.entity.Entity; -public interface Equine extends NbtSerialisable, Tickable, ProjectileImpactListener, EntityConvertable { +public interface Equine extends NbtSerialisable, Tickable, ProjectileImpactListener, EntityConvertable, EquineContext { Physics getPhysics(); - Race getSpecies(); - void setSpecies(Race race); - default Race.Composite getCompositeRace() { - return getSpecies().composite(); - } - /** * Called at the beginning of an update cycle. */ diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java new file mode 100644 index 00000000..fbd059ad --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinEntityShapeContext.java @@ -0,0 +1,37 @@ +package com.minelittlepony.unicopia.mixin; + +import java.util.function.Predicate; + +import org.jetbrains.annotations.Nullable; +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; + +import com.minelittlepony.unicopia.EquineContext; +import com.minelittlepony.unicopia.Race; + +import net.minecraft.block.EntityShapeContext; +import net.minecraft.entity.Entity; +import net.minecraft.fluid.FluidState; +import net.minecraft.item.ItemStack; + +@Mixin(EntityShapeContext.class) +abstract class MixinEntityShapeContext implements EquineContext { + private EquineContext equineContext; + + @Inject(method = "", at = @At("TAIL")) + private void init(boolean descending, double minY, ItemStack heldItem, Predicate walkOnFluidPredicate, @Nullable Entity entity, CallbackInfo into) { + equineContext = EquineContext.of(entity); + } + + @Override + public Race getSpecies() { + return equineContext.getSpecies(); + } + + @Override + public Race.Composite getCompositeRace() { + return equineContext.getCompositeRace(); + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/hive.json b/src/main/resources/assets/unicopia/blockstates/hive.json new file mode 100644 index 00000000..e363894a --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/hive.json @@ -0,0 +1,68 @@ +{ + "multipart": [ + { + "apply": { + "model": "unicopia:block/hive_core" + } + }, + { + "apply": { + "model": "unicopia:block/hive_side", + "uvlock": true + }, + "when": { + "north": true + } + }, + { + "apply": { + "model": "unicopia:block/hive_side", + "uvlock": true, + "y": 90 + }, + "when": { + "east": true + } + }, + { + "apply": { + "model": "unicopia:block/hive_side", + "uvlock": true, + "y": 180 + }, + "when": { + "south": true + } + }, + { + "apply": { + "model": "unicopia:block/hive_side", + "uvlock": true, + "y": 270 + }, + "when": { + "west": true + } + }, + { + "apply": { + "model": "unicopia:block/hive_side", + "uvlock": true, + "x": 90 + }, + "when": { + "down": true + } + }, + { + "apply": { + "model": "unicopia:block/hive_side", + "uvlock": true, + "x": 270 + }, + "when": { + "up": true + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index 5d1ce69d..161d97dc 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -207,6 +207,7 @@ "block.unicopia.sour_apple_sprout": "Sour Apple Sprout", "block.unicopia.surface_chitin": "Surface Chitin", + "block.unicopia.hive": "Hive", "block.unicopia.chitin": "Chitin", "block.unicopia.chitin_spikes": "Chitin Spikes", "block.unicopia.chiselled_chitin": "Chiselled Chitin", diff --git a/src/main/resources/assets/unicopia/models/block/hive_core.json b/src/main/resources/assets/unicopia/models/block/hive_core.json new file mode 100644 index 00000000..19f32612 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/hive_core.json @@ -0,0 +1,20 @@ +{ + "textures": { + "all": "unicopia:block/hive_core", + "particle": "unicopia:block/hive_core" + }, + "elements": [ + { + "from": [1, 1, 1], + "to": [15, 15, 15], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/block/hive_side.json b/src/main/resources/assets/unicopia/models/block/hive_side.json new file mode 100644 index 00000000..95bf811c --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/hive_side.json @@ -0,0 +1,20 @@ +{ + "textures": { + "all": "unicopia:block/hive_side", + "particle": "unicopia:block/hive_side" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 16, 2], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "east": {"uv": [14, 0, 16, 16], "texture": "#all"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "west": {"uv": [0, 0, 2, 16], "texture": "#all"}, + "up": {"uv": [16, 2, 0, 0], "texture": "#all"}, + "down": {"uv": [16, 14, 0, 16], "texture": "#all"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/hive.json b/src/main/resources/assets/unicopia/models/item/hive.json new file mode 100644 index 00000000..dbb7f204 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/hive.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "unicopia:block/hive_side" + } +} diff --git a/src/main/resources/assets/unicopia/textures/block/hive_core.png b/src/main/resources/assets/unicopia/textures/block/hive_core.png new file mode 100644 index 00000000..b2a08353 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/hive_core.png differ diff --git a/src/main/resources/assets/unicopia/textures/block/hive_side.png b/src/main/resources/assets/unicopia/textures/block/hive_side.png new file mode 100644 index 00000000..851c75f9 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/block/hive_side.png differ diff --git a/src/main/resources/data/unicopia/loot_tables/blocks/hive.json b/src/main/resources/data/unicopia/loot_tables/blocks/hive.json new file mode 100644 index 00000000..ee8a6619 --- /dev/null +++ b/src/main/resources/data/unicopia/loot_tables/blocks/hive.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "name": "unicopia:hive" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/recipes/hive.json b/src/main/resources/data/unicopia/recipes/hive.json new file mode 100644 index 00000000..28e4e633 --- /dev/null +++ b/src/main/resources/data/unicopia/recipes/hive.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " # ", + "#o#", + " # " + ], + "key": { + "#": [ + { "item": "unicopia:chitin" } + ], + "o": [ + { "item": "unicopia:mysterious_egg" } + ] + }, + "result": { "item": "unicopia:hive", "count": 1 } +} \ No newline at end of file diff --git a/src/main/resources/data/unicopia/worldgen/processor_list/changeling_hive_decay.json b/src/main/resources/data/unicopia/worldgen/processor_list/changeling_hive_decay.json new file mode 100644 index 00000000..63441ea5 --- /dev/null +++ b/src/main/resources/data/unicopia/worldgen/processor_list/changeling_hive_decay.json @@ -0,0 +1,22 @@ +[ + { + "processor_type": "minecraft:rule", + "rules": [ + { + "location_predicate": { + "predicate_type": "always_true" + }, + "input_predicate": { + "predicate_type": "random_block_match", + "block": "unicopia:chitin", + "probability": 0.2 + }, + "output_state": { + "name": "unicopia:hive", + "Name": "unicopia:hive", + "properties": [] + } + } + ] + } +] \ No newline at end of file diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/chamber_decors.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/chamber_decors.json index f067c8fc..a6162bb8 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/chamber_decors.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/chamber_decors.json @@ -15,9 +15,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/chamber_decoration/pillar", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrance_terminations.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrance_terminations.json index ecaa9709..254cee76 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrance_terminations.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrance_terminations.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/termination/blockade1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrances.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrances.json index 7c82dfc5..7d76054a 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrances.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/hidden_entrances.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/chamber1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -15,9 +13,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/chamber1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -26,13 +22,11 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/chamber2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 } ], - "fallback": "unicopia:hidden_entrance_terminations" + "fallback": "unicopia:changeling_hive/hidden_entrance_terminations" } \ No newline at end of file diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/pit_decors.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/pit_decors.json index dd523d2c..c2d1801b 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/pit_decors.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/pit_decors.json @@ -26,9 +26,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/pit_decoration/ruins", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shaft_terminations.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shaft_terminations.json index 257268f5..da8aff64 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shaft_terminations.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shaft_terminations.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/termination/shaft1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shafts.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shafts.json index 47fa6ba7..a35568d3 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shafts.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/shafts.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/shaft1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -15,9 +13,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/shaft2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -26,9 +22,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/shaft_bottom", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 3 @@ -37,9 +31,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/shaft_bottom2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 9 @@ -48,9 +40,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/shaft1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -59,9 +49,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/shaft2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -70,9 +58,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/shaft_bottom", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 3 @@ -81,9 +67,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/shaft_bottom2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 3 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/side_passages.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/side_passages.json index 96bcd1da..ea473791 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/side_passages.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/side_passages.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/offshoot1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -15,9 +13,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/offshoot2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 3 @@ -26,9 +22,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/offshoot_elbow", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -37,9 +31,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/offshoot_elbow2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -48,9 +40,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/chamber1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -59,9 +49,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/offshoot1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -70,9 +58,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/offshoot2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 3 @@ -81,9 +67,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/offshoot3", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -92,9 +76,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/offshoot_elbow", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -103,9 +85,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/offshoot_elbow2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -114,9 +94,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/chamber1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -125,9 +103,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/chamber2", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/start.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/start.json index f7a67754..116ba699 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/start.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/start.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/entrance", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -15,9 +13,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/entrance", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnel_terminations.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnel_terminations.json index d5ec3aee..ce6934a6 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnel_terminations.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnel_terminations.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/termination/tunnel1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -15,9 +13,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/termination/tunnel1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -26,9 +22,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/termination1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -37,9 +31,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/termination/blockade1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnels.json b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnels.json index 9eaedaa5..1c31aa8b 100644 --- a/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnels.json +++ b/src/main/resources/data/unicopia/worldgen/template_pool/changeling_hive/tunnels.json @@ -4,9 +4,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/termination1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -15,9 +13,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/offshoot_transition", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -26,9 +22,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/descent1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -37,9 +31,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/termination1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 @@ -48,9 +40,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/offshoot_transition", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 2 @@ -59,9 +49,7 @@ "element": { "element_type": "minecraft:single_pool_element", "location": "unicopia:changeling_hive/spiked/descent1", - "processors": { - "processors": [] - }, + "processors": "unicopia:changeling_hive_decay", "projection": "rigid" }, "weight": 1 diff --git a/src/main/resources/unicopia.mixin.json b/src/main/resources/unicopia.mixin.json index 06d71429..95738783 100644 --- a/src/main/resources/unicopia.mixin.json +++ b/src/main/resources/unicopia.mixin.json @@ -19,6 +19,7 @@ "MixinDamageSource", "MixinFallLocation", "MixinEntity", + "MixinEntityShapeContext", "MixinFallingBlock", "MixinFallingBlockEntity", "MixinFlowableFluid",