diff --git a/src/main/java/techreborn/TechRebornClient.java b/src/main/java/techreborn/TechRebornClient.java index 21236aa6a..b0a84c3f4 100644 --- a/src/main/java/techreborn/TechRebornClient.java +++ b/src/main/java/techreborn/TechRebornClient.java @@ -47,6 +47,7 @@ import reborncore.client.hud.StackInfoHUD; import reborncore.client.multiblock.MultiblockRenderer; import techreborn.client.render.DynamicBucketBakedModel; import techreborn.client.render.DynamicCellBakedModel; +import techreborn.client.render.entitys.CableCoverEntityRenderer; import techreborn.client.render.entitys.StorageUnitEntityRenderer; import techreborn.events.StackToolTipHandler; import techreborn.init.ModFluids; @@ -156,6 +157,7 @@ public class TechRebornClient implements ClientModInitializer { BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.IMPLOSION_COMPRESSOR, MultiblockRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.GREENHOUSE_CONTROLLER, MultiblockRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.STORAGE_UNIT, StorageUnitEntityRenderer::new); + BlockEntityRendererRegistry.INSTANCE.register(TRBlockEntities.CABLE, CableCoverEntityRenderer::new); } diff --git a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java index 418d1cb2f..115483e1b 100644 --- a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java @@ -29,11 +29,13 @@ import java.util.Collections; import java.util.List; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.client.network.packet.BlockEntityUpdateS2CPacket; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtHelper; import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -42,6 +44,8 @@ import net.minecraft.util.math.Direction; import org.apache.commons.lang3.tuple.Pair; import reborncore.api.IListInfoProvider; import reborncore.api.IToolDrop; +import reborncore.common.network.ClientBoundPackets; +import reborncore.common.network.NetworkManager; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.StringUtils; @@ -63,6 +67,7 @@ public class CableBlockEntity extends BlockEntity private double energy = 0; private TRContent.Cables cableType = null; private ArrayList sendingFace = new ArrayList<>(); + private BlockState cover = null; public CableBlockEntity() { super(TRBlockEntities.CABLE); @@ -103,18 +108,26 @@ public class CableBlockEntity extends BlockEntity @Override public void fromTag(CompoundTag compound) { - super.fromTag(compound); - if (compound.contains("energy")) { - energy = compound.getDouble("energy"); - } - } + super.fromTag(compound); + if (compound.contains("energy")) { + energy = compound.getDouble("energy"); + } + if (compound.contains("cover")) { + cover = NbtHelper.toBlockState(compound.getCompound("cover")); + } else { + cover = null; + } + } @Override public CompoundTag toTag(CompoundTag compound) { - super.toTag(compound); - compound.putDouble("energy", energy); - return compound; - } + super.toTag(compound); + compound.putDouble("energy", energy); + if (cover != null) { + compound.put("cover", NbtHelper.fromBlockState(cover)); + } + return compound; + } @Override public void tick() { @@ -161,11 +174,14 @@ public class CableBlockEntity extends BlockEntity // IListInfoProvider @Override public void addInfo(List info, boolean isReal, boolean hasData) { - info.add(new LiteralText(Formatting.GRAY + StringUtils.t("techreborn.tooltip.transferRate") + ": " + info.add(new LiteralText(Formatting.GRAY + StringUtils.t("techreborn.tooltip.transferRate") + ": " + Formatting.GOLD + PowerSystem.getLocaliszedPowerFormatted(getCableType().transferRate) + "/t")); - info.add(new LiteralText(Formatting.GRAY + StringUtils.t("techreborn.tooltip.tier") + ": " + info.add(new LiteralText(Formatting.GRAY + StringUtils.t("techreborn.tooltip.tier") + ": " + Formatting.GOLD + StringUtils.toFirstCapitalAllLowercase(getCableType().tier.toString()))); + if (!getCableType().canKill) { + info.add(new LiteralText(Formatting.GRAY + StringUtils.t("techreborn.tooltip.cable.can_cover"))); + } } // IToolDrop @@ -232,4 +248,16 @@ public class CableBlockEntity extends BlockEntity public void setStored(double amount) { this.energy = amount; } + + public BlockState getCover() { + return cover; + } + + public void setCover(BlockState cover) { + this.cover = cover; + if (!world.isClient) { + NetworkManager.sendToTracking(ClientBoundPackets.createCustomDescriptionPacket(this), this); + } + } + } diff --git a/src/main/java/techreborn/blocks/cable/CableBlock.java b/src/main/java/techreborn/blocks/cable/CableBlock.java index e25e961c0..9c4cc13e8 100644 --- a/src/main/java/techreborn/blocks/cable/CableBlock.java +++ b/src/main/java/techreborn/blocks/cable/CableBlock.java @@ -24,23 +24,20 @@ package techreborn.blocks.cable; -import net.minecraft.block.Block; -import net.minecraft.block.BlockRenderType; -import net.minecraft.block.BlockState; -import net.minecraft.block.BlockWithEntity; -import net.minecraft.block.Material; -import net.minecraft.block.Waterloggable; +import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityContext; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluid; import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.state.property.AbstractProperty; import net.minecraft.state.property.BooleanProperty; @@ -52,6 +49,7 @@ 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.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.IWorld; import net.minecraft.world.World; @@ -81,6 +79,7 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { public static final BooleanProperty UP = BooleanProperty.of("up"); public static final BooleanProperty DOWN = BooleanProperty.of("down"); public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; + public static final BooleanProperty COVERED = BooleanProperty.of("covered"); public static final Map PROPERTY_MAP = Util.make(new HashMap<>(), map -> { map.put(Direction.EAST, EAST); @@ -98,7 +97,7 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { super(Block.Settings.of(Material.STONE).strength(1f, 8f)); this.type = type; setDefaultState(this.getStateManager().getDefaultState().with(EAST, false).with(WEST, false).with(NORTH, false) - .with(SOUTH, false).with(UP, false).with(DOWN, false).with(WATERLOGGED, false)); + .with(SOUTH, false).with(UP, false).with(DOWN, false).with(WATERLOGGED, false).with(COVERED, false)); BlockWrenchEventHandler.wrenableBlocks.add(this); cableShapeUtil = new CableShapeUtil(this); } @@ -166,16 +165,34 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { } if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) { + if (state.get(COVERED) && !playerIn.isSneaking()) { + ((CableBlockEntity) blockEntity).setCover(null); + worldIn.setBlockState(pos, state.with(COVERED, false)); + worldIn.playSound(playerIn, pos, SoundEvents.BLOCK_WOOD_BREAK, SoundCategory.BLOCKS, 0.6F, 1.0F); + return ActionResult.SUCCESS; + } + if (WrenchUtils.handleWrench(stack, worldIn, pos, playerIn, hitResult.getSide())) { return ActionResult.SUCCESS; } } + + if (!stack.isEmpty() && !state.get(COVERED) && !state.get(WATERLOGGED) && !type.canKill + && stack.getItem() == TRContent.Plates.WOOD.asItem()) { + worldIn.setBlockState(pos, state.with(COVERED, true)); + worldIn.playSound(playerIn, pos, SoundEvents.BLOCK_WOOD_PLACE, SoundCategory.BLOCKS, 0.6F, 1.0F); + if (!worldIn.isClient) { + stack.decrement(1); + } + return ActionResult.SUCCESS; + } + return super.onUse(state, worldIn, pos, playerIn, hand, hitResult); } @Override protected void appendProperties(StateManager.Builder builder) { - builder.add(EAST, WEST, NORTH, SOUTH, UP, DOWN, WATERLOGGED); + builder.add(EAST, WEST, NORTH, SOUTH, UP, DOWN, WATERLOGGED, COVERED); } @Override @@ -196,6 +213,9 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext entityContext) { + if (state.get(COVERED)) { + return VoxelShapes.fullCube(); + } return cableShapeUtil.getShape(state); } @@ -237,6 +257,16 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { } } + @Override + public boolean tryFillWithFluid(IWorld world, BlockPos pos, BlockState state, FluidState fluidState) { + return !state.get(COVERED) && Waterloggable.super.tryFillWithFluid(world, pos, state, fluidState); + } + + @Override + public boolean canFillWithFluid(BlockView view, BlockPos pos, BlockState state, Fluid fluid) { + return !state.get(COVERED) && Waterloggable.super.canFillWithFluid(view, pos, state, fluid); + } + @Override public FluidState getFluidState(BlockState state) { return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); diff --git a/src/main/java/techreborn/client/render/entitys/CableCoverEntityRenderer.java b/src/main/java/techreborn/client/render/entitys/CableCoverEntityRenderer.java new file mode 100644 index 000000000..ff0ca9174 --- /dev/null +++ b/src/main/java/techreborn/client/render/entitys/CableCoverEntityRenderer.java @@ -0,0 +1,39 @@ +package techreborn.client.render.entitys; + +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.client.render.RenderLayers; +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.block.BlockRenderManager; +import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; +import net.minecraft.client.render.block.entity.BlockEntityRenderer; +import net.minecraft.client.util.math.MatrixStack; +import techreborn.blockentity.cable.CableBlockEntity; +import techreborn.blocks.cable.CableBlock; + +import java.util.Random; + +public class CableCoverEntityRenderer extends BlockEntityRenderer { + + public CableCoverEntityRenderer(BlockEntityRenderDispatcher dispatcher) { + super(dispatcher); + } + + @Override + public void render(CableBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { + if (blockEntity.getWorld() == null) { + return; + } + if (!blockEntity.getWorld().getBlockState(blockEntity.getPos()).get(CableBlock.COVERED)) { + return; + } + final BlockRenderManager blockRenderManager = MinecraftClient.getInstance().getBlockRenderManager(); + BlockState blockState = blockEntity.getCover() != null ? blockEntity.getCover() : Blocks.OAK_PLANKS.getDefaultState(); + VertexConsumer consumer = vertexConsumers.getBuffer(RenderLayers.getBlockLayer(blockState)); + blockRenderManager.renderBlock(blockState, blockEntity.getPos(), blockEntity.getWorld(), matrices, consumer, true, new Random()); + } + +} diff --git a/src/main/java/techreborn/events/ModRegistry.java b/src/main/java/techreborn/events/ModRegistry.java index fcbb4a828..2e69ef1ba 100644 --- a/src/main/java/techreborn/events/ModRegistry.java +++ b/src/main/java/techreborn/events/ModRegistry.java @@ -65,6 +65,7 @@ import techreborn.items.armor.ItemQuantumSuit; import techreborn.items.armor.ItemTRArmour; import techreborn.items.battery.*; import techreborn.items.tool.DebugToolItem; +import techreborn.items.tool.PaintingToolItem; import techreborn.items.tool.TreeTapItem; import techreborn.items.tool.WrenchItem; import techreborn.items.tool.advanced.AdvancedChainsawItem; @@ -206,6 +207,7 @@ public class ModRegistry { // Tools RebornRegistry.registerItem(TRContent.TREE_TAP = InitUtils.setup(new TreeTapItem(), "treetap")); RebornRegistry.registerItem(TRContent.WRENCH = InitUtils.setup(new WrenchItem(), "wrench")); + RebornRegistry.registerItem(TRContent.PAINTING_TOOL = InitUtils.setup(new PaintingToolItem(), "painting_tool")); RebornRegistry.registerItem(TRContent.BASIC_DRILL = InitUtils.setup(new BasicDrillItem(), "basic_drill")); RebornRegistry.registerItem(TRContent.BASIC_CHAINSAW = InitUtils.setup(new BasicChainsawItem(), "basic_chainsaw")); diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index 1a1613a4f..bb1a1952c 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -124,6 +124,7 @@ public class TRContent { // Tools public static Item TREE_TAP; public static Item WRENCH; + public static Item PAINTING_TOOL; public static Item BASIC_CHAINSAW; public static Item BASIC_DRILL; diff --git a/src/main/java/techreborn/items/tool/PaintingToolItem.java b/src/main/java/techreborn/items/tool/PaintingToolItem.java new file mode 100644 index 000000000..cb838102e --- /dev/null +++ b/src/main/java/techreborn/items/tool/PaintingToolItem.java @@ -0,0 +1,88 @@ +package techreborn.items.tool; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.nbt.NbtHelper; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.text.Text; +import net.minecraft.text.TranslatableText; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Formatting; +import net.minecraft.world.World; +import techreborn.TechReborn; +import techreborn.blockentity.cable.CableBlockEntity; +import techreborn.blocks.cable.CableBlock; + +import javax.annotation.Nullable; +import java.util.List; + +public class PaintingToolItem extends Item { + + public PaintingToolItem() { + super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamageIfAbsent(64)); + } + + public ActionResult useOnBlock(ItemUsageContext context) { + PlayerEntity player = context.getPlayer(); + if (player == null) { + return ActionResult.FAIL; + } + + BlockState blockState = context.getWorld().getBlockState(context.getBlockPos()); + if (player.isSneaking()) { + if (blockState.isSimpleFullBlock(context.getWorld(), context.getBlockPos()) + && blockState.getBlock().getDefaultState().isSimpleFullBlock(context.getWorld(), context.getBlockPos())) { + context.getStack().getOrCreateTag().put("cover", NbtHelper.fromBlockState(blockState)); + return ActionResult.SUCCESS; + } + return ActionResult.FAIL; + } else { + BlockState cover = getCover(context.getStack()); + if (cover != null && blockState.getBlock() instanceof CableBlock && blockState.get(CableBlock.COVERED)) { + BlockEntity blockEntity = context.getWorld().getBlockEntity(context.getBlockPos()); + if (blockEntity == null) { + return ActionResult.FAIL; + } + ((CableBlockEntity) blockEntity).setCover(cover); + + context.getWorld().playSound(player, context.getBlockPos(), SoundEvents.BLOCK_WOOL_PLACE, SoundCategory.BLOCKS, 0.6F, 1.0F); + if (!context.getWorld().isClient) { + context.getStack().damage(1, player, playerCb -> { + playerCb.sendToolBreakStatus(context.getHand()); + }); + } + + return ActionResult.SUCCESS; + } + } + + return ActionResult.FAIL; + } + + public static BlockState getCover(ItemStack stack) { + if (stack.hasTag() && stack.getTag().contains("cover")) { + return NbtHelper.toBlockState(stack.getTag().getCompound("cover")); + } + return null; + } + + @Environment(EnvType.CLIENT) + public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { + BlockState blockState = getCover(stack); + if (blockState != null) { + tooltip.add((new TranslatableText(blockState.getBlock().getTranslationKey())).formatted(Formatting.GRAY)); + tooltip.add((new TranslatableText("techreborn.tooltip.painting_tool.apply")).formatted(Formatting.GOLD)); + } else { + tooltip.add((new TranslatableText("techreborn.tooltip.painting_tool.select")).formatted(Formatting.GOLD)); + } + } + +} diff --git a/src/main/resources/assets/techreborn/blockstates/glassfiber_cable.json b/src/main/resources/assets/techreborn/blockstates/glassfiber_cable.json index f1c41e7ed..0b0141775 100644 --- a/src/main/resources/assets/techreborn/blockstates/glassfiber_cable.json +++ b/src/main/resources/assets/techreborn/blockstates/glassfiber_cable.json @@ -1,32 +1,31 @@ { "multipart": [ { - "apply": { - "model": "techreborn:block/cable/glassfiber_cable_core" - } + "when": { "covered": false }, + "apply": { "model": "techreborn:block/cable/glassfiber_cable_core" } }, { - "when": { "north": "true" }, + "when": { "north": true, "covered": false }, "apply": { "model": "techreborn:block/cable/glassfiber_cable_side" } }, { - "when": { "east": "true" }, + "when": { "east": true, "covered": false }, "apply": { "model": "techreborn:block/cable/glassfiber_cable_side", "y": 90 } }, { - "when": { "south": "true" }, + "when": { "south": true, "covered": false }, "apply": { "model": "techreborn:block/cable/glassfiber_cable_side", "y": 180 } }, { - "when": { "west": "true" }, + "when": { "west": true, "covered": false }, "apply": { "model": "techreborn:block/cable/glassfiber_cable_side", "y": 270 } }, { - "when": { "up": "true" }, + "when": { "up": true, "covered": false }, "apply": { "model": "techreborn:block/cable/glassfiber_cable_side", "x": 270} }, { - "when": { "down": "true" }, + "when": { "down": true, "covered": false }, "apply": { "model": "techreborn:block/cable/glassfiber_cable_side", "x": 90 } } ] diff --git a/src/main/resources/assets/techreborn/blockstates/insulated_copper_cable.json b/src/main/resources/assets/techreborn/blockstates/insulated_copper_cable.json index c0faa365b..a010216be 100644 --- a/src/main/resources/assets/techreborn/blockstates/insulated_copper_cable.json +++ b/src/main/resources/assets/techreborn/blockstates/insulated_copper_cable.json @@ -1,30 +1,31 @@ { "multipart": [ { + "when": { "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_core" } }, { - "when": { "north": true }, + "when": { "north": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_side" } }, { - "when": { "east": true }, + "when": { "east": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_side", "y": 90 } }, { - "when": { "south": true }, + "when": { "south": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_side", "y": 180 } }, { - "when": { "west": true }, + "when": { "west": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_side", "y": 270 } }, { - "when": { "up": true }, + "when": { "up": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_side", "x": 270} }, { - "when": { "down": true }, + "when": { "down": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_copper_cable_side", "x": 90 } } ] diff --git a/src/main/resources/assets/techreborn/blockstates/insulated_gold_cable.json b/src/main/resources/assets/techreborn/blockstates/insulated_gold_cable.json index a368481a2..7ef40ff30 100644 --- a/src/main/resources/assets/techreborn/blockstates/insulated_gold_cable.json +++ b/src/main/resources/assets/techreborn/blockstates/insulated_gold_cable.json @@ -1,30 +1,31 @@ { "multipart": [ { + "when": { "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_core" } }, { - "when": { "north": true }, + "when": { "north": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_side" } }, { - "when": { "east": true }, + "when": { "east": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_side", "y": 90 } }, { - "when": { "south": true }, + "when": { "south": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_side", "y": 180 } }, { - "when": { "west": true }, + "when": { "west": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_side", "y": 270 } }, { - "when": { "up": true }, + "when": { "up": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_side", "x": 270} }, { - "when": { "down": true }, + "when": { "down": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_gold_cable_side", "x": 90 } } ] diff --git a/src/main/resources/assets/techreborn/blockstates/insulated_hv_cable.json b/src/main/resources/assets/techreborn/blockstates/insulated_hv_cable.json index d6d6de2fa..093d95630 100644 --- a/src/main/resources/assets/techreborn/blockstates/insulated_hv_cable.json +++ b/src/main/resources/assets/techreborn/blockstates/insulated_hv_cable.json @@ -1,30 +1,31 @@ { "multipart": [ { + "when": { "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_core" } }, { - "when": { "north": true }, + "when": { "north": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_side" } }, { - "when": { "east": true }, + "when": { "east": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_side", "y": 90 } }, { - "when": { "south": true }, + "when": { "south": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_side", "y": 180 } }, { - "when": { "west": true }, + "when": { "west": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_side", "y": 270 } }, { - "when": { "up": true }, + "when": { "up": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_side", "x": 270} }, { - "when": { "down": true }, + "when": { "down": true, "covered": false }, "apply": { "model": "techreborn:block/cable/insulated_hv_cable_side", "x": 90 } } ] diff --git a/src/main/resources/assets/techreborn/blockstates/superconductor_cable.json b/src/main/resources/assets/techreborn/blockstates/superconductor_cable.json index 58931ff6d..3750351b7 100644 --- a/src/main/resources/assets/techreborn/blockstates/superconductor_cable.json +++ b/src/main/resources/assets/techreborn/blockstates/superconductor_cable.json @@ -1,30 +1,31 @@ { "multipart": [ { + "when": { "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_core" } }, { - "when": { "north": true }, + "when": { "north": true, "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_side" } }, { - "when": { "east": true }, + "when": { "east": true, "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_side", "y": 90 } }, { - "when": { "south": true }, + "when": { "south": true, "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_side", "y": 180 } }, { - "when": { "west": true }, + "when": { "west": true, "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_side", "y": 270 } }, { - "when": { "up": true }, + "when": { "up": true, "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_side", "x": 270} }, { - "when": { "down": true }, + "when": { "down": true, "covered": false }, "apply": { "model": "techreborn:block/cable/superconductor_cable_side", "x": 90 } } ] diff --git a/src/main/resources/assets/techreborn/lang/en_us.json b/src/main/resources/assets/techreborn/lang/en_us.json index 921ab6e88..f551d4c64 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.json +++ b/src/main/resources/assets/techreborn/lang/en_us.json @@ -547,6 +547,7 @@ "item.techreborn.treetap": "Treetap", "item.techreborn.wrench": "Wrench", "item.techreborn.destructopack": "Destructopack", + "item.techreborn.painting_tool": "Painting Tool", "_comment17": "Items-Misc", "item.techreborn.cell": "Empty Cell", @@ -726,6 +727,9 @@ "techreborn.tooltip.unit.capacity": "Capacity: ", "techreborn.tooltip.unit.empty": "Empty", "techreborn.tooltip.unit.divider": " of ", + "techreborn.tooltip.painting_tool.select": "Shift right click on block to set style", + "techreborn.tooltip.painting_tool.apply": "Right click on covered cable to apply", + "techreborn.tooltip.cable.can_cover": "Can be covered with wooden plates", "_comment23": "ManualUI", "techreborn.manual.wiki": "Online wiki", diff --git a/src/main/resources/assets/techreborn/models/item/painting_tool.json b/src/main/resources/assets/techreborn/models/item/painting_tool.json new file mode 100644 index 000000000..fa9d0a67f --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/painting_tool.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "techreborn:item/tool/painting_tool" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/textures/item/tool/painting_tool.png b/src/main/resources/assets/techreborn/textures/item/tool/painting_tool.png new file mode 100644 index 000000000..ea7b8e836 Binary files /dev/null and b/src/main/resources/assets/techreborn/textures/item/tool/painting_tool.png differ diff --git a/src/main/resources/data/techreborn/recipes/crafting_table/tool/painting_tool.json b/src/main/resources/data/techreborn/recipes/crafting_table/tool/painting_tool.json new file mode 100644 index 000000000..0112d7b1c --- /dev/null +++ b/src/main/resources/data/techreborn/recipes/crafting_table/tool/painting_tool.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BWB", + "NBN", + " B " + ], + "key": { + "B": { + "item": "techreborn:bronze_ingot" + }, + "N": { + "item": "techreborn:bronze_nugget" + }, + "W": { + "tag": "minecraft:wool" + } + }, + "result": { + "item": "techreborn:painting_tool" + } +} \ No newline at end of file