Skip to content

Commit

Permalink
Merge branch 'cryo-dt-fixes' of https://github.com/trainvoi/Susy-Core
Browse files Browse the repository at this point in the history
…into cryo-dt-fixes
  • Loading branch information
trainvoi committed Jan 7, 2025
2 parents 3896d10 + 7125906 commit 422aee8
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public class SuSyRecipeMaps {
.setProgressBar(GuiTextures.PROGRESS_BAR_MIXER, ProgressWidget.MoveType.CIRCULAR)
.setSound(GTSoundEvents.CENTRIFUGE);

public static final RecipeMap<CatalystRecipeBuilder> FLUIDIZED_BED_REACTOR_RECIPES = new RecipeMap<>("fluidized_bed_reactor", 2, 3, 3, 2, new CatalystRecipeBuilder(), false)
public static final RecipeMap<CatalystRecipeBuilder> 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)
Expand Down Expand Up @@ -295,7 +295,7 @@ public class SuSyRecipeMaps {
.setProgressBar(GuiTextures.PROGRESS_BAR_ARC_FURNACE, ProgressWidget.MoveType.HORIZONTAL)
.setSound(GTSoundEvents.FURNACE);

public static final RecipeMap<PrimitiveRecipeBuilder> PHASE_SEPARATOR = new RecipeMap<>("phase_separator", 0, 1, 2, 2, new PrimitiveRecipeBuilder(), false)
public static final RecipeMap<PrimitiveRecipeBuilder> PHASE_SEPARATOR = new RecipeMap<>("phase_separator", 0, 1, 2, 3, new PrimitiveRecipeBuilder(), false)
.setProgressBar(GuiTextures.PROGRESS_BAR_EXTRACT, ProgressWidget.MoveType.HORIZONTAL)
.setSound(GTSoundEvents.BATH);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
};
}

Expand All @@ -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;
};
}
}
Expand Down
100 changes: 100 additions & 0 deletions src/main/java/supersymmetry/common/covers/CoverRestrictive.java
Original file line number Diff line number Diff line change
@@ -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> T getCapability(@NotNull Capability<T> 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<ItemStack, Integer> 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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
3 changes: 3 additions & 0 deletions src/main/java/supersymmetry/common/item/SuSyMetaItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent" : "item/generated",
"textures" : {
"layer0" : "gregtech:items/metaitems/restrictive_filter"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"textures" : {
"all" : "gregtech:blocks/susy_stones/kimberlite_bricks"
}
},
"industrial_concrete" : {
"textures" : {
"all" : "gregtech:blocks/susy_stones/industrial_concrete_bricks"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"textures" : {
"all" : "gregtech:blocks/susy_stones/kimberlite_cobble"
}
},
"industrial_concrete" : {
"textures" : {
"all" : "gregtech:blocks/susy_stones/industrial_concrete_cobble"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"textures" : {
"all" : "gregtech:blocks/susy_stones/kimberlite"
}
},
"industrial_concrete" : {
"textures" : {
"all" : "gregtech:blocks/susy_stones/industrial_concrete"
}
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/assets/susy/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 422aee8

Please sign in to comment.