From ad829cfea39e1bfe4e483fdea2ffd658f7049b56 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 28 Jan 2020 14:41:05 +0100 Subject: [PATCH] Scrollable Pulse Repeaters - Kinetic blocks can now be harvested by axes and pickaxes - Shafts have less obnoxious placement behaviour - Fixed belts not dropping casings and shafts when broken - Fixed belt tunnels not synchronizing properly - Fixed blockzapper rendering strangely when no block is selected - Funnels can now directly insert items that players activate it with - Flexpeater -> Adjustable Repeater - Added the Adjustable Pulse Repeater --- .../java/com/simibubi/create/AllBlocks.java | 1 + .../com/simibubi/create/AllTileEntities.java | 2 + .../modules/contraptions/CasingBlock.java | 19 ++- .../modules/contraptions/WrenchItem.java | 2 + .../contraptions/base/KineticBlock.java | 21 +++ .../base/RotatedPillarKineticBlock.java | 6 +- .../contraptions/relays/belt/BeltBlock.java | 43 ++++-- .../relays/belt/BeltInventory.java | 14 +- .../relays/belt/BeltTunnelTileEntity.java | 1 + .../blockzapper/BlockzapperHandler.java | 139 ++++++++---------- .../logistics/block/belts/FunnelBlock.java | 21 +++ .../diodes/FlexPulsepeaterTileEntity.java | 50 +++++++ .../block/diodes/FlexpeaterBlock.java | 3 +- .../block/diodes/FlexpeaterTileEntity.java | 7 +- .../assets/create/blockstates/flexpeater.json | 32 ++-- .../blockstates/flexpeater_indicator.json | 2 +- .../create/blockstates/flexpulsepeater.json | 24 +++ .../resources/assets/create/lang/en_us.json | 3 +- .../models/block/repeaters/flexpeater.json | 37 +++++ .../{ => repeaters}/flexpeater_indicator.json | 0 .../{ => repeaters}/flexpeater_powered.json | 2 +- .../flexpeater_powered_powering.json | 6 + .../{ => repeaters}/flexpeater_powering.json | 2 +- .../flexpulsepeater.json} | 4 +- .../repeaters/flexpulsepeater_powered.json | 7 + .../flexpulsepeater_powered_powering.json | 6 + .../flexpulsepeater_powering.json} | 2 +- .../assets/create/models/item/flexpeater.json | 2 +- .../create/models/item/flexpulsepeater.json | 13 ++ .../create/textures/block/flexpeater_item.png | Bin 527 -> 524 bytes .../create/textures/block/flexpeater_off.png | Bin 526 -> 527 bytes .../create/textures/block/flexpeater_on.png | Bin 529 -> 541 bytes .../textures/block/flexpulsepeater_item.png | Bin 0 -> 527 bytes .../textures/block/flexpulsepeater_off.png | Bin 0 -> 526 bytes .../textures/block/flexpulsepeater_on.png | Bin 0 -> 529 bytes .../loot_tables/blocks/flexpulsepeater.json | 19 +++ .../crafting_shaped/flexpulsepeater.json | 24 +++ 37 files changed, 389 insertions(+), 125 deletions(-) create mode 100644 src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexPulsepeaterTileEntity.java create mode 100644 src/main/resources/assets/create/blockstates/flexpulsepeater.json create mode 100644 src/main/resources/assets/create/models/block/repeaters/flexpeater.json rename src/main/resources/assets/create/models/block/{ => repeaters}/flexpeater_indicator.json (100%) rename src/main/resources/assets/create/models/block/{ => repeaters}/flexpeater_powered.json (72%) create mode 100644 src/main/resources/assets/create/models/block/repeaters/flexpeater_powered_powering.json rename src/main/resources/assets/create/models/block/{ => repeaters}/flexpeater_powering.json (59%) rename src/main/resources/assets/create/models/block/{flexpeater.json => repeaters/flexpulsepeater.json} (95%) create mode 100644 src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered.json create mode 100644 src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered_powering.json rename src/main/resources/assets/create/models/block/{flexpeater_powered_powering.json => repeaters/flexpulsepeater_powering.json} (57%) create mode 100644 src/main/resources/assets/create/models/item/flexpulsepeater.json create mode 100644 src/main/resources/assets/create/textures/block/flexpulsepeater_item.png create mode 100644 src/main/resources/assets/create/textures/block/flexpulsepeater_off.png create mode 100644 src/main/resources/assets/create/textures/block/flexpulsepeater_on.png create mode 100644 src/main/resources/data/create/loot_tables/blocks/flexpulsepeater.json create mode 100644 src/main/resources/data/create/recipes/crafting_shaped/flexpulsepeater.json diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 93f01409c..4812b071a 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -189,6 +189,7 @@ public enum AllBlocks { ENTITY_DETECTOR(new BeltObserverBlock()), PULSE_REPEATER(new PulseRepeaterBlock()), FLEXPEATER(new FlexpeaterBlock()), + FLEXPULSEPEATER(new FlexpeaterBlock()), FLEXPEATER_INDICATOR(new RenderUtilityBlock()), __CURIOSITIES__(), diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index da7718014..0c320be7d 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -56,6 +56,7 @@ import com.simibubi.create.modules.logistics.block.StockswitchTileEntity; import com.simibubi.create.modules.logistics.block.belts.BeltObserverTileEntity; import com.simibubi.create.modules.logistics.block.belts.BeltObserverTileEntityRenderer; import com.simibubi.create.modules.logistics.block.belts.FunnelTileEntity; +import com.simibubi.create.modules.logistics.block.diodes.FlexPulsepeaterTileEntity; import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterTileEntity; import com.simibubi.create.modules.logistics.block.diodes.FlexpeaterTileEntityRenderer; import com.simibubi.create.modules.logistics.block.extractor.ExtractorTileEntity; @@ -129,6 +130,7 @@ public enum AllTileEntities { BELT_FUNNEL(FunnelTileEntity::new, AllBlocks.BELT_FUNNEL, AllBlocks.VERTICAL_FUNNEL), ENTITY_DETECTOR(BeltObserverTileEntity::new, AllBlocks.ENTITY_DETECTOR), FLEXPEATER(FlexpeaterTileEntity::new, AllBlocks.FLEXPEATER), + FLEXPULSEPEATER(FlexPulsepeaterTileEntity::new, AllBlocks.FLEXPULSEPEATER), // Curiosities WINDOW_IN_A_BLOCK(WindowInABlockTileEntity::new, AllBlocks.WINDOW_IN_A_BLOCK), diff --git a/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java index 4ea575723..a67ba3f12 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/CasingBlock.java @@ -9,6 +9,9 @@ import com.simibubi.create.foundation.block.connected.StandardCTBehaviour; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockReader; import net.minecraftforge.common.ToolType; public class CasingBlock extends Block implements IHaveConnectedTextures { @@ -20,9 +23,23 @@ public class CasingBlock extends Block implements IHaveConnectedTextures { this.textureFrom = textureFrom; } + @Override + public ToolType getHarvestTool(BlockState state) { + return null; + } + + @Override + public boolean canHarvestBlock(BlockState state, IBlockReader world, BlockPos pos, PlayerEntity player) { + for (ToolType toolType : player.getHeldItemMainhand().getToolTypes()) { + if (isToolEffective(state, toolType)) + return true; + } + return super.canHarvestBlock(state, world, pos, player); + } + @Override public boolean isToolEffective(BlockState state, ToolType tool) { - return tool == ToolType.PICKAXE || tool == ToolType.AXE; + return tool == ToolType.AXE || tool == ToolType.PICKAXE; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java b/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java index cc6b5cdcf..bfc9c3af5 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/WrenchItem.java @@ -4,6 +4,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.util.ActionResultType; import net.minecraft.util.math.BlockPos; @@ -35,6 +36,7 @@ public class WrenchItem extends Item { Block.getDrops(state, (ServerWorld) world, pos, world.getTileEntity(pos)).forEach(itemStack -> { player.inventory.placeItemBackInInventory(world, itemStack); }); + state.spawnAdditionalDrops(world, pos, ItemStack.EMPTY); world.destroyBlock(pos, false); } return ActionResultType.SUCCESS; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java index 328887f35..400317c28 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java @@ -7,6 +7,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.material.PushReaction; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; @@ -16,6 +17,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; +import net.minecraftforge.common.ToolType; public abstract class KineticBlock extends Block implements IRotate { @@ -24,6 +26,25 @@ public abstract class KineticBlock extends Block implements IRotate { public KineticBlock(Properties properties) { super(properties); } + + @Override + public ToolType getHarvestTool(BlockState state) { + return null; + } + + @Override + public boolean canHarvestBlock(BlockState state, IBlockReader world, BlockPos pos, PlayerEntity player) { + for (ToolType toolType : player.getHeldItemMainhand().getToolTypes()) { + if (isToolEffective(state, toolType)) + return true; + } + return super.canHarvestBlock(state, world, pos, player); + } + + @Override + public boolean isToolEffective(BlockState state, ToolType tool) { + return tool == ToolType.AXE || tool == ToolType.PICKAXE; + } // IRotate diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java index 5e420c879..ad6663eb2 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/RotatedPillarKineticBlock.java @@ -66,7 +66,11 @@ public abstract class RotatedPillarKineticBlock extends KineticBlock { @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - return this.getDefaultState().with(AXIS, context.getFace().getAxis()); + Axis preferredAxis = getPreferredAxis(context); + if (preferredAxis != null) + return this.getDefaultState().with(AXIS, preferredAxis); + return this.getDefaultState().with(AXIS, context.isPlacerSneaking() ? context.getFace().getAxis() + : context.getNearestLookingDirection().getAxis()); } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java index 58e53ba7d..7c5a8c26e 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java @@ -86,6 +86,31 @@ public class BeltBlock extends HorizontalKineticBlock implements IHaveNoBlockIte return state.get(CASING) ? Material.WOOD : Material.WOOL; } + @SuppressWarnings("deprecation") + @Override + public List getDrops(BlockState state, net.minecraft.world.storage.loot.LootContext.Builder builder) { + List drops = super.getDrops(state, builder); + if (state.get(CASING)) + drops.addAll(AllBlocks.BRASS_CASING.getDefault() + .getDrops(builder)); + return drops; + } + + @Override + public void spawnAdditionalDrops(BlockState state, World worldIn, BlockPos pos, ItemStack stack) { + withTileEntityDo(worldIn, pos, te -> { + if (worldIn.isRemote) + return; + if (te.hasPulley()) + Block.spawnDrops(AllBlocks.SHAFT.get().getDefaultState(), worldIn, pos); + if (te.isController()) { + BeltInventory inv = te.getInventory(); + for (TransportedItemStack s : inv.items) + inv.eject(s); + } + }); + } + @Override public boolean isFlammable(BlockState state, IBlockReader world, BlockPos pos, Direction face) { return false; @@ -304,22 +329,6 @@ public class BeltBlock extends HorizontalKineticBlock implements IHaveNoBlockIte return state.get(CASING) && layer == getRenderLayer(); } - @Override - public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) { - withTileEntityDo(worldIn, pos, te -> { - if (worldIn.isRemote) - return; - if (te.hasPulley() && (player == null || !player.isCreative())) - Block.spawnDrops(AllBlocks.SHAFT.get().getDefaultState(), worldIn, pos); - if (te.isController()) { - BeltInventory inv = te.getInventory(); - for (TransportedItemStack stack : inv.items) - inv.eject(stack); - } - }); - super.onBlockHarvested(worldIn, pos, state, player); - } - @Override public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (worldIn.isRemote) @@ -361,6 +370,8 @@ public class BeltBlock extends HorizontalKineticBlock implements IHaveNoBlockIte te.setSource(null); te.remove(); + if (destroyedBlock.get(CASING)) + Block.spawnAsEntity(worldIn, toDestroy, new ItemStack(AllBlocks.BRASS_CASING.get())); if (te.hasPulley()) worldIn.setBlockState(toDestroy, AllBlocks.SHAFT.get().getDefaultState() .with(BlockStateProperties.AXIS, getRotationAxis(destroyedBlock)), 3); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltInventory.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltInventory.java index abaefb46f..ccc47d1db 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltInventory.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltInventory.java @@ -145,7 +145,7 @@ public class BeltInventory { } // Belt tunnels - if (!onClient) { + { int seg1 = (int) current.beltPosition; int seg2 = (int) nextOffset; if (!beltMovementPositive && nextOffset == 0) @@ -154,8 +154,10 @@ public class BeltInventory { if (stuckAtTunnel(seg2, current.stack, movementFacing)) { continue; } - flapTunnel(seg1, movementFacing, false); - flapTunnel(seg2, movementFacing.getOpposite(), true); + if (!onClient) { + flapTunnel(seg1, movementFacing, false); + flapTunnel(seg2, movementFacing.getOpposite(), true); + } } } @@ -263,10 +265,8 @@ public class BeltInventory { if (te == null || !(te instanceof BeltTunnelTileEntity)) return false; - Direction flapFacing = movementDirection; - if (flapFacing.getAxis() == Axis.X) - flapFacing = flapFacing.getOpposite(); - + Direction flapFacing = movementDirection.getOpposite(); + BeltTunnelTileEntity tunnel = (BeltTunnelTileEntity) te; if (!tunnel.flaps.containsKey(flapFacing)) return false; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTunnelTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTunnelTileEntity.java index d9d2efa6e..4cc980ca4 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltTunnelTileEntity.java @@ -102,6 +102,7 @@ public class BeltTunnelTileEntity extends SyncedTileEntity implements ITickableT syncedFlaps.remove(face); else syncedFlaps.put(face, ItemStack.EMPTY); + markDirty(); sendData(); return true; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperHandler.java b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperHandler.java index 37de5cc2d..1c54a4e42 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperHandler.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/blockzapper/BlockzapperHandler.java @@ -21,6 +21,7 @@ import net.minecraft.client.renderer.entity.PlayerRenderer; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.world.ClientWorld; +import net.minecraft.item.ItemStack; import net.minecraft.particles.ParticleTypes; import net.minecraft.util.Hand; import net.minecraft.util.HandSide; @@ -90,20 +91,6 @@ public class BlockzapperHandler { return barrelPos; } -// @SubscribeEvent(priority = EventPriority.HIGHEST) -// public static void onBlockBroken(BreakEvent event) { -// PlayerEntity player = event.getPlayer(); -// if (player == null) -// return; -// if (!AllItems.PLACEMENT_HANDGUN.typeOf(player.getHeldItemMainhand())) -// return; -// -// if (event.getState().isNormalCube(player.world, event.getPos())) { -// player.getHeldItemMainhand().getTag().put("BlockUsed", NBTUtil.writeBlockState(event.getState())); -// } -// event.setCanceled(true); -// } - @SubscribeEvent public static void onClientTick(ClientTickEvent event) { if (event.phase == Phase.START) @@ -185,73 +172,77 @@ public class BlockzapperHandler { @SubscribeEvent public static void onRenderPlayerHand(RenderSpecificHandEvent event) { - if (AllItems.PLACEMENT_HANDGUN.typeOf(event.getItemStack())) { - Minecraft mc = Minecraft.getInstance(); - boolean rightHand = event.getHand() == Hand.MAIN_HAND ^ mc.player.getPrimaryHand() == HandSide.LEFT; + ItemStack heldItem = event.getItemStack(); + if (!AllItems.PLACEMENT_HANDGUN.typeOf(heldItem)) + return; - GlStateManager.pushMatrix(); + boolean idle = !heldItem.getOrCreateTag().contains("BlockUsed"); + Minecraft mc = Minecraft.getInstance(); + boolean rightHand = event.getHand() == Hand.MAIN_HAND ^ mc.player.getPrimaryHand() == HandSide.LEFT; - float recoil = rightHand - ? MathHelper.lerp(event.getPartialTicks(), lastRightHandAnimation, rightHandAnimation) - : MathHelper.lerp(event.getPartialTicks(), lastLeftHandAnimation, leftHandAnimation); + GlStateManager.pushMatrix(); - float equipProgress = event.getEquipProgress(); + float recoil = rightHand ? MathHelper.lerp(event.getPartialTicks(), lastRightHandAnimation, rightHandAnimation) + : MathHelper.lerp(event.getPartialTicks(), lastLeftHandAnimation, leftHandAnimation); - if (rightHand && (rightHandAnimation > .01f || dontReequipRight)) - equipProgress = 0; - if (!rightHand && (leftHandAnimation > .01f || dontReequipLeft)) - equipProgress = 0; + float equipProgress = event.getEquipProgress(); - // Render arm - float f = rightHand ? 1.0F : -1.0F; - float f1 = MathHelper.sqrt(event.getSwingProgress()); - float f2 = -0.3F * MathHelper.sin(f1 * (float) Math.PI); - float f3 = 0.4F * MathHelper.sin(f1 * ((float) Math.PI * 2F)); - float f4 = -0.4F * MathHelper.sin(event.getSwingProgress() * (float) Math.PI); - GlStateManager.translatef(f * (f2 + 0.64000005F - .1f), f3 + -0.4F + equipProgress * -0.6F, - f4 + -0.71999997F + .3f + recoil); - GlStateManager.rotatef(f * 75.0F, 0.0F, 1.0F, 0.0F); - float f5 = MathHelper.sin(event.getSwingProgress() * event.getSwingProgress() * (float) Math.PI); - float f6 = MathHelper.sin(f1 * (float) Math.PI); - GlStateManager.rotatef(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F); - GlStateManager.rotatef(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F); - AbstractClientPlayerEntity abstractclientplayerentity = mc.player; - mc.getTextureManager().bindTexture(abstractclientplayerentity.getLocationSkin()); - GlStateManager.translatef(f * -1.0F, 3.6F, 3.5F); - GlStateManager.rotatef(f * 120.0F, 0.0F, 0.0F, 1.0F); - GlStateManager.rotatef(200.0F, 1.0F, 0.0F, 0.0F); - GlStateManager.rotatef(f * -135.0F, 0.0F, 1.0F, 0.0F); - GlStateManager.translatef(f * 5.6F, 0.0F, 0.0F); - GlStateManager.rotatef(f * 40.0F, 0.0F, 1.0F, 0.0F); - PlayerRenderer playerrenderer = mc.getRenderManager().getRenderer(abstractclientplayerentity); - GlStateManager.disableCull(); - if (rightHand) { - playerrenderer.renderRightArm(abstractclientplayerentity); - } else { - playerrenderer.renderLeftArm(abstractclientplayerentity); - } - GlStateManager.enableCull(); - GlStateManager.popMatrix(); + if (rightHand && (rightHandAnimation > .01f || dontReequipRight)) + equipProgress = 0; + if (!rightHand && (leftHandAnimation > .01f || dontReequipLeft)) + equipProgress = 0; + if (idle) + equipProgress = 1 - event.getEquipProgress(); - // Render gun - GlStateManager.pushMatrix(); - GlStateManager.translatef(f * (f2 + 0.64000005F - .1f), f3 + -0.4F + equipProgress * -0.6F, - f4 + -0.71999997F - 0.1f + recoil); - GlStateManager.rotatef(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F); - GlStateManager.rotatef(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F); - - GlStateManager.translatef(f * -0.1f, 0.1f, -0.4f); - GlStateManager.rotatef(f * 5.0F, 0.0F, 1.0F, 0.0F); - - FirstPersonRenderer firstPersonRenderer = mc.getFirstPersonRenderer(); - firstPersonRenderer.renderItemSide(mc.player, event.getItemStack(), - rightHand ? ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND - : ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, - !rightHand); - GlStateManager.popMatrix(); - - event.setCanceled(true); + // Render arm + float f = rightHand ? 1.0F : -1.0F; + float f1 = MathHelper.sqrt(event.getSwingProgress()); + float f2 = -0.3F * MathHelper.sin(f1 * (float) Math.PI); + float f3 = 0.4F * MathHelper.sin(f1 * ((float) Math.PI * 2F)); + float f4 = -0.4F * MathHelper.sin(event.getSwingProgress() * (float) Math.PI); + GlStateManager.translatef(f * (f2 + 0.64000005F - .1f), f3 + -0.4F + equipProgress * -0.6F, + f4 + -0.71999997F + .3f + recoil); + GlStateManager.rotatef(f * 75.0F, 0.0F, 1.0F, 0.0F); + float f5 = MathHelper.sin(event.getSwingProgress() * event.getSwingProgress() * (float) Math.PI); + float f6 = MathHelper.sin(f1 * (float) Math.PI); + GlStateManager.rotatef(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotatef(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F); + AbstractClientPlayerEntity abstractclientplayerentity = mc.player; + mc.getTextureManager().bindTexture(abstractclientplayerentity.getLocationSkin()); + GlStateManager.translatef(f * -1.0F, 3.6F, 3.5F); + GlStateManager.rotatef(f * 120.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotatef(200.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotatef(f * -135.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.translatef(f * 5.6F, 0.0F, 0.0F); + GlStateManager.rotatef(f * 40.0F, 0.0F, 1.0F, 0.0F); + PlayerRenderer playerrenderer = mc.getRenderManager().getRenderer(abstractclientplayerentity); + GlStateManager.disableCull(); + if (rightHand) { + playerrenderer.renderRightArm(abstractclientplayerentity); + } else { + playerrenderer.renderLeftArm(abstractclientplayerentity); } + GlStateManager.enableCull(); + GlStateManager.popMatrix(); + + // Render gun + GlStateManager.pushMatrix(); + GlStateManager.translatef(f * (f2 + 0.64000005F - .1f), f3 + -0.4F + equipProgress * -0.6F, + f4 + -0.71999997F - 0.1f + recoil); + GlStateManager.rotatef(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotatef(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F); + + GlStateManager.translatef(f * -0.1f, 0.1f, -0.4f); + GlStateManager.rotatef(f * 5.0F, 0.0F, 1.0F, 0.0F); + + FirstPersonRenderer firstPersonRenderer = mc.getFirstPersonRenderer(); + firstPersonRenderer.renderItemSide(mc.player, heldItem, + rightHand ? ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND + : ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND, + !rightHand); + GlStateManager.popMatrix(); + + event.setCanceled(true); } public static void dontAnimateItem(Hand hand) { diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java index 96d4ad170..b82286e5c 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java @@ -16,13 +16,16 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; +import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; @@ -170,6 +173,24 @@ public class FunnelBlock extends AttachedLogisticalBlock implements IBeltAttachm return process(te, transported, state); } + @Override + public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, + BlockRayTraceResult hit) { + + if (hit.getFace() == getBlockFacing(state).getOpposite()) { + if (!worldIn.isRemote) + withTileEntityDo(worldIn, pos, te -> { + ItemStack heldItem = player.getHeldItem(handIn).copy(); + ItemStack remainder = te.tryToInsert(heldItem); + if (!ItemStack.areItemStacksEqual(remainder, heldItem)) + player.setHeldItem(handIn, remainder); + }); + return true; + } + + return false; + } + public boolean process(BeltTileEntity belt, TransportedItemStack transported, BeltAttachmentState state) { TileEntity te = belt.getWorld().getTileEntity(state.attachmentPos); if (te == null || !(te instanceof FunnelTileEntity)) diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexPulsepeaterTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexPulsepeaterTileEntity.java new file mode 100644 index 000000000..863634803 --- /dev/null +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexPulsepeaterTileEntity.java @@ -0,0 +1,50 @@ +package com.simibubi.create.modules.logistics.block.diodes; + +import static com.simibubi.create.modules.logistics.block.diodes.FlexpeaterBlock.POWERING; +import static net.minecraft.block.RedstoneDiodeBlock.POWERED; + +import com.simibubi.create.AllTileEntities; + +public class FlexPulsepeaterTileEntity extends FlexpeaterTileEntity { + + public FlexPulsepeaterTileEntity() { + super(AllTileEntities.FLEXPULSEPEATER.type); + } + + @Override + public void tick() { + updateConfigurableValue(); + + boolean powered = getBlockState().get(POWERED); + boolean powering = getBlockState().get(POWERING); + boolean atMax = state >= maxState; + boolean isReset = state == 0; + + if (!charging && powered && !atMax) + charging = true; + + if (charging && atMax) { + if (powering) { + world.setBlockState(pos, getBlockState().with(POWERING, false)); + charging = false; + return; + } + if (!powering && !world.isRemote) + world.setBlockState(pos, getBlockState().with(POWERING, true)); + return; + } + + if (!charging && powered) + return; + + if (!charging && !isReset) { + if (!world.isRemote) + world.setBlockState(pos, getBlockState().with(POWERING, false)); + state = 0; + return; + } + + state += charging ? 1 : 0; + } + +} diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java index 3fe35e6f4..0373b3bb6 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterBlock.java @@ -1,5 +1,6 @@ package com.simibubi.create.modules.logistics.block.diodes; +import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.IHaveScrollableValue; import com.simibubi.create.foundation.block.IWithTileEntity; import com.simibubi.create.foundation.utility.Lang; @@ -41,7 +42,7 @@ public class FlexpeaterBlock extends RedstoneDiodeBlock @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new FlexpeaterTileEntity(); + return AllBlocks.FLEXPEATER.get() == this ? new FlexpeaterTileEntity() : new FlexPulsepeaterTileEntity(); } @Override diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java index 90dd7c90b..870c61a96 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/FlexpeaterTileEntity.java @@ -9,6 +9,7 @@ import com.simibubi.create.foundation.block.SyncedTileEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.ITickableTileEntity; +import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.MathHelper; public class FlexpeaterTileEntity extends SyncedTileEntity implements ITickableTileEntity { @@ -21,7 +22,11 @@ public class FlexpeaterTileEntity extends SyncedTileEntity implements ITickableT public boolean forceClientState; public FlexpeaterTileEntity() { - super(AllTileEntities.FLEXPEATER.type); + this(AllTileEntities.FLEXPEATER.type); + } + + protected FlexpeaterTileEntity(TileEntityType type) { + super(type); lastModified = -1; maxState = newMaxState = 1; } diff --git a/src/main/resources/assets/create/blockstates/flexpeater.json b/src/main/resources/assets/create/blockstates/flexpeater.json index 0de56e0eb..c81feb60b 100644 --- a/src/main/resources/assets/create/blockstates/flexpeater.json +++ b/src/main/resources/assets/create/blockstates/flexpeater.json @@ -1,24 +1,24 @@ { "forge_marker": 1, "variants": { - "powered=false,powering=false,facing=north": { "model": "create:block/flexpeater", "y": 180 }, - "powered=false,powering=false,facing=east": { "model": "create:block/flexpeater", "y": 270 }, - "powered=false,powering=false,facing=south": { "model": "create:block/flexpeater", "y": 0 }, - "powered=false,powering=false,facing=west": { "model": "create:block/flexpeater", "y": 90 }, + "powered=false,powering=false,facing=north": { "model": "create:block/repeaters/flexpeater", "y": 180 }, + "powered=false,powering=false,facing=east": { "model": "create:block/repeaters/flexpeater", "y": 270 }, + "powered=false,powering=false,facing=south": { "model": "create:block/repeaters/flexpeater", "y": 0 }, + "powered=false,powering=false,facing=west": { "model": "create:block/repeaters/flexpeater", "y": 90 }, - "powered=true,powering=false,facing=north": { "model": "create:block/flexpeater_powered", "y": 180 }, - "powered=true,powering=false,facing=east": { "model": "create:block/flexpeater_powered", "y": 270 }, - "powered=true,powering=false,facing=south": { "model": "create:block/flexpeater_powered", "y": 0 }, - "powered=true,powering=false,facing=west": { "model": "create:block/flexpeater_powered", "y": 90 }, + "powered=true,powering=false,facing=north": { "model": "create:block/repeaters/flexpeater_powered", "y": 180 }, + "powered=true,powering=false,facing=east": { "model": "create:block/repeaters/flexpeater_powered", "y": 270 }, + "powered=true,powering=false,facing=south": { "model": "create:block/repeaters/flexpeater_powered", "y": 0 }, + "powered=true,powering=false,facing=west": { "model": "create:block/repeaters/flexpeater_powered", "y": 90 }, - "powered=false,powering=true,facing=north": { "model": "create:block/flexpeater_powering", "y": 180 }, - "powered=false,powering=true,facing=east": { "model": "create:block/flexpeater_powering", "y": 270 }, - "powered=false,powering=true,facing=south": { "model": "create:block/flexpeater_powering", "y": 0 }, - "powered=false,powering=true,facing=west": { "model": "create:block/flexpeater_powering", "y": 90 }, + "powered=false,powering=true,facing=north": { "model": "create:block/repeaters/flexpeater_powering", "y": 180 }, + "powered=false,powering=true,facing=east": { "model": "create:block/repeaters/flexpeater_powering", "y": 270 }, + "powered=false,powering=true,facing=south": { "model": "create:block/repeaters/flexpeater_powering", "y": 0 }, + "powered=false,powering=true,facing=west": { "model": "create:block/repeaters/flexpeater_powering", "y": 90 }, - "powered=true,powering=true,facing=north": { "model": "create:block/flexpeater_powered_powering", "y": 180 }, - "powered=true,powering=true,facing=east": { "model": "create:block/flexpeater_powered_powering", "y": 270 }, - "powered=true,powering=true,facing=south": { "model": "create:block/flexpeater_powered_powering", "y": 0 }, - "powered=true,powering=true,facing=west": { "model": "create:block/flexpeater_powered_powering", "y": 90 } + "powered=true,powering=true,facing=north": { "model": "create:block/repeaters/flexpeater_powered_powering", "y": 180 }, + "powered=true,powering=true,facing=east": { "model": "create:block/repeaters/flexpeater_powered_powering", "y": 270 }, + "powered=true,powering=true,facing=south": { "model": "create:block/repeaters/flexpeater_powered_powering", "y": 0 }, + "powered=true,powering=true,facing=west": { "model": "create:block/repeaters/flexpeater_powered_powering", "y": 90 } } } \ No newline at end of file diff --git a/src/main/resources/assets/create/blockstates/flexpeater_indicator.json b/src/main/resources/assets/create/blockstates/flexpeater_indicator.json index d20d877af..f32d4ce7f 100644 --- a/src/main/resources/assets/create/blockstates/flexpeater_indicator.json +++ b/src/main/resources/assets/create/blockstates/flexpeater_indicator.json @@ -1,5 +1,5 @@ { "variants": { - "": { "model": "create:block/flexpeater_indicator" } + "": { "model": "create:block/repeaters/flexpeater_indicator" } } } diff --git a/src/main/resources/assets/create/blockstates/flexpulsepeater.json b/src/main/resources/assets/create/blockstates/flexpulsepeater.json new file mode 100644 index 000000000..7344fa21b --- /dev/null +++ b/src/main/resources/assets/create/blockstates/flexpulsepeater.json @@ -0,0 +1,24 @@ +{ + "forge_marker": 1, + "variants": { + "powered=false,powering=false,facing=north": { "model": "create:block/repeaters/flexpulsepeater", "y": 180 }, + "powered=false,powering=false,facing=east": { "model": "create:block/repeaters/flexpulsepeater", "y": 270 }, + "powered=false,powering=false,facing=south": { "model": "create:block/repeaters/flexpulsepeater", "y": 0 }, + "powered=false,powering=false,facing=west": { "model": "create:block/repeaters/flexpulsepeater", "y": 90 }, + + "powered=true,powering=false,facing=north": { "model": "create:block/repeaters/flexpulsepeater_powered", "y": 180 }, + "powered=true,powering=false,facing=east": { "model": "create:block/repeaters/flexpulsepeater_powered", "y": 270 }, + "powered=true,powering=false,facing=south": { "model": "create:block/repeaters/flexpulsepeater_powered", "y": 0 }, + "powered=true,powering=false,facing=west": { "model": "create:block/repeaters/flexpulsepeater_powered", "y": 90 }, + + "powered=false,powering=true,facing=north": { "model": "create:block/repeaters/flexpulsepeater_powering", "y": 180 }, + "powered=false,powering=true,facing=east": { "model": "create:block/repeaters/flexpulsepeater_powering", "y": 270 }, + "powered=false,powering=true,facing=south": { "model": "create:block/repeaters/flexpulsepeater_powering", "y": 0 }, + "powered=false,powering=true,facing=west": { "model": "create:block/repeaters/flexpulsepeater_powering", "y": 90 }, + + "powered=true,powering=true,facing=north": { "model": "create:block/repeaters/flexpulsepeater_powered_powering", "y": 180 }, + "powered=true,powering=true,facing=east": { "model": "create:block/repeaters/flexpulsepeater_powered_powering", "y": 270 }, + "powered=true,powering=true,facing=south": { "model": "create:block/repeaters/flexpulsepeater_powered_powering", "y": 0 }, + "powered=true,powering=true,facing=west": { "model": "create:block/repeaters/flexpulsepeater_powered_powering", "y": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index f165f081f..d828418b8 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -122,7 +122,8 @@ "block.create.transposer": "Transposer", "block.create.linked_transposer": "Linked Transposer", "block.create.pulse_repeater": "Pulse Repeater", - "block.create.flexpeater": "FlexPeater", + "block.create.flexpulsepeater": "Adjustable Pulse Repeater", + "block.create.flexpeater": "Adjustable Repeater", "block.create.entity_detector": "Belt Observer", "block.create.logistical_casing": "Logistical Casing", "block.create.logistical_controller": "Logistical Controller", diff --git a/src/main/resources/assets/create/models/block/repeaters/flexpeater.json b/src/main/resources/assets/create/models/block/repeaters/flexpeater.json new file mode 100644 index 000000000..6e9b73073 --- /dev/null +++ b/src/main/resources/assets/create/models/block/repeaters/flexpeater.json @@ -0,0 +1,37 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", + "parent": "block/block", + "textures": { + "flexpeater_off": "create:block/flexpeater_off", + "torch": "minecraft:block/redstone_torch_off", + "smooth_stone": "minecraft:block/smooth_stone", + "particle": "create:block/flexpeater_off" + }, + "elements": [ + { + "name": "Top", + "from": [ 5, 2.1, 5 ], + "to": [ 11, 3.1, 11 ], + "faces": { + "north": { "texture": "#flexpeater_off", "uv": [ 5, 5, 11, 6 ], "rotation": 180 }, + "east": { "texture": "#flexpeater_off", "uv": [ 10, 5, 11, 11 ], "rotation": 90 }, + "south": { "texture": "#flexpeater_off", "uv": [ 5, 10, 11, 11 ] }, + "west": { "texture": "#flexpeater_off", "uv": [ 5, 11, 6, 5 ], "rotation": 90 }, + "up": { "texture": "#flexpeater_off", "uv": [ 5, 5, 11, 11 ] } + } + }, + { + "name": "circuit", + "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "north": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "east": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "south": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "west": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 2 ] }, + "up": { "texture": "#flexpeater_off", "uv": [ 0, 0, 16, 16 ] }, + "down": { "texture": "#smooth_stone", "uv": [ 0, 0, 16, 16 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_indicator.json b/src/main/resources/assets/create/models/block/repeaters/flexpeater_indicator.json similarity index 100% rename from src/main/resources/assets/create/models/block/flexpeater_indicator.json rename to src/main/resources/assets/create/models/block/repeaters/flexpeater_indicator.json diff --git a/src/main/resources/assets/create/models/block/flexpeater_powered.json b/src/main/resources/assets/create/models/block/repeaters/flexpeater_powered.json similarity index 72% rename from src/main/resources/assets/create/models/block/flexpeater_powered.json rename to src/main/resources/assets/create/models/block/repeaters/flexpeater_powered.json index c596d6b53..47ed33237 100644 --- a/src/main/resources/assets/create/models/block/flexpeater_powered.json +++ b/src/main/resources/assets/create/models/block/repeaters/flexpeater_powered.json @@ -1,5 +1,5 @@ { - "parent": "create:block/flexpeater", + "parent": "create:block/repeaters/flexpeater", "textures": { "flexpeater_off": "create:block/flexpeater_on", "particle": "create:block/flexpeater_on" diff --git a/src/main/resources/assets/create/models/block/repeaters/flexpeater_powered_powering.json b/src/main/resources/assets/create/models/block/repeaters/flexpeater_powered_powering.json new file mode 100644 index 000000000..1d0b26f6f --- /dev/null +++ b/src/main/resources/assets/create/models/block/repeaters/flexpeater_powered_powering.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/repeaters/flexpeater_powered", + "textures": { + "torch": "minecraft:block/redstone_torch" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_powering.json b/src/main/resources/assets/create/models/block/repeaters/flexpeater_powering.json similarity index 59% rename from src/main/resources/assets/create/models/block/flexpeater_powering.json rename to src/main/resources/assets/create/models/block/repeaters/flexpeater_powering.json index 6e25e1146..013b2b3af 100644 --- a/src/main/resources/assets/create/models/block/flexpeater_powering.json +++ b/src/main/resources/assets/create/models/block/repeaters/flexpeater_powering.json @@ -1,5 +1,5 @@ { - "parent": "create:block/flexpeater", + "parent": "create:block/repeaters/flexpeater", "textures": { "torch": "minecraft:block/redstone_torch" } diff --git a/src/main/resources/assets/create/models/block/flexpeater.json b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater.json similarity index 95% rename from src/main/resources/assets/create/models/block/flexpeater.json rename to src/main/resources/assets/create/models/block/repeaters/flexpulsepeater.json index ed5ceebcd..fa9dfe787 100644 --- a/src/main/resources/assets/create/models/block/flexpeater.json +++ b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater.json @@ -2,10 +2,10 @@ "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", "parent": "block/block", "textures": { - "flexpeater_off": "create:block/flexpeater_off", + "flexpeater_off": "create:block/flexpulsepeater_off", "torch": "minecraft:block/redstone_torch_off", "smooth_stone": "minecraft:block/smooth_stone", - "particle": "create:block/flexpeater_off" + "particle": "create:block/flexpulsepeater_off" }, "elements": [ { diff --git a/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered.json b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered.json new file mode 100644 index 000000000..c0633f132 --- /dev/null +++ b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered.json @@ -0,0 +1,7 @@ +{ + "parent": "create:block/repeaters/flexpulsepeater", + "textures": { + "flexpeater_off": "create:block/flexpulsepeater_on", + "particle": "create:block/flexpulsepeater_on" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered_powering.json b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered_powering.json new file mode 100644 index 000000000..5a5f3876b --- /dev/null +++ b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powered_powering.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/repeaters/flexpulsepeater_powered", + "textures": { + "torch": "minecraft:block/redstone_torch" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/flexpeater_powered_powering.json b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powering.json similarity index 57% rename from src/main/resources/assets/create/models/block/flexpeater_powered_powering.json rename to src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powering.json index f9b173278..60d4ab99b 100644 --- a/src/main/resources/assets/create/models/block/flexpeater_powered_powering.json +++ b/src/main/resources/assets/create/models/block/repeaters/flexpulsepeater_powering.json @@ -1,5 +1,5 @@ { - "parent": "create:block/flexpeater_powered", + "parent": "create:block/repeaters/flexpulsepeater", "textures": { "torch": "minecraft:block/redstone_torch" } diff --git a/src/main/resources/assets/create/models/item/flexpeater.json b/src/main/resources/assets/create/models/item/flexpeater.json index 2aa1fe598..165f7eb72 100644 --- a/src/main/resources/assets/create/models/item/flexpeater.json +++ b/src/main/resources/assets/create/models/item/flexpeater.json @@ -1,5 +1,5 @@ { - "parent": "create:block/flexpeater", + "parent": "create:block/repeaters/flexpeater", "textures": { "flexpeater_off": "create:block/flexpeater_item" }, diff --git a/src/main/resources/assets/create/models/item/flexpulsepeater.json b/src/main/resources/assets/create/models/item/flexpulsepeater.json new file mode 100644 index 000000000..a566c00e1 --- /dev/null +++ b/src/main/resources/assets/create/models/item/flexpulsepeater.json @@ -0,0 +1,13 @@ +{ + "parent": "create:block/repeaters/flexpulsepeater", + "textures": { + "flexpeater_off": "create:block/flexpulsepeater_item" + }, + "display": { + "fixed": { + "rotation": [ 270, 0, 0 ], + "translation": [ 0, 0, -3], + "scale":[ 0.5, 0.5, 0.5 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/flexpeater_item.png b/src/main/resources/assets/create/textures/block/flexpeater_item.png index c7725b0d4c0b421caac0a9956426eacb4df81bdf..ccb7edcb43e4a3b243db6ebdeac2a0b1a3a7b040 100644 GIT binary patch delta 461 zcmV;;0W$uN1dIfbNq@fp01m$aI0aKA0004@NklS~?L(=8 zQqT1oYU&WI1EiMfX!m+o@_xO)*?i)StnD3dI#Si9zF5deYRZ8bWIw(?-{cV8O2l_( zbN_qfiGcJ{L4OCxe&oVji~6&v;EnZ-WO6^V7=!eT8dRXapev=mdTjw>6vWFKkOdVm z$_cv{PcVa!fXPTN6hlBGK?M#{ft`4hA9pb5_j~-5GK9nsNZS!T>w%^KY%o)8ih|ZL z!CaAEhK^80(gPkVWdZp2#lz`zO9mN0zk{@7AK74ephm`7k#B@o&mZT>9r6G@1N(x7 z685@u3W+`4-tfIZ(!HoLqgJm8!e~IMuXYlezO}4>!E*Y3hQiVr00000NkvXXu0mjf DH&@;m delta 464 zcmV;>0WbcH1djxeNq@iq01m(bYSxJf0004`NklgEUPk)k$z^i<&Sh)ruej1JZrn$trZ#vi<>6v-d35LxOey00000WbcJ1djxeNq@iq01m(bYSxJf0004`Nkl*q}mO-#+A71H=elUl3dQ5 zIrrW(Gn+X$Ja8Px`i~$81X2=aRFLJrytGWt<#X*;yRla*SbvFcWzt-^IFq2~_q-R+ zrW%C$v-b)6YR9AMXFHLUoG;|bX2L>w0rlh4BgO0cLx*xw`2(KiRm)X%GzB;z6T3UR z0%~`@hhkHpS!#THwHK+o zO%)5XgE)B)BYz2KuL-6=_oEGaESC(vgeS%)N~L)$p`$%V9ZtZXToG@bmVknRWVuB) zoIo&6>|CM98AJm5p}9~30Y-)sSZD%w67@d<-|u!i{46UYl8ivMv*xUe0CV5ibq^n; z0Fs5-qP-5CWs2GZ>c@2f^4KeUM9$?PE zeZfMBJ=)rUBpyyr_+B7!FEx=lzdRQrFrew9PSP;Dj`IuGbOFhTKss{(00002&7$`wh{#4rx6JSDRre%{u!CZe$P9Km+^AmdFS4H zuFsdt=S0#+oyBVMw z6bgrokRf-q_gbr1>?_~!_9m&4LastjkT#uGhXxq1_ATq7Bu<0@q|QnvbB>h*d&9GL$b zS3E%P!2bmc#m8|y5JBQz)P%46SQbQJK&G!dS%tne&3{KT|4ZhZdz}CP002ovPDHLk FV1kYb+RXp} diff --git a/src/main/resources/assets/create/textures/block/flexpeater_on.png b/src/main/resources/assets/create/textures/block/flexpeater_on.png index 2d6d50c091fe2629bced15e3c793d3a688eed207..672bf23e697b1d550fa2066041e843d2211ff276 100644 GIT binary patch delta 478 zcmV<40U`d81f2wsNq@iq01m(bYSxJf00059NklzP0W!q{WLW=?sH{vP@!TJN*N~@wpw31e>gCHePFnmDZNcouX(eLx>;AQ4= z=FYkIocqn#;)%Gf>)JF7!w_H~g!l-#<4mVt-qM{>Pld%Gasn_L$IW zwn~+foo*29POC$;I2g{dA2hpA$!?FEtQ7nKKkWQVo@OHvE9&~=j1z!aDMbPinW!3S z&Q79CG!C>|#3mYApRfA~ByxYvN`DYIL!>-xZmsiYQTRXf|tz#M-WszV9 zIiJyJxX6QR$$#rv?GHykZBq!07X{S-!E$Avca8cz!OjJz&$o^xc#LP&i30w_6;Z91 z1xO%B7PrtQ3IuXeUGsR^L5hHGTOB9?0V5Ly9z=mNF}uG;v)O3WxirltMKT1j?NGaJ z0MvP7H<-8=29PY6SB#gX9jM57Kr)pSK+fIe0BYQ{0#^;7zJpkb>_ot9*7>R)oE-5} zyq%xz?(H*M>d*jc2hNMCqE6ZTNYq2=%Kze{$N)VK9(Mnn+5(+}YayXFSqfJ?$G3Vi(I`|*CaFKcZ_rP^oB9)H`hy;yWNI%Bm#e}Jam ztot|(3WkD#U_kcD&*iH^;bY17cz%}95<=h!Sd415Y8XcGz9^PBtPbEuZ8lYUxI3}N)~`JoTBg3fVU0{JeXTZTGFo|M!38)C zm`*3FECOrc(0`^qnSPs=2q-Td)ByzIitsK6ruIm%f5jh(Y-0%><#{ou1O6OWn)cOh z2#}y5S#FQa=|Ip<*sV~QI|vCFn$CO>V8rRbLOSp!*6^p-?RGkCemuI6WCUW{r|vqN zE&#hm?nM+pvS79-FPB!6mhyo7WnKWe^i%?Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz0i;PpK~y+TO_9$^ z0#Ovk?}%j$lp|A_iy#QWRk&~^6ygiCD|(KoAaUm+GoPS$aO1{RPtZC72?Z&2A3(}VE`M_iSdR~-@=Co{D`JVm`T%}(vZI%`$7^@y{(19>JF<3m-RVe` z8am<2XcdwT7vMBtv6yeMF}Lm5o;P3oj9d{=UOMOl2*ec;+AtU1RB&W75|1CI{FkLX zR}DJgFL0&Qcdso#f`+W_}H!oB1qhenlLKWiXZ|5(tX{@DsPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940i#JoK~y+TO_5Ja z0#OvjpJG`9<;Ya#A_zjkIbE2dpc5? zlD=5T80D7(3s4Q1&)qE!#b^EACzJV5Wj{{;)h$8kLnLE>K2gs=Qq7DQk`rms6$g}yb-e@8R_OXiz< Qod5s;07*qoM6N<$f?h1;A^-pY literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/create/textures/block/flexpulsepeater_on.png b/src/main/resources/assets/create/textures/block/flexpulsepeater_on.png new file mode 100644 index 0000000000000000000000000000000000000000..2d6d50c091fe2629bced15e3c793d3a688eed207 GIT binary patch literal 529 zcmV+s0`C2ZP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940j5brK~y+TU6R2{ z0#Ou(N3$%U95FH%K@c*#aN$ZQe22ny4-l?u5#mOIq=-OzfLclrlyA{WS|t(+Lh4GT zMje^7?|Q~TI_TlQ|NZYd|Gj5C*<4oFb!{HKUQd8a!Ym4W{Nwxaezz}cZAYcrXU!hl zvAtMyH#%drL4Saz-mLpL4GM;WfnY%P%FpGiLg8b{_jrDm&=Nwr;kmiJNggCYtwxIi zu7Q654NWTV6=ex28Fl6~16Yh|wQ3kf@xCaQIIIrfM{PD$dbm5W#@4Sr8Cs^kzG00_ zEq$#vW-?lNWx)kF4VX?Rt1JR*;n1c%nSPs=2q-Td)ByzIitsK6ruIm%f5jh(Y-0%> z<#{ou1O6OWn)cOh2#}y5S#FQa=|Ip<*sV~QI|vCFn$CO>V8rRbLOSp!*6^p-?RGkC zemuI6WCUW{r|vqNE&#hm?nM+pvS79-FPB!6mhyo7WnKWe^i%?P~Vau0t3>0(TN*sSJ(dlkQ)9Y TDEyCU00000NkvXXu0mjf%)s1n literal 0 HcmV?d00001 diff --git a/src/main/resources/data/create/loot_tables/blocks/flexpulsepeater.json b/src/main/resources/data/create/loot_tables/blocks/flexpulsepeater.json new file mode 100644 index 000000000..79cb57dc4 --- /dev/null +++ b/src/main/resources/data/create/loot_tables/blocks/flexpulsepeater.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:flexpulsepeater" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shaped/flexpulsepeater.json b/src/main/resources/data/create/recipes/crafting_shaped/flexpulsepeater.json new file mode 100644 index 000000000..70d48bb12 --- /dev/null +++ b/src/main/resources/data/create/recipes/crafting_shaped/flexpulsepeater.json @@ -0,0 +1,24 @@ +{ + "type": "crafting_shaped", + "pattern": [ + "SP" + ], + "key": { + "P": { + "item": "create:flexpeater" + }, + "S": { + "item": "create:pulse_repeater" + } + }, + "result": { + "item": "create:flexpulsepeater", + "count": 1 + }, + "conditions": [ + { + "type": "create:module", + "module": "logistics" + } + ] +} \ No newline at end of file