diff --git a/gradle.properties b/gradle.properties index 12e39595..efa6eb90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ fabric_version=0.31.0+1.16 cloth_config_version=4.11.14 modmenu_version=1.14.15 ip_version=1.16-SNAPSHOT -rayon_version=1.2.2 +rayon_version=1.2.3 diff --git a/src/main/java/com/fusionflux/thinkingwithportatos/blocks/TallButton.java b/src/main/java/com/fusionflux/thinkingwithportatos/blocks/TallButton.java new file mode 100644 index 00000000..fa4b24fc --- /dev/null +++ b/src/main/java/com/fusionflux/thinkingwithportatos/blocks/TallButton.java @@ -0,0 +1,15 @@ +package com.fusionflux.thinkingwithportatos.blocks; + +import net.minecraft.block.AbstractBlock; +import net.minecraft.sound.SoundEvent; +import net.minecraft.sound.SoundEvents; + +public class TallButton extends TallButtonVarient{ + public TallButton(AbstractBlock.Settings settings) { + super(false, settings); + } + + protected SoundEvent getClickSound(boolean powered) { + return powered ? SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON : SoundEvents.BLOCK_STONE_BUTTON_CLICK_OFF; + } +} diff --git a/src/main/java/com/fusionflux/thinkingwithportatos/blocks/TallButtonVarient.java b/src/main/java/com/fusionflux/thinkingwithportatos/blocks/TallButtonVarient.java new file mode 100644 index 00000000..97a1f437 --- /dev/null +++ b/src/main/java/com/fusionflux/thinkingwithportatos/blocks/TallButtonVarient.java @@ -0,0 +1,198 @@ +package com.fusionflux.thinkingwithportatos.blocks; + +import net.minecraft.block.*; +import net.minecraft.block.enums.WallMountLocation; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.projectile.PersistentProjectileEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvent; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.state.property.Property; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Random; + +public abstract class TallButtonVarient extends WallMountedBlock { + public static final BooleanProperty POWERED; + protected static final VoxelShape CEILING_X_SHAPE; + protected static final VoxelShape CEILING_Z_SHAPE; + protected static final VoxelShape FLOOR_X_SHAPE; + protected static final VoxelShape FLOOR_Z_SHAPE; + protected static final VoxelShape NORTH_SHAPE; + protected static final VoxelShape SOUTH_SHAPE; + protected static final VoxelShape WEST_SHAPE; + protected static final VoxelShape EAST_SHAPE; + protected static final VoxelShape CEILING_X_PRESSED_SHAPE; + protected static final VoxelShape CEILING_Z_PRESSED_SHAPE; + protected static final VoxelShape FLOOR_X_PRESSED_SHAPE; + protected static final VoxelShape FLOOR_Z_PRESSED_SHAPE; + protected static final VoxelShape NORTH_PRESSED_SHAPE; + protected static final VoxelShape SOUTH_PRESSED_SHAPE; + protected static final VoxelShape WEST_PRESSED_SHAPE; + protected static final VoxelShape EAST_PRESSED_SHAPE; + private final boolean wooden; + + protected TallButtonVarient(boolean wooden, AbstractBlock.Settings settings) { + super(settings); + this.setDefaultState((BlockState)((BlockState)((BlockState)((BlockState)this.stateManager.getDefaultState()).with(FACING, Direction.NORTH)).with(POWERED, false)).with(FACE, WallMountLocation.WALL)); + this.wooden = wooden; + } + + private int getPressTicks() { + return this.wooden ? 30 : 20; + } + + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + Direction direction = (Direction)state.get(FACING); + boolean bl = (Boolean)state.get(POWERED); + switch((WallMountLocation)state.get(FACE)) { + case FLOOR: + if (direction.getAxis() == Direction.Axis.X) { + return bl ? FLOOR_X_PRESSED_SHAPE : FLOOR_X_SHAPE; + } + + return bl ? FLOOR_Z_PRESSED_SHAPE : FLOOR_Z_SHAPE; + case WALL: + switch(direction) { + case EAST: + return bl ? EAST_PRESSED_SHAPE : EAST_SHAPE; + case WEST: + return bl ? WEST_PRESSED_SHAPE : WEST_SHAPE; + case SOUTH: + return bl ? SOUTH_PRESSED_SHAPE : SOUTH_SHAPE; + case NORTH: + default: + return bl ? NORTH_PRESSED_SHAPE : NORTH_SHAPE; + } + case CEILING: + default: + if (direction.getAxis() == Direction.Axis.X) { + return bl ? CEILING_X_PRESSED_SHAPE : CEILING_X_SHAPE; + } else { + return bl ? CEILING_Z_PRESSED_SHAPE : CEILING_Z_SHAPE; + } + } + } + + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + if ((Boolean)state.get(POWERED)) { + return ActionResult.CONSUME; + } else { + this.powerOn(state, world, pos); + this.playClickSound(player, world, pos, true); + return ActionResult.success(world.isClient); + } + } + + public void powerOn(BlockState state, World world, BlockPos pos) { + world.setBlockState(pos, (BlockState)state.with(POWERED, true), 3); + this.updateNeighbors(state, world, pos); + world.getBlockTickScheduler().schedule(pos, this, this.getPressTicks()); + } + + protected void playClickSound(@Nullable PlayerEntity player, WorldAccess world, BlockPos pos, boolean powered) { + world.playSound(powered ? player : null, pos, this.getClickSound(powered), SoundCategory.BLOCKS, 0.3F, powered ? 0.6F : 0.5F); + } + + protected abstract SoundEvent getClickSound(boolean powered); + + public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + if (!moved && !state.isOf(newState.getBlock())) { + if ((Boolean)state.get(POWERED)) { + this.updateNeighbors(state, world, pos); + } + + super.onStateReplaced(state, world, pos, newState, moved); + } + } + + public int getWeakRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) { + return (Boolean)state.get(POWERED) ? 15 : 0; + } + + public int getStrongRedstonePower(BlockState state, BlockView world, BlockPos pos, Direction direction) { + return (Boolean)state.get(POWERED) && getDirection(state) == direction ? 15 : 0; + } + + public boolean emitsRedstonePower(BlockState state) { + return true; + } + + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + if ((Boolean)state.get(POWERED)) { + if (this.wooden) { + this.tryPowerWithProjectiles(state, world, pos); + } else { + world.setBlockState(pos, (BlockState)state.with(POWERED, false), 3); + this.updateNeighbors(state, world, pos); + this.playClickSound((PlayerEntity)null, world, pos, false); + } + + } + } + + public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { + if (!world.isClient && this.wooden && !(Boolean)state.get(POWERED)) { + this.tryPowerWithProjectiles(state, world, pos); + } + } + + private void tryPowerWithProjectiles(BlockState state, World world, BlockPos pos) { + List list = world.getNonSpectatingEntities(PersistentProjectileEntity.class, state.getOutlineShape(world, pos).getBoundingBox().offset(pos)); + boolean bl = !list.isEmpty(); + boolean bl2 = (Boolean)state.get(POWERED); + if (bl != bl2) { + world.setBlockState(pos, (BlockState)state.with(POWERED, bl), 3); + this.updateNeighbors(state, world, pos); + this.playClickSound((PlayerEntity)null, world, pos, bl); + } + + if (bl) { + world.getBlockTickScheduler().schedule(new BlockPos(pos), this, this.getPressTicks()); + } + + } + + private void updateNeighbors(BlockState state, World world, BlockPos pos) { + world.updateNeighborsAlways(pos, this); + world.updateNeighborsAlways(pos.offset(getDirection(state).getOpposite()), this); + } + + protected void appendProperties(StateManager.Builder builder) { + builder.add(new Property[]{FACING, POWERED, FACE}); + } + + static { + POWERED = Properties.POWERED; + CEILING_X_SHAPE = Block.createCuboidShape(5.5D, 1.0D, 5.5D, 10.5D, 16.0D, 10.5D); + CEILING_Z_SHAPE = Block.createCuboidShape(5.5D, 1.0D, 5.5D, 10.5D, 16.0D, 10.5D); + FLOOR_X_SHAPE = Block.createCuboidShape(5.5D, 0.0D, 5.5D, 10.5D, 15.0D, 10.5D); + FLOOR_Z_SHAPE = Block.createCuboidShape(5.5D, 0.0D, 5.5D, 10.5D, 15.0D, 10.5D); + NORTH_SHAPE = Block.createCuboidShape(5.5D, 5.5D, 1.0D, 10.5D, 10.5D, 16.0D); + SOUTH_SHAPE = Block.createCuboidShape(5.5D, 5.5D, 0.0D, 10.5D, 10.5D, 15.0D); + WEST_SHAPE = Block.createCuboidShape(1.0D, 5.5D, 5.5D, 16.0D, 10.5D, 10.5D); + EAST_SHAPE = Block.createCuboidShape(0.0D, 5.5D, 5.5D, 15.0D, 10.5D, 10.5D); + CEILING_X_PRESSED_SHAPE = Block.createCuboidShape(5.5D, 1.0D, 5.5D, 10.5D, 16.0D, 10.5D); + CEILING_Z_PRESSED_SHAPE = Block.createCuboidShape(5.5D, 1.0D, 5.5D, 10.5D, 16.0D, 10.5D); + FLOOR_X_PRESSED_SHAPE = Block.createCuboidShape(5.5D, 0.0D, 5.5D, 10.5D, 15.0D, 10.5D); + FLOOR_Z_PRESSED_SHAPE = Block.createCuboidShape(5.5D, 0.0D, 5.5D, 10.5D, 15.0D, 10.5D); + NORTH_PRESSED_SHAPE = Block.createCuboidShape(5.5D, 5.5D, 1.0D, 10.5D, 10.5D, 16.0D); + SOUTH_PRESSED_SHAPE = Block.createCuboidShape(5.5D, 5.5D, 0.0D, 10.5D, 10.5D, 15.0D); + WEST_PRESSED_SHAPE = Block.createCuboidShape(1.0D, 5.5D, 5.5D, 16.0D, 10.5D, 10.5D); + EAST_PRESSED_SHAPE = Block.createCuboidShape(0.0D, 5.5D, 5.5D, 15.0D, 10.5D, 10.5D); + } +} diff --git a/src/main/java/com/fusionflux/thinkingwithportatos/blocks/ThinkingWithPortatosBlocks.java b/src/main/java/com/fusionflux/thinkingwithportatos/blocks/ThinkingWithPortatosBlocks.java index 62e11683..f2cd87cc 100644 --- a/src/main/java/com/fusionflux/thinkingwithportatos/blocks/ThinkingWithPortatosBlocks.java +++ b/src/main/java/com/fusionflux/thinkingwithportatos/blocks/ThinkingWithPortatosBlocks.java @@ -67,6 +67,9 @@ public class ThinkingWithPortatosBlocks { public static final ExcursionFunnel EXCURSION_FUNNEL = new ExcursionFunnel(FabricBlockSettings.of(Material.AIR).nonOpaque().noCollision()); public static final LightBlock LIGHT_CUBE = new LightBlock(FabricBlockSettings.of(Material.AIR).luminance(15).noCollision().air().hardness(3.5f)); + public static final TallButton TALL_BUTTON = new TallButton(FabricBlockSettings.of(Material.METAL).hardness(3.5f)); + + public static BlockEntityType HLB_EMITTER_ENTITY; public static BlockEntityType HLB_BLOCK_ENTITY; public static BlockEntityType NEUROTOXIN_BLOCK_ENTITY; @@ -169,6 +172,11 @@ public static void registerBlocks() { FLOWING_ACID = Registry.register(Registry.FLUID, id("flowing_acid"), new AcidFluid.Flowing()); ACID_BUCKET = Registry.register(Registry.ITEM, id("acid_bucket"), new BucketItem(STILL_ACID, new Item.Settings().recipeRemainder(Items.BUCKET).maxCount(1).group(ThinkingWithPortatos.ThinkingWithPortatosGroup))); ACID = Registry.register(Registry.BLOCK, id("acid"), new CustomFluidBlock(STILL_ACID, FabricBlockSettings.copy(Blocks.WATER)){}); + + Registry.register(Registry.BLOCK, id("tall_button"), TALL_BUTTON); + Registry.register(Registry.ITEM, id("tall_button"), new BlockItem(TALL_BUTTON, new Item.Settings().group(ThinkingWithPortatos.ThinkingWithPortatosGroup))); + + } } diff --git a/src/main/java/com/fusionflux/thinkingwithportatos/mixin/EntityMixin.java b/src/main/java/com/fusionflux/thinkingwithportatos/mixin/EntityMixin.java index 31eb086e..55b34388 100644 --- a/src/main/java/com/fusionflux/thinkingwithportatos/mixin/EntityMixin.java +++ b/src/main/java/com/fusionflux/thinkingwithportatos/mixin/EntityMixin.java @@ -199,11 +199,11 @@ public void tick(CallbackInfo ci) { Vec3d direction = new Vec3d(0, 0, 0); if (this.verticalCollision) { if (state.get(RepulsionGel.UP)) { - direction = direction.add(0, -1, 0); + direction = direction.add(0, -2, 0); } if (state.get(RepulsionGel.DOWN)) { - direction = direction.add(0, 1, 0); + direction = direction.add(0, 2, 0); } } @@ -223,7 +223,7 @@ public void tick(CallbackInfo ci) { if (state.get(RepulsionGel.WEST)) { direction = direction.add(1, 0, 0); } - direction = direction.add(0, 0.45, 0); + direction = direction.add(0, 0.5, 0); } if (!this.isSneaking() && !direction.equals(new Vec3d(0, 0, 0))) { if (world.isClient && (Object) this instanceof PlayerEntity) { @@ -231,6 +231,7 @@ public void tick(CallbackInfo ci) { } else { world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), ThinkingWithPortatosSounds.GEL_BOUNCE_EVENT, SoundCategory.BLOCKS, .3F, 1F); } + this.setVelocity(this.getVelocity().multiply(1.4)); this.setVelocity(this.getVelocity().add(direction.x, direction.y, direction.z)); } } else if (world.getBlockState(new BlockPos(this.getBlockPos().getX(), this.getBlockPos().getY() + 1, this.getBlockPos().getZ())).getBlock() == ThinkingWithPortatosBlocks.REPULSION_GEL) { diff --git a/src/main/resources/assets/thinkingwithportatos/blockstates/tall_button.json b/src/main/resources/assets/thinkingwithportatos/blockstates/tall_button.json new file mode 100644 index 00000000..b39b8a7c --- /dev/null +++ b/src/main/resources/assets/thinkingwithportatos/blockstates/tall_button.json @@ -0,0 +1,110 @@ +{ + "variants": { + "face=ceiling,facing=east,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": 270, + "x": 180 + }, + "face=ceiling,facing=east,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": 270, + "x": 180 + }, + "face=ceiling,facing=north,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": 180, + "x": 180 + }, + "face=ceiling,facing=north,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": 180, + "x": 180 + }, + "face=ceiling,facing=south,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "x": 180 + }, + "face=ceiling,facing=south,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "x": 180 + }, + "face=ceiling,facing=west,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": 90, + "x": 180 + }, + "face=ceiling,facing=west,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": 90, + "x": 180 + }, + "face=floor,facing=east,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": 90 + }, + "face=floor,facing=east,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": 90 + }, + "face=floor,facing=north,powered=false": { + "model": "thinkingwithportatos:block/tall_button" + }, + "face=floor,facing=north,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed" + }, + "face=floor,facing=south,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": 180 + }, + "face=floor,facing=south,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": 180 + }, + "face=floor,facing=west,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": 270 + }, + "face=floor,facing=west,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": 270 + }, + "face=wall,facing=east,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": -90, + "x": -90 + }, + "face=wall,facing=east,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": -90, + "x": -90 + }, + "face=wall,facing=north,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": -180, + "x": -90 + }, + "face=wall,facing=north,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": -180, + "x": -90 + }, + "face=wall,facing=south,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "x": -90 + }, + "face=wall,facing=south,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "x": -90 + }, + "face=wall,facing=west,powered=false": { + "model": "thinkingwithportatos:block/tall_button", + "y": -270, + "x": -90 + }, + "face=wall,facing=west,powered=true": { + "model": "thinkingwithportatos:block/tall_button_pressed", + "y": -270, + "x": -90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/thinkingwithportatos/models/block/tall_button.json b/src/main/resources/assets/thinkingwithportatos/models/block/tall_button.json new file mode 100644 index 00000000..6cb34e63 --- /dev/null +++ b/src/main/resources/assets/thinkingwithportatos/models/block/tall_button.json @@ -0,0 +1,142 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "thinkingwithportatos:block/tall_button", + "particle": "thinkingwithportatos:block/tall_button" + }, + "elements": [ + { + "from": [5.6, 11.36396, 2.55789], + "to": [10.4, 13.26396, 7.05789], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [11, 7.5, 13.5, 8.5], "texture": "#0"}, + "east": {"uv": [9, 11, 11.5, 12], "texture": "#0"}, + "south": {"uv": [11, 9, 13.5, 10], "texture": "#0"}, + "west": {"uv": [11, 6, 13.5, 7], "texture": "#0"}, + "up": {"uv": [11.5, 2.5, 9, 0], "rotation": 270, "texture": "#0"}, + "down": {"uv": [11.5, 3, 9, 5.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6.5, 12.46396, 3.25789], + "to": [9.5, 14.08896, 6.25789], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [11, 12.5, 12.5, 13.5], "texture": "#0"}, + "east": {"uv": [13, 12.5, 14.5, 13.5], "texture": "#0"}, + "south": {"uv": [0, 14, 1.5, 15], "texture": "#0"}, + "west": {"uv": [9, 12.5, 10.5, 13.5], "texture": "#0"}, + "up": {"uv": [13.5, 1.5, 12, 0], "rotation": 270, "texture": "#0"}, + "down": {"uv": [13.5, 2, 12, 3.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [5.5, 1, 5.5], + "to": [10.5, 13, 10.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [3, 0, 5.5, 6.5], "texture": "#0"}, + "east": {"uv": [6, 0, 8.5, 6.5], "texture": "#0"}, + "south": {"uv": [0, 7, 2.5, 13.5], "texture": "#0"}, + "west": {"uv": [0, 0, 2.5, 6.5], "texture": "#0"}, + "up": {"uv": [5.5, 13.5, 3, 11], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.5, 11, 6, 13.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [4.5, -0.025, 4.5], + "to": [11.5, 1, 11.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [12, 5, 15.5, 5.5], "texture": "#0"}, + "east": {"uv": [12, 10.5, 15.5, 11], "texture": "#0"}, + "south": {"uv": [12, 11.5, 15.5, 12], "texture": "#0"}, + "west": {"uv": [12, 4, 15.5, 4.5], "texture": "#0"}, + "up": {"uv": [6.5, 10.5, 3, 7], "rotation": 270, "texture": "#0"}, + "down": {"uv": [10.5, 7, 7, 10.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [12.39734, 2.017, 7], + "to": [13.79734, 2.517, 9], + "rotation": {"angle": -22.5, "axis": "z", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [14, 9.5, 14.5, 10], "texture": "#0"}, + "east": {"uv": [14, 0, 15, 0.5], "texture": "#0"}, + "south": {"uv": [12.5, 14, 13, 14.5], "texture": "#0"}, + "west": {"uv": [9, 6, 10, 6.5], "texture": "#0"}, + "up": {"uv": [15, 1.5, 14, 1], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 14, 2, 14.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2.32096, 1.98328, 7], + "to": [3.72096, 2.48328, 9], + "rotation": {"angle": 22.5, "axis": "z", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [13.5, 14, 14, 14.5], "texture": "#0"}, + "east": {"uv": [14, 3, 15, 3.5], "texture": "#0"}, + "south": {"uv": [14.5, 14, 15, 14.5], "texture": "#0"}, + "west": {"uv": [14, 2, 15, 2.5], "texture": "#0"}, + "up": {"uv": [4.5, 14.5, 3.5, 14], "rotation": 270, "texture": "#0"}, + "down": {"uv": [6, 14, 5, 14.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 1.96396, 12.28289], + "to": [9, 2.46396, 13.68289], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [14, 6, 15, 6.5], "texture": "#0"}, + "east": {"uv": [3, 15, 3.5, 15.5], "texture": "#0"}, + "south": {"uv": [6.5, 14, 7.5, 14.5], "texture": "#0"}, + "west": {"uv": [2, 15, 2.5, 15.5], "texture": "#0"}, + "up": {"uv": [14.5, 8, 14, 7], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.5, 14, 8, 15], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 2.03632, 2.20651], + "to": [9, 2.53632, 3.60651], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8.01557, 4.5365, 8.03205]}, + "faces": { + "north": {"uv": [14, 8.5, 15, 9], "texture": "#0"}, + "east": {"uv": [5, 15, 5.5, 15.5], "texture": "#0"}, + "south": {"uv": [9, 14, 10, 14.5], "texture": "#0"}, + "west": {"uv": [4, 15, 4.5, 15.5], "texture": "#0"}, + "up": {"uv": [11, 15, 10.5, 14], "rotation": 270, "texture": "#0"}, + "down": {"uv": [12, 14, 11.5, 15], "rotation": 90, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [68, 45, 0], + "translation": [0, 0.5, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "thirdperson_lefthand": { + "rotation": [68, 45, 0], + "translation": [0, 0.5, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "firstperson_righthand": { + "rotation": [0, -72, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -72, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [29, -45.5, 0], + "translation": [0, 0.5, 0], + "scale": [0.8, 0.8, 0.8] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/thinkingwithportatos/models/block/tall_button_pressed.json b/src/main/resources/assets/thinkingwithportatos/models/block/tall_button_pressed.json new file mode 100644 index 00000000..cec6e3c3 --- /dev/null +++ b/src/main/resources/assets/thinkingwithportatos/models/block/tall_button_pressed.json @@ -0,0 +1,142 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "thinkingwithportatos:block/tall_button", + "particle": "thinkingwithportatos:block/tall_button" + }, + "elements": [ + { + "from": [5.6, 11.36633, 2.54593], + "to": [10.4, 13.26633, 7.04593], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [11, 7.5, 13.5, 8.5], "texture": "#0"}, + "east": {"uv": [9, 11, 11.5, 12], "texture": "#0"}, + "south": {"uv": [11, 9, 13.5, 10], "texture": "#0"}, + "west": {"uv": [11, 6, 13.5, 7], "texture": "#0"}, + "up": {"uv": [11.5, 2.5, 9, 0], "rotation": 270, "texture": "#0"}, + "down": {"uv": [11.5, 3, 9, 5.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6.5, 12.46633, 3.24593], + "to": [9.5, 13.59133, 6.24593], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [11, 12.5, 12.5, 13.5], "texture": "#0"}, + "east": {"uv": [13, 12.5, 14.5, 13.5], "texture": "#0"}, + "south": {"uv": [0, 14, 1.5, 15], "texture": "#0"}, + "west": {"uv": [9, 12.5, 10.5, 13.5], "texture": "#0"}, + "up": {"uv": [13.5, 1.5, 12, 0], "rotation": 270, "texture": "#0"}, + "down": {"uv": [13.5, 2, 12, 3.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [5.5, 1, 5.5], + "to": [10.5, 13, 10.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [3, 0, 5.5, 6.5], "texture": "#0"}, + "east": {"uv": [6, 0, 8.5, 6.5], "texture": "#0"}, + "south": {"uv": [0, 7, 2.5, 13.5], "texture": "#0"}, + "west": {"uv": [0, 0, 2.5, 6.5], "texture": "#0"}, + "up": {"uv": [5.5, 13.5, 3, 11], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.5, 11, 6, 13.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [4.5, -0.025, 4.5], + "to": [11.5, 1, 11.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [12, 5, 15.5, 5.5], "texture": "#0"}, + "east": {"uv": [12, 10.5, 15.5, 11], "texture": "#0"}, + "south": {"uv": [12, 11.5, 15.5, 12], "texture": "#0"}, + "west": {"uv": [12, 4, 15.5, 4.5], "texture": "#0"}, + "up": {"uv": [6.5, 10.5, 3, 7], "rotation": 270, "texture": "#0"}, + "down": {"uv": [10.5, 7, 7, 10.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [12.38629, 2.0148, 7], + "to": [13.78629, 2.5148, 9], + "rotation": {"angle": -22.5, "axis": "z", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [14, 9.5, 14.5, 10], "texture": "#0"}, + "east": {"uv": [14, 0, 15, 0.5], "texture": "#0"}, + "south": {"uv": [12.5, 14, 13, 14.5], "texture": "#0"}, + "west": {"uv": [9, 6, 10, 6.5], "texture": "#0"}, + "up": {"uv": [15, 1.5, 14, 1], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 14, 2, 14.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2.332, 1.98108, 7], + "to": [3.732, 2.48108, 9], + "rotation": {"angle": 22.5, "axis": "z", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [13.5, 14, 14, 14.5], "texture": "#0"}, + "east": {"uv": [14, 3, 15, 3.5], "texture": "#0"}, + "south": {"uv": [14.5, 14, 15, 14.5], "texture": "#0"}, + "west": {"uv": [14, 2, 15, 2.5], "texture": "#0"}, + "up": {"uv": [4.5, 14.5, 3.5, 14], "rotation": 270, "texture": "#0"}, + "down": {"uv": [6, 14, 5, 14.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 1.96633, 12.27093], + "to": [9, 2.46633, 13.67093], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [14, 6, 15, 6.5], "texture": "#0"}, + "east": {"uv": [3, 15, 3.5, 15.5], "texture": "#0"}, + "south": {"uv": [6.5, 14, 7.5, 14.5], "texture": "#0"}, + "west": {"uv": [2, 15, 2.5, 15.5], "texture": "#0"}, + "up": {"uv": [14.5, 8, 14, 7], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.5, 14, 8, 15], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 2.02954, 2.21664], + "to": [9, 2.52954, 3.61664], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8.01557, 4.50763, 8.02009]}, + "faces": { + "north": {"uv": [14, 8.5, 15, 9], "texture": "#0"}, + "east": {"uv": [5, 15, 5.5, 15.5], "texture": "#0"}, + "south": {"uv": [9, 14, 10, 14.5], "texture": "#0"}, + "west": {"uv": [4, 15, 4.5, 15.5], "texture": "#0"}, + "up": {"uv": [11, 15, 10.5, 14], "rotation": 270, "texture": "#0"}, + "down": {"uv": [12, 14, 11.5, 15], "rotation": 90, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [68, 45, 0], + "translation": [0, 0.5, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "thirdperson_lefthand": { + "rotation": [68, 45, 0], + "translation": [0, 0.5, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "firstperson_righthand": { + "rotation": [0, -72, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -72, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [29, -45.5, 0], + "translation": [0, 0.5, 0], + "scale": [0.8, 0.8, 0.8] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/thinkingwithportatos/models/item/tall_button.json b/src/main/resources/assets/thinkingwithportatos/models/item/tall_button.json new file mode 100644 index 00000000..a28fe0a9 --- /dev/null +++ b/src/main/resources/assets/thinkingwithportatos/models/item/tall_button.json @@ -0,0 +1,4 @@ +{ + "parent": "thinkingwithportatos:block/tall_button" + +} \ No newline at end of file diff --git a/src/main/resources/assets/thinkingwithportatos/textures/block/tall_button.png b/src/main/resources/assets/thinkingwithportatos/textures/block/tall_button.png new file mode 100644 index 00000000..617d44df Binary files /dev/null and b/src/main/resources/assets/thinkingwithportatos/textures/block/tall_button.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6f83d0aa..21c8b367 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -47,13 +47,17 @@ { "name": "repulsion_gel", "friction": 1.0, - "restitution": 4, - "collidable": true + "restitution": 4 }, { "name": "propulsion_gel", "friction": 0, "restitution": 1.0 + }, + { + "name": "bridge_test", + "friction": 1.0, + "restitution": 1.0 } ] }