diff --git a/src/main/java/com/petrolpark/destroy/block/CreativePumpBlock.java b/src/main/java/com/petrolpark/destroy/block/CreativePumpBlock.java new file mode 100644 index 000000000..ecdcaad4a --- /dev/null +++ b/src/main/java/com/petrolpark/destroy/block/CreativePumpBlock.java @@ -0,0 +1,36 @@ +package com.petrolpark.destroy.block; + +import com.petrolpark.destroy.block.entity.DestroyBlockEntityTypes; +import com.petrolpark.destroy.block.shape.DestroyShapes; +import com.simibubi.create.content.fluids.pump.PumpBlock; +import com.simibubi.create.content.fluids.pump.PumpBlockEntity; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; + +public class CreativePumpBlock extends PumpBlock { + + public CreativePumpBlock(Properties properties) { + super(properties); + }; + + @Override + public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { + return DestroyShapes.CREATIVE_PUMP.get(state.getValue(FACING).getAxis()); + }; + + @Override + public BlockEntityType getBlockEntityType() { + return DestroyBlockEntityTypes.CREATIVE_PUMP.get(); + }; + + @Override + public boolean isSmallCog() { + return false; + }; + +}; diff --git a/src/main/java/com/petrolpark/destroy/block/DestroyBlocks.java b/src/main/java/com/petrolpark/destroy/block/DestroyBlocks.java index 74bf36774..5e60cab90 100644 --- a/src/main/java/com/petrolpark/destroy/block/DestroyBlocks.java +++ b/src/main/java/com/petrolpark/destroy/block/DestroyBlocks.java @@ -53,6 +53,7 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Items; +import net.minecraft.world.item.Rarity; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.Block; @@ -146,6 +147,18 @@ public class DestroyBlocks { .transform(customItemModel()) .register(); + public static final BlockEntry CREATIVE_PUMP = REGISTRATE.block("creative_pump", CreativePumpBlock::new) + .initialProperties(AllBlocks.MECHANICAL_PUMP) + .properties(p -> p + .mapColor(MapColor.COLOR_PURPLE) + .forceSolidOn() + ).transform(TagGen.pickaxeOnly()) + .item() + .properties(p -> p + .rarity(Rarity.EPIC) + ).build() + .register(); + public static final BlockEntry CUSTOM_EXPLOSIVE_MIX = REGISTRATE.block("custom_explosive_mix", CustomExplosiveMixBlock::new) .initialProperties(() -> Blocks.TNT) .properties(p -> p diff --git a/src/main/java/com/petrolpark/destroy/block/entity/AgingBarrelBlockEntity.java b/src/main/java/com/petrolpark/destroy/block/entity/AgingBarrelBlockEntity.java index 27e69815a..b95d7e2a8 100644 --- a/src/main/java/com/petrolpark/destroy/block/entity/AgingBarrelBlockEntity.java +++ b/src/main/java/com/petrolpark/destroy/block/entity/AgingBarrelBlockEntity.java @@ -191,6 +191,9 @@ public void onTimerChange() { if (timer <= 0) { tank.allowExtraction(); tank.allowInsertion(); + } else { + tank.forbidExtraction(); + tank.forbidInsertion(); }; int progress; if (timer < 0) { diff --git a/src/main/java/com/petrolpark/destroy/block/entity/CreativePumpBlockEntity.java b/src/main/java/com/petrolpark/destroy/block/entity/CreativePumpBlockEntity.java new file mode 100644 index 000000000..0a4ea2682 --- /dev/null +++ b/src/main/java/com/petrolpark/destroy/block/entity/CreativePumpBlockEntity.java @@ -0,0 +1,85 @@ +package com.petrolpark.destroy.block.entity; + +import java.util.List; + +import com.google.common.collect.ImmutableList; +import com.petrolpark.destroy.block.CreativePumpBlock; +import com.simibubi.create.content.fluids.pump.PumpBlockEntity; +import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour; +import com.simibubi.create.foundation.blockEntity.behaviour.ValueBoxTransform; +import com.simibubi.create.foundation.blockEntity.behaviour.ValueSettingsBoard; +import com.simibubi.create.foundation.blockEntity.behaviour.ValueSettingsFormatter; +import com.simibubi.create.foundation.blockEntity.behaviour.scrollValue.ScrollValueBehaviour; +import com.simibubi.create.foundation.utility.VecHelper; +import com.simibubi.create.infrastructure.config.AllConfigs; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.Vec3; + +public class CreativePumpBlockEntity extends PumpBlockEntity { + + public ScrollValueBehaviour pumpSpeedBehaviour; + protected int simulatedSpeed = 16; // Can't use KineticBlockEntity speed because this gets set to 0 if there is no source + + public CreativePumpBlockEntity(BlockEntityType typeIn, BlockPos pos, BlockState state) { + super(typeIn, pos, state); + }; + + @Override + public void addBehaviours(List behaviours) { + super.addBehaviours(behaviours); + pumpSpeedBehaviour = new ScrollValueBehaviour(Component.translatable("block.destroy.creative_pump.speed"), this, new CreativePumpValueSlot()) { + @Override + public ValueSettingsBoard createBoard(Player player, BlockHitResult hitResult) { + return new ValueSettingsBoard(label, max, 16, ImmutableList.of(Component.translatable("block.destroy.creative_pump.speed")), new ValueSettingsFormatter(ValueSettings::format)); + }; + } + .between(0, AllConfigs.server().kinetics.maxRotationSpeed.get()) + .withCallback(i -> { + simulatedSpeed = i; + updatePressureChange(); + }); + pumpSpeedBehaviour.setValue(simulatedSpeed); + behaviours.add(pumpSpeedBehaviour); + }; + + @Override + public float getSpeed() { + return simulatedSpeed; + }; + + @Override + protected void read(CompoundTag compound, boolean clientPacket) { + super.read(compound, clientPacket); + simulatedSpeed = compound.getInt("SimulatedSpeed"); + pumpSpeedBehaviour.setValue(simulatedSpeed); + }; + + @Override + protected void write(CompoundTag compound, boolean clientPacket) { + super.write(compound, clientPacket); + compound.putInt("SimulatedSpeed", simulatedSpeed); + }; + + public class CreativePumpValueSlot extends ValueBoxTransform.Sided { + + @Override + protected boolean isSideActive(BlockState state, Direction direction) { + return state.getValue(CreativePumpBlock.FACING).getAxis() != direction.getAxis(); + }; + + @Override + protected Vec3 getSouthLocation() { + return VecHelper.voxelSpace(8d, 8d, 12.5d); + }; + + }; + +}; diff --git a/src/main/java/com/petrolpark/destroy/block/entity/DestroyBlockEntityTypes.java b/src/main/java/com/petrolpark/destroy/block/entity/DestroyBlockEntityTypes.java index 15870baed..86f7b0758 100644 --- a/src/main/java/com/petrolpark/destroy/block/entity/DestroyBlockEntityTypes.java +++ b/src/main/java/com/petrolpark/destroy/block/entity/DestroyBlockEntityTypes.java @@ -77,6 +77,11 @@ public class DestroyBlockEntityTypes { .renderer(() -> CoolerRenderer::new) .register(); + public static final BlockEntityEntry CREATIVE_PUMP = REGISTRATE + .blockEntity("creative_pump", CreativePumpBlockEntity::new) + .validBlocks(DestroyBlocks.CREATIVE_PUMP) + .register(); + public static final BlockEntityEntry CUSTOM_EXPLOSIVE_MIX = REGISTRATE .blockEntity("custom_explosive_mix", CustomExplosiveMixBlockEntity::new) .validBlocks(DestroyBlocks.CUSTOM_EXPLOSIVE_MIX) diff --git a/src/main/java/com/petrolpark/destroy/block/entity/VatSideBlockEntity.java b/src/main/java/com/petrolpark/destroy/block/entity/VatSideBlockEntity.java index 5dcfade24..ce8543cbd 100644 --- a/src/main/java/com/petrolpark/destroy/block/entity/VatSideBlockEntity.java +++ b/src/main/java/com/petrolpark/destroy/block/entity/VatSideBlockEntity.java @@ -451,6 +451,7 @@ public void updateDisplayType(BlockPos neighborPos) { }; boolean nextToAir = getLevel().getBlockState(neighborPos).isAir(); // It thinks getLevel() might be null (it's not) + DisplayType oldDisplayType = getDisplayType(); if (nextToPipe) { setDisplayType(DisplayType.PIPE); } else if (!nextToAir) { @@ -478,8 +479,10 @@ public void updateDisplayType(BlockPos neighborPos) { }; }; - redstoneMonitor.update(); - invalidateRenderBoundingBox(); + if (getDisplayType() != oldDisplayType) { + redstoneMonitor.update(); + invalidateRenderBoundingBox(); + }; }; @Override diff --git a/src/main/java/com/petrolpark/destroy/block/entity/behaviour/RedstoneQuantityMonitorBehaviour.java b/src/main/java/com/petrolpark/destroy/block/entity/behaviour/RedstoneQuantityMonitorBehaviour.java index 68ba60831..013174a6e 100644 --- a/src/main/java/com/petrolpark/destroy/block/entity/behaviour/RedstoneQuantityMonitorBehaviour.java +++ b/src/main/java/com/petrolpark/destroy/block/entity/behaviour/RedstoneQuantityMonitorBehaviour.java @@ -50,7 +50,7 @@ public int getStrength() { }; public void update() { - getWorld().blockUpdated(getPos(), getWorld().getBlockState(getPos()).getBlock()); + getWorld().updateNeighborsAt(getPos(), blockEntity.getBlockState().getBlock()); //TODO update adjacent positions? }; diff --git a/src/main/java/com/petrolpark/destroy/block/renderer/AgingBarrelRenderer.java b/src/main/java/com/petrolpark/destroy/block/renderer/AgingBarrelRenderer.java index b1c4e6e2c..282e325e2 100644 --- a/src/main/java/com/petrolpark/destroy/block/renderer/AgingBarrelRenderer.java +++ b/src/main/java/com/petrolpark/destroy/block/renderer/AgingBarrelRenderer.java @@ -6,6 +6,7 @@ import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.petrolpark.destroy.Destroy; +import com.petrolpark.destroy.block.AgingBarrelBlock; import com.petrolpark.destroy.block.entity.AgingBarrelBlockEntity; import com.petrolpark.destroy.util.DestroyTags.DestroyItemTags; import com.simibubi.create.foundation.fluid.FluidRenderer; @@ -39,6 +40,8 @@ public AgingBarrelRenderer(BlockEntityRendererProvider.Context context) { protected void renderSafe(AgingBarrelBlockEntity barrel, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { super.renderSafe(barrel, partialTicks, ms, buffer, light, overlay); + if (!barrel.getBlockState().getValue(AgingBarrelBlock.IS_OPEN)) return; + //render Fluid float fluidLevel = renderFluid(barrel, partialTicks, ms, buffer, light, overlay); @@ -104,7 +107,7 @@ protected float renderFluid(AgingBarrelBlockEntity barrel, float partialTicks, P TankSegment tank = barrel.getTankToRender(); float units = tank.getTotalUnits(partialTicks); float maxY = minY + (Mth.clamp(units / barrel.getTank().getCapacity(), 0, 1) * 8 / 12f); - if (units < 1) return minY; + if (units < 1 || tank.getRenderedFluid().isEmpty()) return minY; FluidRenderer.renderFluidBox(tank.getRenderedFluid(), 2 / 16f, minY, 2 / 16f, 14 / 16f, maxY, 14 / 16f, buffer, ms, light, false); return maxY; }; diff --git a/src/main/java/com/petrolpark/destroy/block/shape/DestroyShapes.java b/src/main/java/com/petrolpark/destroy/block/shape/DestroyShapes.java index a6e2311a6..e3bd46723 100644 --- a/src/main/java/com/petrolpark/destroy/block/shape/DestroyShapes.java +++ b/src/main/java/com/petrolpark/destroy/block/shape/DestroyShapes.java @@ -120,7 +120,10 @@ public class DestroyShapes { .add(2, 2, 2, 14, 10, 14) .add(3, 10, 3, 13, 12, 13) .add(5, 12, 5, 11, 16, 11) - .forDirectional(Direction.UP); + .forDirectional(Direction.UP), + + CREATIVE_PUMP = shape(3, 0, 3, 13, 16, 13) + .forAxis(); public static final VoxelShaper BLOWPIPE = shape(7, 0, 7, 9, 16, 9).forAxis(); diff --git a/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderIndex.java b/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderIndex.java index 7a6fc0a94..fb64be42f 100644 --- a/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderIndex.java +++ b/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderIndex.java @@ -15,16 +15,19 @@ import com.petrolpark.destroy.client.ponder.scene.TrypolithographyScenes; import com.petrolpark.destroy.item.DestroyItems; import com.simibubi.create.AllBlocks; +import com.simibubi.create.Create; import com.simibubi.create.foundation.ponder.PonderRegistrationHelper; import com.simibubi.create.foundation.ponder.PonderRegistry; import com.simibubi.create.foundation.ponder.PonderStoryBoardEntry; import com.simibubi.create.infrastructure.ponder.AllPonderTags; +import com.simibubi.create.infrastructure.ponder.scenes.fluid.PumpScenes; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; public class DestroyPonderIndex { + public static final PonderRegistrationHelper CREATE_HELPER = new PonderRegistrationHelper(Create.ID); public static final PonderRegistrationHelper HELPER = new PonderRegistrationHelper(Destroy.MOD_ID); public static void register() { @@ -75,6 +78,10 @@ public static void register() { .addStoryBoard("processing/cooler", ProcessingScenes::cooler) .addStoryBoard("vat/temperature", ChemistryScenes::vatTemperature, DestroyPonderTags.CHEMISTRY); + // Creative Pump + CREATE_HELPER.forComponents(DestroyBlocks.CREATIVE_PUMP) + .addStoryBoard("mechanical_pump/flow", PumpScenes::flow); + // Custom Explosive Mix HELPER.forComponents(DestroyBlocks.CUSTOM_EXPLOSIVE_MIX) .addStoryBoard("explosives/custom_explosive_mix", (s, u) -> ExplosivesScenes.filling(s, u, DestroyBlocks.CUSTOM_EXPLOSIVE_MIX::asStack)) diff --git a/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderTags.java b/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderTags.java index da9298700..d1add7dea 100644 --- a/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderTags.java +++ b/src/main/java/com/petrolpark/destroy/client/ponder/DestroyPonderTags.java @@ -45,6 +45,7 @@ public static void register() { .add(DestroyBlocks.CATALYTIC_CONVERTER) .add(DestroyBlocks.CENTRIFUGE) .add(DestroyBlocks.COOLER) + .add(DestroyBlocks.CREATIVE_PUMP) .add(DestroyBlocks.CUSTOM_EXPLOSIVE_MIX) .add(DestroyBlocks.DYNAMO) .add(DestroyBlocks.EXTRUSION_DIE) @@ -67,6 +68,7 @@ public static void register() { .add(DestroyBlocks.BUBBLE_CAP) .add(DestroyBlocks.CATALYTIC_CONVERTER) .add(DestroyBlocks.CENTRIFUGE) + .add(DestroyBlocks.CREATIVE_PUMP) .add(DestroyBlocks.PUMPJACK) .add(DestroyBlocks.SIPHON) .add(DestroyBlocks.TREE_TAP) @@ -103,6 +105,10 @@ public static void register() { PonderRegistry.TAGS.forTag(AllPonderTags.CONTRAPTION_ACTOR) .add(DestroyBlocks.EXTRUSION_DIE) ; + + PonderRegistry.TAGS.forTag(AllPonderTags.CREATIVE) + .add(DestroyBlocks.CREATIVE_PUMP) + ; }; public static final void refreshVatMaterialsTag() { diff --git a/src/main/java/com/petrolpark/destroy/compat/createbigcannons/block/CustomExplosiveMixShellBlock.java b/src/main/java/com/petrolpark/destroy/compat/createbigcannons/block/CustomExplosiveMixShellBlock.java index add196dc7..49c50939c 100644 --- a/src/main/java/com/petrolpark/destroy/compat/createbigcannons/block/CustomExplosiveMixShellBlock.java +++ b/src/main/java/com/petrolpark/destroy/compat/createbigcannons/block/CustomExplosiveMixShellBlock.java @@ -55,8 +55,10 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntit @Override public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult pHit) { - InteractionResult dyeingResult = onBlockEntityUse(level, pos, be -> be.tryDye(player.getItemInHand(hand), pHit, level, pos, player)); - if (dyeingResult != InteractionResult.PASS) return dyeingResult; + InteractionResult result = onBlockEntityUse(level, pos, be -> be.tryDye(player.getItemInHand(hand), pHit, level, pos, player)); + if (result != InteractionResult.PASS) return result; + result = super.use(state, level, pos, player, hand, pHit); // Fuse + if (result != InteractionResult.PASS) return result; if (!level.isClientSide() && player instanceof ServerPlayer serverPlayer) { withBlockEntityDo(level, pos, be -> NetworkHooks.openScreen(serverPlayer, be, be::writeToBuffer)); return InteractionResult.SUCCESS; diff --git a/src/main/java/com/petrolpark/destroy/compat/jei/category/ObliterationCategory.java b/src/main/java/com/petrolpark/destroy/compat/jei/category/ObliterationCategory.java index a8b090235..cabdb0d2b 100644 --- a/src/main/java/com/petrolpark/destroy/compat/jei/category/ObliterationCategory.java +++ b/src/main/java/com/petrolpark/destroy/compat/jei/category/ObliterationCategory.java @@ -6,6 +6,8 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.petrolpark.client.rendering.PetrolparkGuiTexture; import com.petrolpark.compat.jei.category.PetrolparkRecipeCategory; +import com.petrolpark.destroy.block.DestroyBlocks; +import com.petrolpark.destroy.item.CustomExplosiveMixBlockItem; import com.petrolpark.destroy.recipe.ObliterationRecipe; import com.petrolpark.destroy.util.DestroyTags.DestroyItemTags; import com.simibubi.create.content.processing.recipe.ProcessingOutput; @@ -17,8 +19,6 @@ import mezz.jei.api.recipe.IFocusGroup; import mezz.jei.api.recipe.RecipeIngredientRole; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; public class ObliterationCategory extends PetrolparkRecipeCategory { @@ -32,13 +32,9 @@ public void setRecipe(IRecipeLayoutBuilder builder, ObliterationRecipe recipe, I .setBackground(getRenderedSlot(), -1, -1) .addIngredients(recipe.getIngredients().get(0)); - List explosives = new ArrayList<>(); - ForgeRegistries.ITEMS.tags().getTag(DestroyItemTags.OBLITERATION_EXPLOSIVES.tag).forEach(item -> { - explosives.add(new ItemStack(item)); - }); builder.addSlot(RecipeIngredientRole.CATALYST, 77, 26) .setBackground(getRenderedSlot(), -1, -1) - .addItemStacks(explosives); + .addItemStack(CustomExplosiveMixBlockItem.getExampleItemStack()); ProcessingOutput output = recipe.getRollableResults().get(0); builder.addSlot(RecipeIngredientRole.OUTPUT, 131, 51) diff --git a/src/main/java/com/petrolpark/destroy/item/WaterSensitiveSpontaneouslyCombustingItem.java b/src/main/java/com/petrolpark/destroy/item/WaterSensitiveSpontaneouslyCombustingItem.java index 6125370c8..81d48ac15 100644 --- a/src/main/java/com/petrolpark/destroy/item/WaterSensitiveSpontaneouslyCombustingItem.java +++ b/src/main/java/com/petrolpark/destroy/item/WaterSensitiveSpontaneouslyCombustingItem.java @@ -17,18 +17,20 @@ public WaterSensitiveSpontaneouslyCombustingItem(Properties properties) { @Override public void inventoryTick(ItemStack stack, Level level, Entity entity, int slotId, boolean isSelected) { super.inventoryTick(stack, level, entity, slotId, isSelected); - checkForWater(stack, entity, isSelected); + if (checkForWater(stack, entity, isSelected)) stack.setCount(0); }; @Override public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { - checkForWater(stack, entity, true); + if (checkForWater(stack, entity, true)) entity.kill(); return super.onEntityItemUpdate(stack, entity); }; - public void checkForWater(ItemStack stack, Entity entity, boolean rainSensitive) { + public boolean checkForWater(ItemStack stack, Entity entity, boolean rainSensitive) { if (entity.isInWaterOrBubble() || (entity.isInWaterRainOrBubble() && (rainSensitive || (entity instanceof LivingEntity livingEntity && livingEntity.getOffhandItem() == stack)))) { SmartExplosion.explode(entity.level(), new SmartExplosion(entity.level(), entity, null, null, entity.position(), 2f, 0.7f)); + return true; }; + return false; }; }; diff --git a/src/main/java/com/petrolpark/destroy/item/creativeModeTab/DestroyCreativeModeTabs.java b/src/main/java/com/petrolpark/destroy/item/creativeModeTab/DestroyCreativeModeTabs.java index 33b1fa5cf..c959d3090 100644 --- a/src/main/java/com/petrolpark/destroy/item/creativeModeTab/DestroyCreativeModeTabs.java +++ b/src/main/java/com/petrolpark/destroy/item/creativeModeTab/DestroyCreativeModeTabs.java @@ -4,6 +4,7 @@ import com.petrolpark.client.creativemodetab.CustomTab; import com.petrolpark.client.creativemodetab.CustomTab.ITabEntry; +import com.petrolpark.compat.CompatMods; import com.petrolpark.destroy.Destroy; import com.petrolpark.destroy.block.DestroyBlocks; import com.petrolpark.destroy.config.DestroySubstancesConfigs; @@ -15,6 +16,7 @@ import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -22,6 +24,7 @@ import net.minecraft.world.level.block.Blocks; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class DestroyCreativeModeTabs { @@ -33,7 +36,7 @@ public class DestroyCreativeModeTabs { .add( s("chemistry_equipment"), - i(DestroyBlocks.VAT_CONTROLLER), i(DestroyBlocks.STAINLESS_STEEL_BLOCK), i(DestroyBlocks.BOROSILICATE_GLASS), d(AllBlocks.FLUID_PIPE), d(AllBlocks.MECHANICAL_PUMP), d(AllBlocks.CREATIVE_FLUID_TANK), i(DestroyBlocks.SIPHON), d(AllBlocks.BLAZE_BURNER), i(DestroyBlocks.COOLER), i(DestroyBlocks.BUBBLE_CAP), i(DestroyBlocks.CENTRIFUGE), i(DestroyBlocks.DYNAMO), i(DestroyBlocks.BLACKLIGHT), i(DestroyBlocks.COLORIMETER), i(DestroyBlocks.CATALYTIC_CONVERTER), i(DestroyBlocks.BEAKER), i(DestroyItems.TEST_TUBE), i(DestroyBlocks.TEST_TUBE_RACK), i(DestroyBlocks.MEASURING_CYLINDER), i(DestroyBlocks.ROUND_BOTTOMED_FLASK), i(DestroyItems.PAPER_MASK), i(DestroyItems.LABORATORY_GOGGLES), i(DestroyItems.GAS_MASK), i(DestroyItems.HAZMAT_SUIT), i(DestroyItems.HAZMAT_LEGGINGS), i(DestroyItems.WELLINGTON_BOOTS), + i(DestroyBlocks.VAT_CONTROLLER), i(DestroyBlocks.STAINLESS_STEEL_BLOCK), i(DestroyBlocks.BOROSILICATE_GLASS), d(AllBlocks.FLUID_PIPE), i(DestroyBlocks.CREATIVE_PUMP), d(AllBlocks.CREATIVE_FLUID_TANK), i(DestroyBlocks.SIPHON), d(AllBlocks.BLAZE_BURNER), i(DestroyBlocks.COOLER), i(DestroyBlocks.BUBBLE_CAP), i(DestroyBlocks.CENTRIFUGE), i(DestroyBlocks.DYNAMO), i(DestroyBlocks.BLACKLIGHT), i(DestroyBlocks.COLORIMETER), i(DestroyBlocks.CATALYTIC_CONVERTER), i(DestroyBlocks.BEAKER), i(DestroyItems.TEST_TUBE), i(DestroyBlocks.TEST_TUBE_RACK), i(DestroyBlocks.MEASURING_CYLINDER), i(DestroyBlocks.ROUND_BOTTOMED_FLASK), i(DestroyItems.PAPER_MASK), i(DestroyItems.LABORATORY_GOGGLES), i(DestroyItems.GAS_MASK), i(DestroyItems.HAZMAT_SUIT), i(DestroyItems.HAZMAT_LEGGINGS), i(DestroyItems.WELLINGTON_BOOTS), //s("common_chemicals"), //TODO @@ -59,13 +62,13 @@ public class DestroyCreativeModeTabs { i(DestroyItems.POLYETHENE_TEREPHTHALATE), i(DestroyItems.POLYVINYL_CHLORIDE), i(DestroyItems.POLYETHENE), i(DestroyItems.POLYPROPENE), i(DestroyItems.POLYSTYRENE), i(DestroyItems.ABS), i(DestroyItems.POLYTETRAFLUOROETHENE), i(DestroyItems.NYLON), i(DestroyItems.POLYSTYRENE_BUTADIENE), i(DestroyItems.POLYACRYLONITRILE), i(DestroyItems.POLYISOPRENE), i(DestroyItems.POLYURETHANE), i(DestroyItems.POLYMETHYL_METHACRYLATE), i(DestroyItems.CARD_STOCK), s("resources"), - i(DestroyItems.FLUORITE), i(DestroyBlocks.FLUORITE_BLOCK), i(DestroyBlocks.FLUORITE_ORE), i(DestroyBlocks.DEEPSLATE_FLUORITE_ORE), i(DestroyBlocks.END_FLUORITE_ORE), i(DestroyItems.BORAX), i(DestroyItems.SILICA), i(DestroyItems.MOLTEN_BOROSILICATE_GLASS_BUCKET), i(DestroyBlocks.BOROSILICATE_GLASS_FIBER), r(DestroyBlocks.BOROSILICATE_GLASS), i(DestroyBlocks.FIBERGLASS_BLOCK), i(DestroyBlocks.INSULATED_STAINLESS_STEEL_BLOCK), i(DestroyItems.IODINE), i(DestroyBlocks.IODINE_BLOCK), i(DestroyItems.CARBON_FIBER), i(DestroyBlocks.CARBON_FIBER_BLOCK), i(DestroyBlocks.UNVARNISHED_PLYWOOD), i(DestroyBlocks.PLYWOOD), i(DestroyBlocks.CLAY_MONOLITH), i(DestroyBlocks.CERAMIC_MONOLITH), i(DestroyItems.CHALK_DUST), i(DestroyItems.QUICKLIME), i(DestroyItems.CALCIUM_CARBIDE), i(DestroyItems.ZEOLITE), i(DestroyItems.NANODIAMONDS), + i(DestroyItems.FLUORITE), i(DestroyBlocks.FLUORITE_BLOCK), i(DestroyBlocks.FLUORITE_ORE), i(DestroyBlocks.DEEPSLATE_FLUORITE_ORE), i(DestroyBlocks.END_FLUORITE_ORE), i(DestroyItems.BORAX), i(DestroyItems.SILICA), i(DestroyItems.MOLTEN_BOROSILICATE_GLASS_BUCKET), i(DestroyBlocks.BOROSILICATE_GLASS_FIBER), r(DestroyBlocks.BOROSILICATE_GLASS), i(DestroyBlocks.FIBERGLASS_BLOCK), i(DestroyBlocks.INSULATED_STAINLESS_STEEL_BLOCK), i(DestroyItems.IODINE), i(DestroyBlocks.IODINE_BLOCK), i(DestroyItems.CARBON_FIBER), i(DestroyBlocks.CARBON_FIBER_BLOCK), i(DestroyBlocks.UNVARNISHED_PLYWOOD), i(DestroyBlocks.PLYWOOD), i(DestroyBlocks.CLAY_MONOLITH), i(DestroyBlocks.CERAMIC_MONOLITH), i(DestroyItems.CHALK_DUST), i(DestroyItems.QUICKLIME), i(DestroyItems.CALCIUM_CARBIDE), i(DestroyItems.SODIUM_HYDRIDE), i(DestroyItems.ZEOLITE), i(DestroyItems.NANODIAMONDS), //TODO crude oil bucket s("explosives"), n(), i(DestroyItems.ACETONE_PEROXIDE), i(DestroyItems.FULMINATED_MERCURY), i(DestroyItems.NICKEL_HYDRAZINE_NITRATE), i(DestroyItems.TOUCH_POWDER), n(), i(DestroyItems.ANFO), i(DestroyItems.CORDITE), i(DestroyItems.DYNAMITE), i(DestroyItems.NITROCELLULOSE), i(DestroyItems.PICRIC_ACID_TABLET), i(DestroyItems.TNT_TABLET), - n(), i(DestroyBlocks.CUSTOM_EXPLOSIVE_MIX), i(DestroyBlocks.DYNAMITE_BLOCK), i(DestroyBlocks.CORDITE_BLOCK), i(DestroyBlocks.EXTRUDED_CORDITE_BLOCK), + n(), i(DestroyBlocks.CUSTOM_EXPLOSIVE_MIX), i(Destroy.asResource("custom_explosive_mix_charge")), i(Destroy.asResource("custom_explosive_mix_shell")), i(DestroyBlocks.DYNAMITE_BLOCK), i(DestroyBlocks.CORDITE_BLOCK), i(DestroyBlocks.EXTRUDED_CORDITE_BLOCK), s("pharmaceuticals"), i(DestroyItems.SYRINGE), i(DestroyItems.ASPIRIN_SYRINGE), i(DestroyItems.CISPLATIN_SYRINGE), c(DestroyItems.BABY_BLUE_SYRINGE, DestroySubstancesConfigs::babyBlueEnabled), c(DestroyItems.BABY_BLUE_CRYSTAL, DestroySubstancesConfigs::babyBlueEnabled), c(DestroyItems.BABY_BLUE_POWDER, DestroySubstancesConfigs::babyBlueEnabled), i(DestroyItems.SPRAY_BOTTLE), i(DestroyItems.PERFUME_BOTTLE), i(DestroyItems.SUNSCREEN_BOTTLE), i(DestroyItems.CREATINE), @@ -111,6 +114,10 @@ public static final ITabEntry.Item i(Supplier item) { return new ITabEntry.Item(item); }; + public static final ITabEntry.Item i(ResourceLocation itemId) { + return new ITabEntry.ConditionalItem(() -> new ItemStack(ForgeRegistries.ITEMS.getDelegate(itemId).get().value()), () -> CompatMods.BIG_CANNONS.isLoaded() && ForgeRegistries.ITEMS.containsKey(itemId)); + }; + public static final ITabEntry.ConditionalItem c(ItemProviderEntry item, Supplier condition) { return new ITabEntry.ConditionalItem(item::asStack, condition); }; diff --git a/src/main/java/com/petrolpark/destroy/mixin/ServerGamePacketListenerImplMixin.java b/src/main/java/com/petrolpark/destroy/mixin/ServerGamePacketListenerImplMixin.java index f45e6e0fe..4d74afd4c 100644 --- a/src/main/java/com/petrolpark/destroy/mixin/ServerGamePacketListenerImplMixin.java +++ b/src/main/java/com/petrolpark/destroy/mixin/ServerGamePacketListenerImplMixin.java @@ -51,7 +51,8 @@ public void handleSetCarriedItem(ServerboundSetCarriedItemPacket packet) { method = "handleSetCreativeModeSlot", at = @At( value = "INVOKE", - target = "Lnet/minecraft/world/item/ItemStack;isEmpty()Z" + target = "Lnet/minecraft/world/item/ItemStack;isEmpty()Z", + ordinal = 1 ), locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true diff --git a/src/main/resources/assets/destroy/blockstates/creative_pump.json b/src/main/resources/assets/destroy/blockstates/creative_pump.json new file mode 100644 index 000000000..77cef9099 --- /dev/null +++ b/src/main/resources/assets/destroy/blockstates/creative_pump.json @@ -0,0 +1,30 @@ +{ + "variants": { + "facing=down": { + "model": "destroy:block/creative_pump", + "x": 180 + }, + "facing=up": { + "model": "destroy:block/creative_pump" + }, + "facing=north": { + "model": "destroy:block/creative_pump", + "x": 90 + }, + "facing=south": { + "model": "destroy:block/creative_pump", + "x": 90, + "y": 180 + }, + "facing=west": { + "model": "destroy:block/creative_pump", + "x": 90, + "y": 270 + }, + "facing=east": { + "model": "destroy:block/creative_pump", + "x": 90, + "y": 90 + } + } + } \ No newline at end of file diff --git a/src/main/resources/assets/destroy/lang/en_us.json b/src/main/resources/assets/destroy/lang/en_us.json index 821f5b6b2..26d0d7525 100644 --- a/src/main/resources/assets/destroy/lang/en_us.json +++ b/src/main/resources/assets/destroy/lang/en_us.json @@ -166,6 +166,8 @@ "block.destroy.cordite.tooltip.condition1": "When Exploded", "block.destroy.cordite.tooltip.behaviour1": "_Evaporates_ liquids, doesn't drop items and does _minimal damage_ to mobs.", "block.destroy.cordite_block": "Cordite Block", + "block.destroy.creative_pump": "Creative Pump", + "block.destroy.creative_pump.speed": "Pumping Speed", "block.destroy.custom_explosive_mix": "Mixed Explosive", "block.destroy.custom_explosive_mix_charge": "Mixed Charge", "block.destroy.custom_explosive_mix_shell": "Mixed Shell", diff --git a/src/main/resources/assets/destroy/models/block/creative_pump.json b/src/main/resources/assets/destroy/models/block/creative_pump.json new file mode 100644 index 000000000..e1ff673ce --- /dev/null +++ b/src/main/resources/assets/destroy/models/block/creative_pump.json @@ -0,0 +1,129 @@ +{ + "credit": "Made with Blockbench", + "parent": "minecraft:block/block", + "textures": { + "0": "create:block/pump", + "1": "create:block/creative_motor", + "2": "create:block/creative_casing", + "4": "destroy:block/creative_pump", + "particle": "create:block/pump" + }, + "elements": [ + { + "from": [3, 0, 3], + "to": [13, 5, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 2]}, + "faces": { + "north": {"uv": [0, 0, 10, 5], "texture": "#4"}, + "east": {"uv": [0, 0, 10, 5], "texture": "#4"}, + "south": {"uv": [0, 0, 10, 5], "texture": "#4"}, + "west": {"uv": [0, 0, 10, 5], "texture": "#4"}, + "up": {"uv": [0, 0, 10, 10], "texture": "#1"}, + "down": {"uv": [0, 5, 10, 15], "texture": "#4"} + } + }, + { + "from": [5.85355, 13.25, 1.75], + "to": [9.85355, 15.25, 13.75], + "rotation": {"angle": 45, "axis": "z", "origin": [8.35355, 13.25, 7.75]}, + "faces": { + "north": {"uv": [16, 0, 12, 2], "texture": "#0"}, + "east": {"uv": [15, 0, 16, 2], "texture": "#0"}, + "south": {"uv": [12, 0, 16, 2], "texture": "#0"}, + "west": {"uv": [12, 0, 13, 2], "texture": "#0"}, + "up": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "down": {"uv": [12, 1, 16, 2], "texture": "#0"} + } + }, + { + "from": [7.85355, 11.25, 1.75], + "to": [9.85355, 13.25, 13.75], + "rotation": {"angle": 45, "axis": "z", "origin": [8.35355, 13.25, 7.75]}, + "faces": { + "north": {"uv": [16, 2, 14, 4], "texture": "#0"}, + "east": {"uv": [15, 2, 16, 4], "texture": "#0"}, + "south": {"uv": [14, 2, 16, 4], "texture": "#0"}, + "west": {"uv": [14, 2, 15, 4], "texture": "#0"}, + "down": {"uv": [14, 3, 16, 4], "texture": "#0"} + } + }, + { + "from": [2.35355, 10.75, 7.75], + "to": [14.35355, 12.75, 9.75], + "rotation": {"angle": -45, "axis": "x", "origin": [8.35355, 13.25, 7.75]}, + "faces": { + "north": {"uv": [14, 2, 15, 4], "texture": "#0"}, + "east": {"uv": [16, 2, 14, 4], "texture": "#0"}, + "south": {"uv": [15, 2, 16, 4], "texture": "#0"}, + "west": {"uv": [14, 2, 16, 4], "texture": "#0"}, + "down": {"uv": [14, 3, 16, 4], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [2.35355, 12.75, 5.75], + "to": [14.35355, 14.75, 9.75], + "rotation": {"angle": -45, "axis": "x", "origin": [8.35355, 13.25, 7.75]}, + "faces": { + "north": {"uv": [12, 0, 13, 2], "texture": "#0"}, + "east": {"uv": [16, 0, 12, 2], "texture": "#0"}, + "south": {"uv": [15, 0, 16, 2], "texture": "#0"}, + "west": {"uv": [12, 0, 16, 2], "texture": "#0"}, + "up": {"uv": [12, 0, 16, 1], "rotation": 90, "texture": "#0"}, + "down": {"uv": [12, 1, 16, 2], "rotation": 270, "texture": "#0"} + } + }, + { + "name": "front", + "from": [3, 11, 3], + "to": [13, 16, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [8.33333, 8.5, 8]}, + "faces": { + "north": {"uv": [0, 5, 10, 0], "texture": "#4"}, + "east": {"uv": [0, 5, 10, 0], "texture": "#4"}, + "south": {"uv": [0, 5, 10, 0], "texture": "#4"}, + "west": {"uv": [0, 5, 10, 0], "texture": "#4"}, + "up": {"uv": [0, 5, 10, 15], "texture": "#4"}, + "down": {"uv": [6, 11, 11, 16], "texture": "#1"} + } + }, + { + "from": [3, 5, 5], + "to": [13, 11, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 5, 5]}, + "faces": { + "north": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "east": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "south": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "west": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "up": {"uv": [0, 0, 10, 6], "texture": "#1"}, + "down": {"uv": [0, 0, 10, 6], "texture": "#1"} + } + }, + { + "from": [5, 5, 3], + "to": [11, 11, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 5, 5]}, + "faces": { + "north": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "east": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "south": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "west": {"uv": [10, 0, 16, 6], "texture": "#1"}, + "up": {"uv": [0, 0, 6, 10], "texture": "#1"}, + "down": {"uv": [0, 0, 6, 10], "texture": "#1"} + } + }, + { + "from": [4, 5, 4], + "to": [12, 11, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 9, 4]}, + "faces": { + "north": {"uv": [4, 2, 12, 8], "texture": "#2"}, + "east": {"uv": [4, 2, 12, 8], "texture": "#2"}, + "south": {"uv": [4, 2, 12, 8], "texture": "#2"}, + "west": {"uv": [4, 2, 12, 8], "texture": "#2"}, + "up": {"uv": [0, 0, 8, 8], "texture": "#2"}, + "down": {"uv": [0, 0, 8, 8], "texture": "#2"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/destroy/models/item/creative_pump.json b/src/main/resources/assets/destroy/models/item/creative_pump.json new file mode 100644 index 000000000..c691d5427 --- /dev/null +++ b/src/main/resources/assets/destroy/models/item/creative_pump.json @@ -0,0 +1,3 @@ +{ + "parent": "destroy:block/creative_pump" +} \ No newline at end of file diff --git a/src/main/resources/assets/destroy/textures/block/creative_pump.png b/src/main/resources/assets/destroy/textures/block/creative_pump.png new file mode 100644 index 000000000..8842572b8 Binary files /dev/null and b/src/main/resources/assets/destroy/textures/block/creative_pump.png differ diff --git a/src/main/resources/data/destroy/recipes/mixing/paper_pulp.json b/src/main/resources/data/destroy/recipes/compacting/paper_pulp.json similarity index 87% rename from src/main/resources/data/destroy/recipes/mixing/paper_pulp.json rename to src/main/resources/data/destroy/recipes/compacting/paper_pulp.json index 2666533ca..e9692c7a3 100644 --- a/src/main/resources/data/destroy/recipes/mixing/paper_pulp.json +++ b/src/main/resources/data/destroy/recipes/compacting/paper_pulp.json @@ -1,5 +1,5 @@ { - "type": "create:mixing", + "type": "create:compacting", "ingredients": [ { "tag": "destroy:paper_pulpable" @@ -8,7 +8,7 @@ "mixtureFluidWithSalt": "destroy:mixture", "cation": "destroy:sodium_ion", "anion": "destroy:hydroxide", - "amount": 500, + "amount": 1, "concentration": 5.0 } ], diff --git a/src/main/resources/data/destroy/recipes/filling/aspirin_syringe.json b/src/main/resources/data/destroy/recipes/filling/aspirin_syringe.json index 5b471ed20..52b162f47 100644 --- a/src/main/resources/data/destroy/recipes/filling/aspirin_syringe.json +++ b/src/main/resources/data/destroy/recipes/filling/aspirin_syringe.json @@ -6,7 +6,7 @@ }, { "mixtureFluidWithMolecule": "destroy:mixture", - "amount": 200, + "amount": 1, "molecule": "destroy:aspirin", "concentration": 1.0 } diff --git a/src/main/resources/data/destroy/recipes/filling/cisplatin_syringe.json b/src/main/resources/data/destroy/recipes/filling/cisplatin_syringe.json index b83bcdde2..3b80e545e 100644 --- a/src/main/resources/data/destroy/recipes/filling/cisplatin_syringe.json +++ b/src/main/resources/data/destroy/recipes/filling/cisplatin_syringe.json @@ -6,7 +6,7 @@ }, { "mixtureFluidWithMolecule": "destroy:mixture", - "amount": 250, + "amount": 1, "molecule": "destroy:cisplatin", "concentration": 1.0 } diff --git a/src/main/resources/data/destroy/recipes/filling/dynamite.json b/src/main/resources/data/destroy/recipes/filling/dynamite.json index 27df98209..f9060c87a 100644 --- a/src/main/resources/data/destroy/recipes/filling/dynamite.json +++ b/src/main/resources/data/destroy/recipes/filling/dynamite.json @@ -6,7 +6,7 @@ }, { "mixtureFluidWithMolecule": "destroy:mixture", - "amount": 200, + "amount": 2, "molecule": "destroy:nitroglycerine", "concentration": 7.0 } diff --git a/src/main/resources/data/destroy/recipes/filling/magic_oxidant.json b/src/main/resources/data/destroy/recipes/filling/magic_oxidant.json deleted file mode 100644 index 60086cc98..000000000 --- a/src/main/resources/data/destroy/recipes/filling/magic_oxidant.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "create:filling", - "ingredients": [ - { - "item": "create:polished_rose_quartz" - }, - { - "fluid": "create:potion", - "nbt": { - "Bottle": "LINGERING", - "Potion": "minecraft:fire_resistance" - }, - "amount": 100 - } - ], - "results": [ - { - "item": "destroy:magic_oxidant" - } - ] - } \ No newline at end of file diff --git a/src/main/resources/data/destroy/recipes/filling/picric_acid.json b/src/main/resources/data/destroy/recipes/filling/picric_acid.json index a9510d850..516aeb81a 100644 --- a/src/main/resources/data/destroy/recipes/filling/picric_acid.json +++ b/src/main/resources/data/destroy/recipes/filling/picric_acid.json @@ -8,7 +8,7 @@ "mixtureFluidWithMolecule": "destroy:mixture", "molecule": "destroy:picric_acid", "concentration": 7.7, - "amount": 200 + "amount": 2 } ], "results": [ diff --git a/src/main/resources/data/destroy/recipes/filling/sunscreen_bottle.json b/src/main/resources/data/destroy/recipes/filling/sunscreen_bottle.json index 55bf956ac..499428f9e 100644 --- a/src/main/resources/data/destroy/recipes/filling/sunscreen_bottle.json +++ b/src/main/resources/data/destroy/recipes/filling/sunscreen_bottle.json @@ -6,7 +6,7 @@ }, { "mixtureFluidWithMolecule": "destroy:mixture", - "amount": 250, + "amount": 2, "molecule": "destroy:salicylic_acid", "concentration": 1.0 } diff --git a/src/main/resources/data/destroy/recipes/filling/tnt.json b/src/main/resources/data/destroy/recipes/filling/tnt.json index 9e8fd8a23..e606959eb 100644 --- a/src/main/resources/data/destroy/recipes/filling/tnt.json +++ b/src/main/resources/data/destroy/recipes/filling/tnt.json @@ -6,7 +6,7 @@ }, { "mixtureFluidWithMolecule": "destroy:mixture", - "amount": 200, + "amount": 2, "molecule": "destroy:tnt", "concentration": 7.3 }