mirror of
https://github.com/TeamMidnightDust/Decorative.git
synced 2025-12-15 12:35:10 +01:00
1.15.2 Backport
This commit is contained in:
@@ -27,7 +27,7 @@ dependencies {
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
modCompile("vazkii.patchouli:Patchouli_1.16-fabric:${project.patchouli_version}")
|
||||
modCompile("vazkii.patchouli:Patchouli_1.15-fabric:${project.patchouli_version}")
|
||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||
// You may need to force-disable transitiveness on them.
|
||||
}
|
||||
|
||||
@@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.16.1
|
||||
yarn_mappings=1.16.1+build.7
|
||||
loader_version=0.8.8+build.202
|
||||
minecraft_version=1.15.2
|
||||
yarn_mappings=1.15.2+build.17
|
||||
loader_version=0.8.9+build.203
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.0
|
||||
mod_version = 1.0.0-1.15
|
||||
maven_group = eu.midnightdust.motschen
|
||||
archives_base_name = decorative
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.14.0+build.371-1.16
|
||||
patchouli_version=1.16-37.21-FABRIC
|
||||
fabric_version=0.14.0+build.317-1.15
|
||||
patchouli_version=1.15.2-1.2-35-FABRIC
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
@@ -14,7 +15,7 @@ public class BirdBath extends CauldronBlock {
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public BirdBath() {
|
||||
super(FabricBlockSettings.copy(Blocks.CAULDRON).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.CAULDRON).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(LEVEL, 0));
|
||||
}
|
||||
|
||||
@@ -30,7 +31,7 @@ public class BirdBath extends CauldronBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
static {
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -21,7 +22,7 @@ public class CeilingFan extends RedstoneLampBlock {
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public CeilingFan() {
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, true));
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ public class CeilingFan extends RedstoneLampBlock {
|
||||
builder.add(LIT);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
static {
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -29,7 +30,7 @@ public class ChristmasLights extends HorizontalFacingBlock {
|
||||
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
|
||||
|
||||
public ChristmasLights() {
|
||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(LIT, Boolean.FALSE));
|
||||
}
|
||||
|
||||
@@ -52,7 +53,7 @@ public class ChristmasLights extends HorizontalFacingBlock {
|
||||
builder.add(LIT);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
@@ -12,11 +13,11 @@ public class ChristmasTree extends Block{
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public ChristmasTree() {
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
static {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import blue.endless.jankson.annotation.Nullable;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.enums.DoubleBlockHalf;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.state.StateManager;
|
||||
@@ -23,7 +22,6 @@ 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 net.minecraft.world.WorldView;
|
||||
|
||||
public class DoubleLamp extends RedstoneLampBlock {
|
||||
@@ -34,7 +32,7 @@ public class DoubleLamp extends RedstoneLampBlock {
|
||||
public static final EnumProperty<DoubleBlockHalf> HALF = Properties.DOUBLE_BLOCK_HALF;
|
||||
|
||||
public DoubleLamp() {
|
||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, false).with(HALF, DoubleBlockHalf.LOWER));
|
||||
}
|
||||
|
||||
@@ -45,7 +43,6 @@ public class DoubleLamp extends RedstoneLampBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public BlockState getPlacementState(ItemPlacementContext arg) {
|
||||
return this.getDefaultState().with(LIT, arg.getWorld().isReceivingRedstonePower(arg.getBlockPos()));
|
||||
}
|
||||
@@ -54,36 +51,30 @@ public class DoubleLamp extends RedstoneLampBlock {
|
||||
public void onPlaced(World arg, BlockPos arg2, BlockState arg3, LivingEntity arg4, ItemStack arg5) {
|
||||
arg.setBlockState(arg2.up(), arg3.with(HALF, DoubleBlockHalf.UPPER), 3);
|
||||
}
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState arg, Direction arg2, BlockState arg3, WorldAccess arg4, BlockPos arg5, BlockPos arg6) {
|
||||
DoubleBlockHalf lv = arg.get(HALF);
|
||||
if (arg2.getAxis() == Direction.Axis.Y && lv == DoubleBlockHalf.LOWER == (arg2 == Direction.UP)) {
|
||||
if (arg3.isOf(this) && arg3.get(HALF) != lv) {
|
||||
return (arg.with(LIT, arg3.get(LIT)));
|
||||
}
|
||||
return Blocks.AIR.getDefaultState();
|
||||
}
|
||||
if (lv == DoubleBlockHalf.LOWER && arg2 == Direction.DOWN && !arg.canPlaceAt(arg4, arg5)) {
|
||||
return Blocks.AIR.getDefaultState();
|
||||
}
|
||||
return super.getStateForNeighborUpdate(arg, arg2, arg3, arg4, arg5, arg6);
|
||||
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos neighborPos, boolean moved) {
|
||||
boolean bl = world.isReceivingRedstonePower(pos) || world.isReceivingRedstonePower(pos.offset(state.get(HALF) == DoubleBlockHalf.LOWER ? Direction.UP : Direction.DOWN));
|
||||
if (block != this && bl != state.get(LIT)) {
|
||||
world.setBlockState(pos, state.with(LIT, bl), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState arg, WorldView arg2, BlockPos arg3) {
|
||||
BlockPos lv = arg3.down();
|
||||
BlockState lv2 = arg2.getBlockState(lv);
|
||||
if (arg.get(HALF) == DoubleBlockHalf.LOWER) {
|
||||
return lv2.isSideSolidFullSquare(arg2, lv, Direction.UP);
|
||||
}
|
||||
return lv2.isOf(this);
|
||||
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
BlockPos blockPos = pos.down();
|
||||
BlockState blockState = world.getBlockState(blockPos);
|
||||
if (state.get(HALF) == DoubleBlockHalf.LOWER) {
|
||||
return blockState.isSideSolidFullSquare(world, blockPos, Direction.UP);
|
||||
} else {
|
||||
return blockState.getBlock() == this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> arg) {
|
||||
arg.add(LIT);
|
||||
arg.add(HALF);
|
||||
}
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext context) {
|
||||
boolean bl = state.get(HALF) == DoubleBlockHalf.UPPER;
|
||||
return bl ? SHAPE_TOP : SHAPE_BOTTOM;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -28,7 +29,7 @@ public class FireHydrant extends HorizontalFacingBlock {
|
||||
private static final VoxelShape WEST_SHAPE;
|
||||
|
||||
public FireHydrant() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
@@ -68,7 +69,7 @@ public class FireHydrant extends HorizontalFacingBlock {
|
||||
builder.add(FACING);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -28,7 +29,7 @@ public class Guardrail extends HorizontalFacingBlock {
|
||||
private static final VoxelShape WEST_SHAPE;
|
||||
|
||||
public Guardrail() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
@@ -68,7 +69,7 @@ public class Guardrail extends HorizontalFacingBlock {
|
||||
builder.add(FACING);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
@@ -18,7 +19,7 @@ public class Lamp extends RedstoneLampBlock {
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public Lamp() {
|
||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque());
|
||||
}
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
|
||||
@@ -26,7 +27,7 @@ public class Lamp extends RedstoneLampBlock {
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
static {
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.world.WorldView;
|
||||
public class LogWithAxe extends HorizontalFacingBlock {
|
||||
|
||||
public LogWithAxe() {
|
||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||
import eu.midnightdust.motschen.decorative.Program;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -31,7 +32,7 @@ public class OldTelevision extends HorizontalFacingBlock {
|
||||
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
|
||||
|
||||
public OldTelevision() {
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ public class OldTelevision extends HorizontalFacingBlock {
|
||||
builder.add(PROGRAM);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.world.WorldView;
|
||||
public class RotatableBlock extends HorizontalFacingBlock {
|
||||
|
||||
public RotatableBlock() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
@@ -30,4 +30,8 @@ public class RotatableBlock extends HorizontalFacingBlock {
|
||||
builder.add(FACING);
|
||||
}
|
||||
|
||||
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
|
||||
return !worldView.isAir(pos.down());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -28,7 +29,7 @@ public class Sign extends HorizontalFacingBlock {
|
||||
private static final VoxelShape WEST_SHAPE;
|
||||
|
||||
public Sign() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
|
||||
@@ -43,7 +44,7 @@ public class Sign extends HorizontalFacingBlock {
|
||||
builder.add(FACING);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -4,8 +4,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
@@ -15,11 +14,11 @@ public class SignPost extends Block {
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public SignPost() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
static {
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.enums.DoorHinge;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -31,7 +32,7 @@ public class SlidingDoor extends DoorBlock {
|
||||
private static final VoxelShape WEST_SHAPE_OPEN;
|
||||
|
||||
public SlidingDoor() {
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||
}
|
||||
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
@@ -41,7 +42,7 @@ public class SlidingDoor extends DoorBlock {
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext context) {
|
||||
state.get(FACING);
|
||||
boolean bl = !state.get(OPEN);
|
||||
boolean bl2 = state.get(HINGE) == DoorHinge.RIGHT;
|
||||
|
||||
@@ -4,6 +4,7 @@ import eu.midnightdust.motschen.decorative.DecorativeMain;
|
||||
import eu.midnightdust.motschen.decorative.Program;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
@@ -31,7 +32,7 @@ public class Television extends HorizontalFacingBlock {
|
||||
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
|
||||
|
||||
public Television() {
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ public class Television extends HorizontalFacingBlock {
|
||||
builder.add(PROGRAM);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -25,11 +26,11 @@ public class TrafficCone extends Block {
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
public TrafficCone() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
static {
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.midnightdust.motschen.decorative.block;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.entity.BannerBlockEntity;
|
||||
import net.minecraft.entity.EntityContext;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.WaterFluid;
|
||||
import net.minecraft.item.*;
|
||||
@@ -33,7 +34,7 @@ public class WaterPump extends HorizontalFacingBlock {
|
||||
private static final VoxelShape WEST_SHAPE;
|
||||
|
||||
public WaterPump() {
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
|
||||
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque());
|
||||
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
|
||||
}
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
@@ -73,7 +74,7 @@ public class WaterPump extends HorizontalFacingBlock {
|
||||
builder.add(FACING);
|
||||
}
|
||||
@Override
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
|
||||
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
|
||||
switch (state.get(FACING)) {
|
||||
case NORTH: return NORTH_SHAPE;
|
||||
case EAST: return EAST_SHAPE;
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 80 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_eighty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 50 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_fifty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 5 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_five_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 40 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_forty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 90 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_ninety_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 100 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_onehundred_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 110 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_onehundredten_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,18 +9,6 @@
|
||||
"title": "Straße",
|
||||
"link_recipe": false,
|
||||
"text": "Eine Straße ist ideal, um darauf zu fahren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_short_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_short_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Straße mit langem weißem Streifen",
|
||||
"link_recipe": false,
|
||||
"text": "Eine Straße mit einem langem weißem Streifen in der Mitte."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_long_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Straße mit kurzem weißem Streifen",
|
||||
"link_recipe": false,
|
||||
"text": "Eine Straße mit einem kurzem weißem Streifen in der Mitte."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_short_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,18 +9,6 @@
|
||||
"title": "Steiniger Asphalt",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um Straßen herzustellen. Kann in der Welt gefunden werden."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_white_short_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_white_long_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 70 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_seventy_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 60 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_sixty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Stoppschild",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um den Verkehr zu beschränken."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_stop_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 10 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_ten_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 30 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_thirty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 20 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Wird benutzt, um die Geschwindigkeit von Autos zu regulieren."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_twenty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 80 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_eighty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 50 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_fifty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 5 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_five_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 40 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_forty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 90 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_ninety_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 100 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_onehundred_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 110 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_onehundredten_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,18 +9,6 @@
|
||||
"title": "Road",
|
||||
"link_recipe": false,
|
||||
"text": "A road is a surface ideal for driving on it."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_short_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_short_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Road with long white stripe",
|
||||
"link_recipe": false,
|
||||
"text": "A road with a long white stripe in the middle."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_long_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Road with short white stripe",
|
||||
"link_recipe": false,
|
||||
"text": "A road with a short white stripe in the middle."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:road_to_road_white_short_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,18 +9,6 @@
|
||||
"title": "Rocky Asphalt",
|
||||
"link_recipe": false,
|
||||
"text": "Used to craft Roads."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_white_short_stonecutting"
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:rocky_asphalt_to_road_white_long_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 70 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_seventy_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 60 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_sixty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Stop Sign",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating traffic."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_stop_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 10 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_ten_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 30 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_thirty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,10 +9,6 @@
|
||||
"title": "Speed Limit: 20 km/h",
|
||||
"link_recipe": false,
|
||||
"text": "Used for regulating speed of cars."
|
||||
},
|
||||
{
|
||||
"type": "stonecutting",
|
||||
"recipe": "decorative:empty_sign_to_twenty_sign_stonecutting"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user