diff --git a/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java b/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java index 1a71a9d45..fc55751a0 100644 --- a/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java +++ b/src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java @@ -121,7 +121,7 @@ public class SuSyRecipeMaps { .setProgressBar(GuiTextures.PROGRESS_BAR_MIXER, ProgressWidget.MoveType.CIRCULAR) .setSound(GTSoundEvents.CENTRIFUGE); - public static final RecipeMap FLUIDIZED_BED_REACTOR_RECIPES = new RecipeMap<>("fluidized_bed_reactor", 2, 3, 3, 2, new CatalystRecipeBuilder(), false) + public static final RecipeMap FLUIDIZED_BED_REACTOR_RECIPES = new RecipeMap<>("fluidized_bed_reactor", 2, 3, 3, 3, new CatalystRecipeBuilder(), false) .setSlotOverlay(false, true, SusyGuiTextures.LARGE_REACTOR_FLUID_OVERLAY) .setSlotOverlay(true, true, SusyGuiTextures.LARGE_REACTOR_FLUID_OVERLAY) .setSlotOverlay(false, false, SusyGuiTextures.LARGE_REACTOR_ITEM_OVERLAY) @@ -295,7 +295,7 @@ public class SuSyRecipeMaps { .setProgressBar(GuiTextures.PROGRESS_BAR_ARC_FURNACE, ProgressWidget.MoveType.HORIZONTAL) .setSound(GTSoundEvents.FURNACE); - public static final RecipeMap PHASE_SEPARATOR = new RecipeMap<>("phase_separator", 0, 1, 2, 2, new PrimitiveRecipeBuilder(), false) + public static final RecipeMap PHASE_SEPARATOR = new RecipeMap<>("phase_separator", 0, 1, 2, 3, new PrimitiveRecipeBuilder(), false) .setProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT, ProgressWidget.MoveType.HORIZONTAL) .setSound(GTSoundEvents.BATH); diff --git a/src/main/java/supersymmetry/client/renderer/textures/SusyTextures.java b/src/main/java/supersymmetry/client/renderer/textures/SusyTextures.java index fa465778c..e920caa0a 100644 --- a/src/main/java/supersymmetry/client/renderer/textures/SusyTextures.java +++ b/src/main/java/supersymmetry/client/renderer/textures/SusyTextures.java @@ -4,8 +4,8 @@ import gregtech.client.renderer.texture.cube.SimpleCubeRenderer; import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer; import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer; -import supersymmetry.client.renderer.textures.custom.ExtenderRender; import gregtech.client.renderer.texture.custom.DrumRenderer; +import supersymmetry.client.renderer.textures.custom.ExtenderRender; public class SusyTextures { @@ -84,6 +84,7 @@ public SusyTextures(){ public static final SimpleOverlayRenderer SILICON_CARBIDE_CASING = new SimpleOverlayRenderer("multiblock_casing/silicon_carbide_casing"); public static final SimpleOverlayRenderer ULV_STRUCTURAL_CASING = new SimpleOverlayRenderer("multiblock_casing/ulv_structural_casing"); public static final SimpleOverlayRenderer SLAG_HOT = new SimpleOverlayRenderer("resource/slag_hot"); + public static final SimpleOverlayRenderer RESTRICTIVE_FILTER_FILTER_OVERLAY = new SimpleOverlayRenderer("cover/overlay_restrictive_filter"); public static final SimpleCubeRenderer MASONRY_BRICK = new SimpleCubeRenderer("gregtech:blocks/multiblock_casing/masonry_brick"); diff --git a/src/main/java/supersymmetry/common/blocks/SusyStoneVariantBlock.java b/src/main/java/supersymmetry/common/blocks/SusyStoneVariantBlock.java index bd5f4b091..fecebadc2 100644 --- a/src/main/java/supersymmetry/common/blocks/SusyStoneVariantBlock.java +++ b/src/main/java/supersymmetry/common/blocks/SusyStoneVariantBlock.java @@ -118,7 +118,8 @@ public enum StoneType implements IStringSerializable { SHALE("shale", MapColor.RED_STAINED_HARDENED_CLAY), SLATE("slate", MapColor.RED_STAINED_HARDENED_CLAY), SOAPSTONE("soapstone", MapColor.GRAY_STAINED_HARDENED_CLAY), - KIMBERLITE("kimberlite", MapColor.GRAY); + KIMBERLITE("kimberlite", MapColor.GRAY), + INDUSTRIAL_CONCRETE("industrial_concrete", MapColor.YELLOW_STAINED_HARDENED_CLAY); private final String name; public final MapColor mapColor; @@ -137,6 +138,7 @@ public OrePrefix getOrePrefix() { return switch (this) { case GABBRO, GNEISS, LIMESTONE, PHYLLITE, QUARTZITE, SHALE, SLATE, SOAPSTONE, KIMBERLITE -> OrePrefix.stone; + case INDUSTRIAL_CONCRETE -> OrePrefix.block; }; } @@ -151,6 +153,7 @@ public gregtech.api.unification.material.Material getMaterial() { case SLATE -> SusyMaterials.Slate; case SOAPSTONE -> Materials.Soapstone; case KIMBERLITE -> SusyMaterials.Kimberlite; + case INDUSTRIAL_CONCRETE -> Materials.Concrete; }; } } diff --git a/src/main/java/supersymmetry/common/covers/CoverRestrictive.java b/src/main/java/supersymmetry/common/covers/CoverRestrictive.java new file mode 100644 index 000000000..79e3e6d08 --- /dev/null +++ b/src/main/java/supersymmetry/common/covers/CoverRestrictive.java @@ -0,0 +1,100 @@ +package supersymmetry.common.covers; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.pipeline.IVertexOperation; +import codechicken.lib.vec.Cuboid6; +import codechicken.lib.vec.Matrix4; +import gregtech.api.capability.impl.ItemHandlerDelegate; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; +import gregtech.api.util.ItemStackHashStrategy; +import it.unimi.dsi.fastutil.objects.Object2IntArrayMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import org.jetbrains.annotations.NotNull; +import supersymmetry.api.recipes.catalysts.CatalystInfo; +import supersymmetry.client.renderer.textures.SusyTextures; + +import java.util.Map; + +public class CoverRestrictive extends CoverBase { + + protected ItemHandlerRestrictive itemHandler; + + public CoverRestrictive(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, + @NotNull EnumFacing attachedSide) { + super(definition, coverableView, attachedSide); + } + + @Override + public boolean canAttach(@NotNull CoverableView coverable, @NotNull EnumFacing enumFacing) { + return coverable.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, getAttachedSide()) != null; + } + + @Override + public T getCapability(@NotNull Capability capability, T defaultValue) { + if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { + if (defaultValue == null) { + return null; + } + IItemHandler delegate = (IItemHandler) defaultValue; + if (itemHandler == null || itemHandler.delegate != delegate) { + this.itemHandler = new ItemHandlerRestrictive(delegate); + } + return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemHandler); + } + return defaultValue; + } + + @Override + public boolean canPipePassThrough() { + return true; + } + + @Override + public void renderCover(@NotNull CCRenderState renderState, @NotNull Matrix4 translation, @NotNull IVertexOperation[] pipeline, + @NotNull Cuboid6 plateBox, @NotNull BlockRenderLayer renderLayer) { + SusyTextures.RESTRICTIVE_FILTER_FILTER_OVERLAY.renderSided(getAttachedSide(), plateBox, renderState, pipeline, translation); + } + + protected static class ItemHandlerRestrictive extends ItemHandlerDelegate { + private final Map map = new Object2IntOpenCustomHashMap<>(ItemStackHashStrategy.comparingAllButCount()); + + public ItemHandlerRestrictive(IItemHandler delegate) { + super(delegate); + } + + @NotNull + @Override + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { + if (stack.isEmpty() || stack.isItemEqual(getStackInSlot(slot))) { + return super.insertItem(slot, stack, simulate); + } + // Makes things more efficient for common items. + if (map.containsKey(stack)) { + int location = map.get(stack); + if (stack.isItemEqual(getStackInSlot(location))) { + return super.insertItem(location, stack, simulate); + } else { + map.remove(stack); + } + } + // If it's not already in the map of what goes where, we search if it happens to be anywhere already, for some reason. + for (int i = 0; i < getSlots(); i++) { + if (i != slot && stack.isItemEqual(getStackInSlot(i))) { + map.put(stack, i); + return super.insertItem(i, stack, simulate); + } + } + return super.insertItem(slot, stack, simulate); + } + } +} diff --git a/src/main/java/supersymmetry/common/covers/SuSyCoverBehaviors.java b/src/main/java/supersymmetry/common/covers/SuSyCoverBehaviors.java index 67ed95677..67f948d66 100644 --- a/src/main/java/supersymmetry/common/covers/SuSyCoverBehaviors.java +++ b/src/main/java/supersymmetry/common/covers/SuSyCoverBehaviors.java @@ -22,6 +22,8 @@ public static void init() { registerBehavior(SuSyUtility.susyId("air_vent"), SuSyMetaItems.AIR_VENT, (definition, coverableView, attachedSide) -> new CoverAirVent(definition, coverableView, attachedSide, 100)); + + registerBehavior(SuSyUtility.susyId("restrictive_filter"), SuSyMetaItems.RESTRICTIVE_FILTER, CoverRestrictive::new); } } diff --git a/src/main/java/supersymmetry/common/item/SuSyMetaItems.java b/src/main/java/supersymmetry/common/item/SuSyMetaItems.java index 8a34c3ba3..4cd3cbf67 100644 --- a/src/main/java/supersymmetry/common/item/SuSyMetaItems.java +++ b/src/main/java/supersymmetry/common/item/SuSyMetaItems.java @@ -21,6 +21,7 @@ public class SuSyMetaItems { public static MetaValueItem CONVEYOR_STEAM; public static MetaValueItem PUMP_STEAM; public static MetaValueItem AIR_VENT; + public static MetaValueItem RESTRICTIVE_FILTER; public static MetaValueItem TRACK_SEGMENT; public static ArmorMetaItem.ArmorMetaValueItem JET_WINGPACK; @@ -58,6 +59,8 @@ private static void initMetaItem() { TRACK_SEGMENT = metaItem.addItem(5, "track_segment").addComponents(new TooltipBehavior((lines) -> { lines.add(I18n.format("metaitem.track_segment.length_info")); })); + + RESTRICTIVE_FILTER = metaItem.addItem(6, "restrictive_filter"); } private static void addTieredOredictItem (OreDictValueItem[] items, int id, int RGB, OrePrefix prefix) { diff --git a/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java b/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java index 7c4e2bb15..8d33f82ce 100644 --- a/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java +++ b/src/main/java/supersymmetry/common/metatileentities/SuSyMetaTileEntities.java @@ -14,6 +14,7 @@ import gregtech.common.blocks.MetaBlocks; import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityEnergyHatch; import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityMultiFluidHatch; +import gregtech.common.metatileentities.storage.MetaTileEntityCrate; import gregtech.common.metatileentities.storage.MetaTileEntityDrum; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -80,6 +81,8 @@ public class SuSyMetaTileEntities { public static MetaTileEntityPlasticCan PTFE_CAN; public static MetaTileEntityPlasticCan UHMWPE_CAN; + public static MetaTileEntityCrate HERMETICALLY_SEALED_CRATE; + //Machines for chem overhaul public static ContinuousMachineMetaTileEntity[] CONTINUOUS_STIRRED_TANK_REACTOR; public static ContinuousMachineMetaTileEntity[] FIXED_BED_REACTOR; @@ -205,6 +208,8 @@ public static void init() { SINTERING_OVEN = registerMetaTileEntity(14521, new MetaTileEntitySinteringOven(susyId("sintering_oven"))); + HERMETICALLY_SEALED_CRATE = registerMetaTileEntity(14522, new MetaTileEntityCrate(susyId("crate.pe"), Materials.Polyethylene, 54)); + registerSimpleSteamMTE(STEAM_VULCANIZING_PRESS, 14515, "vulcanizing_press", SuSyRecipeMaps.VULCANIZATION_RECIPES, SuSySteamProgressIndicators.COMPRESS, SusyTextures.VULCANIZING_PRESS_OVERLAY, true); registerCatalystMTE(VULCANIZING_PRESS, 3, 14517, "vulcanizing_press", SuSyRecipeMaps.VULCANIZATION_RECIPES, SusyTextures.VULCANIZING_PRESS_OVERLAY, true); diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityFluidizedBedReactor.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityFluidizedBedReactor.java index 46993e983..fad7ddea5 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityFluidizedBedReactor.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityFluidizedBedReactor.java @@ -44,7 +44,7 @@ protected BlockPattern createStructurePattern() { .where('S', this.selfPredicate()) .where('F', frames(Materials.Steel)) .where('P', states(this.getPipeCasingState())) - .where('X', states(this.getCasingState()).setMinGlobalLimited(18) + .where('X', states(this.getCasingState()).setMinGlobalLimited(17) .or(this.autoAbilities(true, true, true, true, true, true, false))) .build(); } diff --git a/src/main/resources/assets/gregtech/models/item/metaitems/restrictive_filter.json b/src/main/resources/assets/gregtech/models/item/metaitems/restrictive_filter.json new file mode 100644 index 000000000..6d5feb10c --- /dev/null +++ b/src/main/resources/assets/gregtech/models/item/metaitems/restrictive_filter.json @@ -0,0 +1,6 @@ +{ + "parent" : "item/generated", + "textures" : { + "layer0" : "gregtech:items/metaitems/restrictive_filter" + } +} diff --git a/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_restrictive_filter.png b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_restrictive_filter.png new file mode 100644 index 000000000..245fdd66e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/cover/overlay_restrictive_filter.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete.png b/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete.png new file mode 100644 index 000000000..10fa23ba8 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete_bricks.png b/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete_bricks.png new file mode 100644 index 000000000..fa05599cf Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete_bricks.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete_cobble.png b/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete_cobble.png new file mode 100644 index 000000000..191d39203 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/susy_stones/industrial_concrete_cobble.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/metaitems/restrictive_filter.png b/src/main/resources/assets/gregtech/textures/items/metaitems/restrictive_filter.png new file mode 100644 index 000000000..9b5e7dd63 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/metaitems/restrictive_filter.png differ diff --git a/src/main/resources/assets/susy/blockstates/susy_stone_bricks.json b/src/main/resources/assets/susy/blockstates/susy_stone_bricks.json index 98554ee57..a0884b2f5 100644 --- a/src/main/resources/assets/susy/blockstates/susy_stone_bricks.json +++ b/src/main/resources/assets/susy/blockstates/susy_stone_bricks.json @@ -59,6 +59,11 @@ "textures" : { "all" : "gregtech:blocks/susy_stones/kimberlite_bricks" } + }, + "industrial_concrete" : { + "textures" : { + "all" : "gregtech:blocks/susy_stones/industrial_concrete_bricks" + } } } } diff --git a/src/main/resources/assets/susy/blockstates/susy_stone_cobble.json b/src/main/resources/assets/susy/blockstates/susy_stone_cobble.json index f4930f520..eb6c36584 100644 --- a/src/main/resources/assets/susy/blockstates/susy_stone_cobble.json +++ b/src/main/resources/assets/susy/blockstates/susy_stone_cobble.json @@ -59,6 +59,11 @@ "textures" : { "all" : "gregtech:blocks/susy_stones/kimberlite_cobble" } + }, + "industrial_concrete" : { + "textures" : { + "all" : "gregtech:blocks/susy_stones/industrial_concrete_cobble" + } } } } diff --git a/src/main/resources/assets/susy/blockstates/susy_stone_smooth.json b/src/main/resources/assets/susy/blockstates/susy_stone_smooth.json index 9cfa03399..50e556030 100644 --- a/src/main/resources/assets/susy/blockstates/susy_stone_smooth.json +++ b/src/main/resources/assets/susy/blockstates/susy_stone_smooth.json @@ -59,6 +59,11 @@ "textures" : { "all" : "gregtech:blocks/susy_stones/kimberlite" } + }, + "industrial_concrete" : { + "textures" : { + "all" : "gregtech:blocks/susy_stones/industrial_concrete" + } } } } diff --git a/src/main/resources/assets/susy/lang/en_us.lang b/src/main/resources/assets/susy/lang/en_us.lang index df7361e3d..265a21374 100644 --- a/src/main/resources/assets/susy/lang/en_us.lang +++ b/src/main/resources/assets/susy/lang/en_us.lang @@ -112,6 +112,7 @@ tile.susy_stone_smooth.shale.name=Shale tile.susy_stone_smooth.slate.name=Slate tile.susy_stone_smooth.soapstone.name=Soapstone tile.susy_stone_smooth.kimberlite.name=Kimberlite +tile.susy_stone_smooth.industrial_concrete.name=Industrial Concrete tile.susy_stone_cobble.gabbro.name=Gabbro Cobblestone tile.susy_stone_cobble.gneiss.name=Gneiss Cobblestone tile.susy_stone_cobble.graphite.name=Graphite Cobblestone @@ -123,6 +124,7 @@ tile.susy_stone_cobble.shale.name=Shale Cobblestone tile.susy_stone_cobble.slate.name=Slate Cobblestone tile.susy_stone_cobble.soapstone.name=Soapstone Cobblestone tile.susy_stone_cobble.kimberlite.name=Kimberlite Cobblestone +tile.susy_stone_cobble.industrial_concrete.name=Industrial Concrete Cobblestone tile.susy_stone_bricks.gabbro.name=Gabbro Bricks tile.susy_stone_bricks.gneiss.name=Gneiss Bricks tile.susy_stone_bricks.graphite.name=Graphite Bricks @@ -134,6 +136,7 @@ tile.susy_stone_bricks.shale.name=Shale Bricks tile.susy_stone_bricks.slate.name=Slate Bricks tile.susy_stone_bricks.soapstone.name=Soapstone Bricks tile.susy_stone_bricks.kimberlite.name=Kimberlite Bricks +tile.susy_stone_bricks.industrial_concrete.name=Industrial Concrete Bricks # Materials susy.material.manganese_iron_arsenic_phosphide=Manganese Iron Arsenic Phosphide @@ -214,6 +217,8 @@ gregtech.machine.drum.pp.name=Polypropylene (PP) Can gregtech.machine.drum.ptfe.name=Polytetrafluoroethylene (PTFE) Can gregtech.machine.drum.uhmwpe.name=Ultra High Molecular Weight Polyethylene (UHMWPE) Can +gregtech.machine.crate.pe.name=Hermetically Sealed Crate + gregtech.machine.polymerization_tank.name=Polymerization Tank gregtech.machine.fluidized_bed_reactor.name=Fluidized Bed Reactor @@ -792,6 +797,8 @@ cover.conveyor.steam.title=Steam Conveyor Module metaitem.pump.steam.name=Steam Pump cover.pump.steam.title=Steam Pump metaitem.air_vent.name=Air Vent +metaitem.restrictive_filter.name=Restrictive Item Filter +metaitem.restrictive_filter.tooltip=Allows only §6one stack§7 of any type of item inside. Can replace robot arms. %n§oHere you may come, but no further.§r §7Job 38:11 metaitem.air_vent.tooltip=Passively collects a Dimension's Air for your Machines when facing Air metaitem.track_segment.name=Monorail Track Segment metaitem.track_segment.tooltip=For use in the §8tunnelbore.