Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zhuhai Fishing Port from GTNH #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import gregtech.api.gui.GuiTextures;
import gregtech.api.gui.widgets.ProgressWidget;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.recipes.builders.SimpleRecipeBuilder;
import gregtech.api.unification.material.Materials;
import gregtech.core.sound.GTSoundEvents;

Expand All @@ -38,6 +39,12 @@ public final class ZBGTRecipeMaps {
}
});

public static final RecipeMap<SimpleRecipeBuilder> FISHING_PORT_RECIPES = new RecipeMap<>(
"fishing_port_recipes",
1, 16, 0, 0,
new SimpleRecipeBuilder(), false)
.setSound(GTSoundEvents.BATH);

public static void modifyMaps() {
POLARIZER_RECIPES.setMaxFluidInputs(1);
POLARIZER_RECIPES.setMaxFluidOutputs(1);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/zorbatron/zbgt/api/render/ZBGTTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class ZBGTTextures {
public static SimpleOverlayRenderer PRECISE_CASING_2;
public static SimpleOverlayRenderer PRECISE_CASING_3;
public static SimpleOverlayRenderer PRECISE_CASING_4;
public static SimpleOverlayRenderer AQUATIC_CASING;

public static SimpleOverlayRenderer IRIDIUM_CASING;

Expand Down Expand Up @@ -60,6 +61,7 @@ public static void preInit() {
PRECISE_CASING_2 = new SimpleOverlayRenderer("casings/precise/precise_2");
PRECISE_CASING_3 = new SimpleOverlayRenderer("casings/precise/precise_3");
PRECISE_CASING_4 = new SimpleOverlayRenderer("casings/precise/precise_4");
AQUATIC_CASING = new SimpleOverlayRenderer("casings/misc/aquatic");

IRIDIUM_CASING = new SimpleOverlayRenderer("casings/material/iridium");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static void register() {
EglinSteel = new Material.Builder(id++, zbgtId("eglin_steel"))
.ingot().liquid(new FluidBuilder().temperature(1320))
.color(0x8b4513).iconSet(METALLIC)
.flags(EXT_METAL, DECOMPOSITION_BY_CENTRIFUGING)
.flags(EXT_METAL, DECOMPOSITION_BY_CENTRIFUGING, GENERATE_FRAME)
.components(EglinSteelBase, 10, Sulfur, 1, Silicon, 4, Carbon, 1)
.build();
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/zorbatron/zbgt/common/ZBGTConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public static class RecipeSettings {
"Default: true" })
@Config.Name("CAL Circuit Recipes")
public boolean calCircuitRecipes = true;

@Config.Comment({ "Register Zhuhai recipes",
"Default: true" })
@Config.Name("Zhuhai Recipes")
public boolean zhuhaiRecipes = true;
}

@Config.Name("World Generation Settings")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public enum CasingType implements IStringSerializable {
COMPACT_FUSION_COIL_1("compact_fusion_coil_1"),
COMPACT_FUSION_COIL_2("compact_fusion_coil_2"),
COMPACT_FUSION_COIL_3("compact_fusion_coil_3"),
COMPACT_FUSION_COIL_4("compact_fusion_coil_4");
COMPACT_FUSION_COIL_4("compact_fusion_coil_4"),
AQUATIC_CASING("aquatic_casing");

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.zorbatron.zbgt.common.metatileentities.multi.MetaTileEntityYOTTank;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityCircuitAssemblyLine;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityCoAL;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.MetaTileEntityFishingPort;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.large.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.mega.*;
import com.zorbatron.zbgt.common.metatileentities.multi.electric.quad.*;
Expand Down Expand Up @@ -39,6 +40,7 @@ public class ZBGTMetaTileEntities {

public static MetaTileEntityCoAL CoAL;
public static MetaTileEntityCircuitAssemblyLine CAL;
public static MetaTileEntityFishingPort FISHING_PORT;

public static MetaTileEntityQueebf QUAD_EBF;
public static MetaTileEntityQueezer QUEEZER;
Expand Down Expand Up @@ -150,5 +152,8 @@ public static void init() {

CAL = registerMetaTileEntity(18070,
new MetaTileEntityCircuitAssemblyLine(zbgtId("cal")));

FISHING_PORT = registerMetaTileEntity(18074,
new MetaTileEntityFishingPort(zbgtId("fishing_port")));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package com.zorbatron.zbgt.common.metatileentities.multi.electric;

import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.jetbrains.annotations.NotNull;

import com.zorbatron.zbgt.api.recipes.ZBGTRecipeMaps;
import com.zorbatron.zbgt.api.render.ZBGTTextures;
import com.zorbatron.zbgt.common.block.ZBGTMetaBlocks;
import com.zorbatron.zbgt.common.block.blocks.MiscCasing;

import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController;
import gregtech.api.capability.impl.GhostCircuitItemStackHandler;
import gregtech.api.gui.GuiTextures;
import gregtech.api.gui.Widget;
import gregtech.api.gui.widgets.GhostCircuitSlotWidget;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.client.renderer.ICubeRenderer;

public class MetaTileEntityFishingPort extends GCYMRecipeMapMultiblockController {

private GhostCircuitItemStackHandler circuitSlot;

public MetaTileEntityFishingPort(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, ZBGTRecipeMaps.FISHING_PORT_RECIPES);
}

@Override
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityFishingPort(metaTileEntityId);
}

@Override
protected void initializeInventory() {
super.initializeInventory();

circuitSlot = new GhostCircuitItemStackHandler(this);
circuitSlot.addNotifiableMetaTileEntity(this);
}

@Override
protected void initializeAbilities() {
super.initializeAbilities();

this.inputInventory = circuitSlot;
}

@Override
protected @NotNull BlockPattern createStructurePattern() {
return FactoryBlockPattern.start()
.aisle("XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX")
.aisle("XXXXXXXXX", "XWWWWWWWX", "XWWWWWWWX").setRepeatable(7, 7)
.aisle("XXXXXXXXX", "XXXXSXXXX", "XXXXXXXXX")
.where('S', selfPredicate())
.where('X', states(getCasingState()).setMinGlobalLimited(64)
.or(autoAbilities(true, true, false, true, false, false, false)))
.where('W', any())
.build();
}

protected IBlockState getCasingState() {
return ZBGTMetaBlocks.MISC_CASING.getState(MiscCasing.CasingType.AQUATIC_CASING);
}

@Override
protected @NotNull Widget getFlexButton(int x, int y, int width, int height) {
return new GhostCircuitSlotWidget(circuitSlot, 0, x, y)
.setBackgroundTexture(GuiTextures.SLOT, GuiTextures.INT_CIRCUIT_OVERLAY)
.setConsumer(slotWidget -> slotWidget.setTooltipText("gregtech.gui.configurator_slot.tooltip",
circuitSlot.getCircuitValue() == GhostCircuitItemStackHandler.NO_CONFIG ?
new TextComponentTranslation("gregtech.gui.configurator_slot.no_value")
.getFormattedText() :
String.valueOf(circuitSlot.getCircuitValue())));
}

@SideOnly(Side.CLIENT)
@Override
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return ZBGTTextures.AQUATIC_CASING;
}

@Override
public boolean allowsExtendedFacing() {
return false;
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);

circuitSlot.write(data);

return data;
}

@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);

circuitSlot.read(data);
}
}
16 changes: 15 additions & 1 deletion src/main/java/com/zorbatron/zbgt/recipe/CasingRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
import com.zorbatron.zbgt.common.block.blocks.PreciseCasing;
import com.zorbatron.zbgt.common.items.ZBGTMetaItems;

import gregicality.multiblocks.api.unification.GCYMMaterials;
import gregtech.api.block.VariantBlock;
import gregtech.api.recipes.ModHandler;
import gregtech.api.recipes.builders.AssemblyLineRecipeBuilder;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.stack.UnificationEntry;
import gregtech.api.util.GTUtility;
import gregtech.common.ConfigHolder;
import gregtech.common.blocks.BlockFusionCasing;
Expand Down Expand Up @@ -276,10 +278,22 @@ private static void miscCasings() {
ModHandler.addShapedRecipe("yottank_casing",
ZBGTMetaBlocks.MISC_CASING.getItemVariant(MiscCasing.CasingType.YOTTANK_CASING,
casingsPerCraft),
"BPB", "TFT", "BPB",
"BPB",
"TFT",
"BPB",
'B', OreDictUnifier.get(plate, BlackSteel),
'P', OreDictUnifier.get(pipeNormalFluid, StainlessSteel),
'F', OreDictUnifier.get(frameGt, BlackSteel),
'T', OreDictUnifier.get(plate, Polytetrafluoroethylene));

ModHandler.addShapedRecipe("aquatic_casing",
ZBGTMetaBlocks.MISC_CASING.getItemVariant(MiscCasing.CasingType.AQUATIC_CASING,
casingsPerCraft),
"WhW",
"EFE",
"WwW",
'W', new UnificationEntry(plate, GCYMMaterials.WatertightSteel),
'E', new UnificationEntry(plate, EglinSteel),
'F', new UnificationEntry(frameGt, EglinSteel));
}
}
Loading