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

Change Up Coils #357

Merged
merged 1 commit into from
Dec 16, 2021
Merged
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
14 changes: 1 addition & 13 deletions src/main/java/gregtech/api/pattern/TraceabilityPredicate.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import gregtech.api.metatileentity.multiblock.MultiblockControllerBase;
import gregtech.api.util.BlockInfo;
import gregtech.common.blocks.BlockWireCoil;
import gregtech.common.blocks.BlockWireCoil2;
import gregtech.common.blocks.MetaBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
Expand Down Expand Up @@ -40,21 +39,10 @@ public class TraceabilityPredicate {
}
blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos());
return true;
} else if ((blockState.getBlock() instanceof BlockWireCoil2)) {
BlockWireCoil2 blockWireCoil = (BlockWireCoil2) blockState.getBlock();
BlockWireCoil2.CoilType2 coilType = blockWireCoil.getState(blockState);
Object currentCoilType = blockWorldState.getMatchContext().getOrPut("CoilType", coilType);
if (!currentCoilType.toString().equals(coilType.getName())) {
blockWorldState.setError(new PatternStringError("gregtech.multiblock.pattern.error.coils"));
return false;
}
blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos());
return true;
}
return false;
}, ()-> ArrayUtils.addAll(
Arrays.stream(BlockWireCoil.CoilType.values()).map(type->new BlockInfo(MetaBlocks.WIRE_COIL.getState(type), null)).toArray(BlockInfo[]::new),
Arrays.stream(BlockWireCoil2.CoilType2.values()).map(type->new BlockInfo(MetaBlocks.WIRE_COIL2.getState(type), null)).toArray(BlockInfo[]::new)))
Arrays.stream(BlockWireCoil.CoilType.values()).map(type->new BlockInfo(MetaBlocks.WIRE_COIL.getState(type), null)).toArray(BlockInfo[]::new)))
.addTooltips("gregtech.multiblock.pattern.error.coils");


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ public static void register() {
public static Material Sapphire;
public static Material Scheelite;
public static Material Sodalite;
public static Material DiamericiumTitanium;
public static Material Tantalite;
public static Material Coke;

Expand Down Expand Up @@ -759,5 +758,4 @@ public static void register() {
public static Material BasalticMineralSand;
public static Material HSSE;
public static Material HSSS;
public static Material FluxedElectrum;
}
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ public static void register() {
.color(0x600000).iconSet(METALLIC)
.flags(EXT2_METAL, GENERATE_FRAME, GENERATE_RING, GENERATE_SPRING, GENERATE_SMALL_GEAR, GENERATE_ROTOR)
.element(Elements.Tr)
.cableProperties(GTValues.V[8], 1, 8)
.toolStats(20.0f, 6.0f, 10240, 21)
.build();

Expand All @@ -994,7 +995,6 @@ public static void register() {
.flags(EXT_METAL, GENERATE_FOIL, GENERATE_FINE_WIRE)
.element(Elements.Dr)
.toolStats(16.0f, 5.0f, 5120, 21)
.cableProperties(GTValues.V[8], 1, 8)
.fluidPipeProperties(100000, 2000, true)
.build();

Expand All @@ -1003,7 +1003,8 @@ public static void register() {
.color(0x9973BD).iconSet(SHINY)
.flags(GENERATE_FOIL)
.element(Elements.Ke)
.blastTemp(8600, GasTier.HIGH, VA[LuV], 1500)
.cableProperties(GTValues.V[7], 6, 4)
.blastTemp(7500, GasTier.HIGH, VA[LuV], 1500)
.build();

Adamantium = new Material.Builder(131, "adamantium")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,16 +504,7 @@ public static void register() {
.components(Aluminium, 3, Silicon, 3, Sodium, 4, Chlorine, 1)
.build();

DiamericiumTitanium = new Material.Builder(317, "diamericium_titanium")
.ingot(4).fluid()
.color(0x755280).iconSet(METALLIC)
.flags(GENERATE_FOIL)
.components(Americium, 2, Titanium, 1)
.toolStats(6.0f, 6.0f, 2200, 21)
.itemPipeProperties(32, 128)
.cableProperties(GTValues.V[10], 8, 16)
.blastTemp(10400, GasTier.HIGHER, VA[UV], 1600)
.build();
// FREE ID 317

Tantalite = new Material.Builder(318, "tantalite")
.dust(3).ore(2, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,7 @@ public static void register() {
.blastTemp(5000, GasTier.HIGH, VA[EV], 1500)
.build();

FluxedElectrum = new Material.Builder(2521, "fluxed_electrum")
.ingot(5).fluid()
.color(0xf2ef27).iconSet(METALLIC)
.flags(EXT2_METAL)
.components(Electrum, 1, NaquadahAlloy, 1, BlueSteel, 1, RedSteel, 1)
.toolStats(11.0f, 6.0f, 2100, 21)
.cableProperties(GTValues.V[8], 3, 2)
.itemPipeProperties(128, 16)
.blastTemp(9000, GasTier.HIGHER, VA[ZPM], 1000)
.build();
// FREE ID: 2521

IridiumMetalResidue = new Material.Builder(2522, "iridium_metal_residue")
.dust()
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/gregtech/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public static void registerBlocks(RegistryEvent.Register<Block> event) {
registry.register(MULTIBLOCK_CASING);
registry.register(TRANSPARENT_CASING);
registry.register(WIRE_COIL);
registry.register(WIRE_COIL2);
registry.register(FUSION_CASING);
registry.register(WARNING_SIGN);
registry.register(GRANITE);
Expand Down Expand Up @@ -141,7 +140,6 @@ public static void registerItems(RegistryEvent.Register<Item> event) {
registry.register(createItemBlock(MULTIBLOCK_CASING, VariantItemBlock::new));
registry.register(createItemBlock(TRANSPARENT_CASING, VariantItemBlock::new));
registry.register(createItemBlock(WIRE_COIL, VariantItemBlock::new));
registry.register(createItemBlock(WIRE_COIL2, VariantItemBlock::new));
registry.register(createItemBlock(FUSION_CASING, VariantItemBlock::new));
registry.register(createItemBlock(WARNING_SIGN, VariantItemBlock::new));
registry.register(createItemBlock(GRANITE, StoneItemBlock::new));
Expand Down Expand Up @@ -180,10 +178,6 @@ public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
TemperatureProperty.registerCoilType(values.getCoilTemperature(), values.getMaterial(),
String.format("tile.wire_coil.%s.name", values.getName()));
}
for (BlockWireCoil2.CoilType2 values : BlockWireCoil2.CoilType2.values()) {
TemperatureProperty.registerCoilType(values.getCoilTemperature(), values.getMaterial(),
String.format("tile.wire_coil2.%s.name", values.getName()));
}

//Registers Fusion tiers for the FusionEUToStartProperty
FusionEUToStartProperty.registerFusionTier(6, "(MK1)");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gregtech/common/blocks/BlockWireCoil.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public enum CoilType implements IStringSerializable {
TUNGSTENSTEEL("tungstensteel", 4500, 4, 2, Materials.TungstenSteel),
HSS_G("hss_g", 5400, 4, 4, Materials.HSSG),
NAQUADAH("naquadah", 7200, 8, 4, Materials.Naquadah),
NAQUADAH_ALLOY("naquadah_alloy", 9001, 8, 8, Materials.NaquadahAlloy),
FLUXED_ELECTRUM("fluxed_electrum", 10800, 16, 8, Materials.FluxedElectrum);
TRINIUM("trinium", 9001, 8, 8, Materials.Trinium),
TRITANIUM("tritanium", 10800, 16, 8, Materials.Tritanium);

private final String name;
//electric blast furnace properties
Expand Down
103 changes: 0 additions & 103 deletions src/main/java/gregtech/common/blocks/BlockWireCoil2.java

This file was deleted.

18 changes: 7 additions & 11 deletions src/main/java/gregtech/common/blocks/MetaBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
import gregtech.api.GregTechAPI;
import gregtech.api.block.machines.BlockMachine;
import gregtech.api.metatileentity.MetaTileEntityHolder;
import gregtech.client.renderer.handler.MetaTileEntityRenderer;
import gregtech.client.renderer.handler.MetaTileEntityTESR;
import gregtech.client.model.IModelSupplier;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.material.properties.FluidPipeProperties;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.unification.ore.StoneType;
import gregtech.client.model.IModelSupplier;
import gregtech.client.model.modelfactories.BakedModelHandler;
import gregtech.client.renderer.handler.MetaTileEntityRenderer;
import gregtech.client.renderer.handler.MetaTileEntityTESR;
import gregtech.client.renderer.pipe.CableRenderer;
import gregtech.client.renderer.pipe.FluidPipeRenderer;
import gregtech.client.renderer.pipe.ItemPipeRenderer;
import gregtech.common.blocks.foam.BlockFoam;
import gregtech.common.blocks.foam.BlockPetrifiedFoam;
import gregtech.client.model.modelfactories.BakedModelHandler;
import gregtech.common.blocks.wood.BlockGregLeaves;
import gregtech.common.blocks.wood.BlockGregLog;
import gregtech.common.blocks.wood.BlockGregPlank;
Expand All @@ -34,9 +37,6 @@
import gregtech.common.pipelike.itempipe.ItemPipeType;
import gregtech.common.pipelike.itempipe.tile.TileEntityItemPipe;
import gregtech.common.pipelike.itempipe.tile.TileEntityItemPipeTickable;
import gregtech.client.renderer.pipe.CableRenderer;
import gregtech.client.renderer.pipe.FluidPipeRenderer;
import gregtech.client.renderer.pipe.ItemPipeRenderer;
import it.unimi.dsi.fastutil.objects.ReferenceArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLog.EnumAxis;
Expand Down Expand Up @@ -90,7 +90,6 @@ private MetaBlocks() {
public static BlockMultiblockCasing MULTIBLOCK_CASING;
public static BlockGlassCasing TRANSPARENT_CASING;
public static BlockWireCoil WIRE_COIL;
public static BlockWireCoil2 WIRE_COIL2;
public static BlockFusionCasing FUSION_CASING;
public static BlockWarningSign WARNING_SIGN;
public static HermeticCasings HERMETIC_CASING;
Expand Down Expand Up @@ -151,8 +150,6 @@ public static void init() {
TRANSPARENT_CASING.setRegistryName("transparent_casing");
WIRE_COIL = new BlockWireCoil();
WIRE_COIL.setRegistryName("wire_coil");
WIRE_COIL2 = new BlockWireCoil2();
WIRE_COIL2.setRegistryName("wire_coil2");
FUSION_CASING = new BlockFusionCasing();
FUSION_CASING.setRegistryName("fusion_casing");
WARNING_SIGN = new BlockWarningSign();
Expand Down Expand Up @@ -337,7 +334,6 @@ public static void registerItemModels() {
registerItemModel(MULTIBLOCK_CASING);
registerItemModel(TRANSPARENT_CASING);
registerItemModel(WIRE_COIL);
registerItemModel(WIRE_COIL2);
registerItemModel(FUSION_CASING);
registerItemModel(WARNING_SIGN);
registerItemModel(HERMETIC_CASING);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/common/items/MetaItem1.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void registerSubItems() {
VOLTAGE_COIL_IV = addItem(101, "voltage_coil.iv").setMaterialInfo(new ItemMaterialInfo(new MaterialStack(Materials.Iridium, GTValues.M * 2), new MaterialStack(Materials.NeodymiumMagnetic, GTValues.M / 2)));
VOLTAGE_COIL_LUV = addItem(102, "voltage_coil.luv").setMaterialInfo(new ItemMaterialInfo(new MaterialStack(Materials.Osmiridium, GTValues.M * 2), new MaterialStack(Materials.SamariumMagnetic, GTValues.M / 2)));
VOLTAGE_COIL_ZPM = addItem(103, "voltage_coil.zpm").setMaterialInfo(new ItemMaterialInfo(new MaterialStack(Materials.Europium, GTValues.M * 2), new MaterialStack(Materials.SamariumMagnetic, GTValues.M / 2)));
VOLTAGE_COIL_UV = addItem(104, "voltage_coil.uv").setMaterialInfo(new ItemMaterialInfo(new MaterialStack(Materials.FluxedElectrum, GTValues.M * 2), new MaterialStack(Materials.SamariumMagnetic, GTValues.M / 2)));
VOLTAGE_COIL_UV = addItem(104, "voltage_coil.uv").setMaterialInfo(new ItemMaterialInfo(new MaterialStack(Materials.Tritanium, GTValues.M * 2), new MaterialStack(Materials.SamariumMagnetic, GTValues.M / 2)));

// ???: ID 111-125

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@
import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.pattern.MultiblockShapeInfo;
import gregtech.api.pattern.PatternMatchContext;
import gregtech.api.recipes.Recipe;
import gregtech.api.recipes.RecipeMaps;
import gregtech.api.recipes.recipeproperties.TemperatureProperty;
import gregtech.api.util.GTUtility;
import gregtech.client.renderer.ICubeRenderer;
import gregtech.client.renderer.texture.Textures;
import gregtech.api.util.GTUtility;
import gregtech.common.ConfigHolder;
import gregtech.common.blocks.BlockMetalCasing.MetalCasingType;
import gregtech.common.blocks.BlockWireCoil.CoilType;
import gregtech.common.blocks.BlockWireCoil2.CoilType2;
import gregtech.common.blocks.MetaBlocks;
import gregtech.common.metatileentities.MetaTileEntities;
import gregtech.api.pattern.MultiblockShapeInfo;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -70,13 +69,10 @@ protected void addDisplayText(List<ITextComponent> textList) {
protected void formStructure(PatternMatchContext context) {
super.formStructure(context);
Object type = context.get("CoilType");
if (type instanceof CoilType) {
if (type instanceof CoilType)
this.blastFurnaceTemperature = ((CoilType) type).getCoilTemperature();
} else if(type instanceof CoilType2) {
this.blastFurnaceTemperature = ((CoilType2) type).getCoilTemperature();
} else {
else
this.blastFurnaceTemperature = CoilType.CUPRONICKEL.getCoilTemperature();
}

this.blastFurnaceTemperature += 100 * Math.max(0, GTUtility.getTierByVoltage(getEnergyContainer().getInputVoltage()) - GTValues.MV);
}
Expand Down Expand Up @@ -165,9 +161,6 @@ public List<MultiblockShapeInfo> getMatchingShapes() {
Arrays.stream(CoilType.values())
.sorted(Comparator.comparingInt(CoilType::getLevel))
.forEach(coilType -> shapeInfo.add(builder.where('C', MetaBlocks.WIRE_COIL.getState(coilType)).build()));
Arrays.stream(CoilType2.values())
.sorted(Comparator.comparingInt(CoilType2::getLevel))
.forEach(coilType -> shapeInfo.add(builder.where('C', MetaBlocks.WIRE_COIL2.getState(coilType)).build()));
return shapeInfo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import gregtech.client.renderer.texture.Textures;
import gregtech.common.blocks.BlockMetalCasing.MetalCasingType;
import gregtech.common.blocks.BlockWireCoil.CoilType;
import gregtech.common.blocks.BlockWireCoil2.CoilType2;
import gregtech.common.blocks.MetaBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
Expand Down Expand Up @@ -57,9 +56,6 @@ protected void formStructure(PatternMatchContext context) {
if (coilType instanceof CoilType) {
this.heatingCoilLevel = ((CoilType) coilType).getLevel();
this.heatingCoilDiscount = ((CoilType) coilType).getEnergyDiscount();
} else if (coilType instanceof CoilType2) {
this.heatingCoilLevel = ((CoilType2) coilType).getLevel();
this.heatingCoilDiscount = ((CoilType2) coilType).getEnergyDiscount();
} else {
this.heatingCoilLevel = CoilType.CUPRONICKEL.getLevel();
this.heatingCoilDiscount = CoilType.CUPRONICKEL.getEnergyDiscount();
Expand Down
Loading