Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
updated antimatter, mostly finished large turbines
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 17, 2023
1 parent 9a6e8da commit 073a43f
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 91 deletions.
4 changes: 4 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/GregTechTags.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package muramasa.gregtech.data;

import muramasa.antimatter.util.AntimatterPlatformUtils;
import muramasa.antimatter.util.TagUtils;
import muramasa.gregtech.GTIRef;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.material.Fluid;

public class GregTechTags {
public static final TagKey<Fluid> STEAM = TagKey.create(Registry.FLUID_REGISTRY, new ResourceLocation((AntimatterPlatformUtils.isForge() ? "forge" : "c"), "steam"));
public static TagKey<Item> PLATES_IRON_ALUMINIUM = getTag("plates/ironaluminium");
public static TagKey<Item> CIRCUITS_BASIC = getTag("circuits/basic");
public static TagKey<Item> CIRCUITS_GOOD = getTag("circuits/good");
Expand Down
10 changes: 1 addition & 9 deletions common/src/main/java/muramasa/gregtech/data/Structures.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,7 @@ public static void init() {
StructureUtility.lazy(t -> ofBlock(t.getCasing())),
ofHatch(HATCH_FLUID_I),
ofHatch(HATCH_FLUID_O)))
.atElement('E', ofHatch(HATCH_DYNAMO, (t, world, pos, machine, handler) -> {
if (handler.getTile() instanceof TileEntityMachine<?> entityMachine){
if (t.getMachineTier().getVoltage() <= entityMachine.getMachineTier().getVoltage()){
t.addComponent(machine.getComponentId(), handler);
return true;
}
}
return false;
}))
.atElement('E', ofHatch(HATCH_DYNAMO))
.min(1, HATCH_FLUID_I, HATCH_FLUID_O).offset(1, 1, 0).build()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import java.util.List;

import static muramasa.gregtech.data.Materials.*;

public class ItemTurbineRotor extends MaterialTool {
public ItemTurbineRotor(String domain, AntimatterToolType type, AntimatterItemTier tier, Properties properties) {
super(domain, type, tier, properties);
Expand All @@ -40,6 +42,13 @@ public float getSpeed(){
return itemTier.getSpeed() * speedMultiplier();
}

public Material getRodMaterial(){
if (type == ToolTypes.TURBINE_ROTOR) return Titanium;
if (type == ToolTypes.LARGE_TURBINE_ROTOR) return TungstenSteel;
if (type == ToolTypes.HUGE_TURBINE_ROTOR) return Americium;
return Magnalium;
}

@Override
public void onGenericAddInformation(ItemStack stack, List<Component> tooltip, TooltipFlag flag) {
super.onGenericAddInformation(stack, tooltip, flag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void init() {
}
}
});
STEAM_FUELS.RB().fi(FluidIngredient.ofMB(Steam, 2)).add("steam",1,1);
STEAM_FUELS.RB().fi(Steam.getFluidTag(2)).add("steam",1,1);
HP_STEAM_FUELS.RB().fi(FluidIngredient.ofMB(SuperheatedSteam, 1)).add("superheated_steam", 1, 1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected void calculateDurations() {
EUt = activeRecipe.getPower();
return;
}
if (coilData.heat() >= activeRecipe.getSpecialValue()) {
if (coilData != null && coilData.heat() >= activeRecipe.getSpecialValue()) {
int heatDiv = (coilData.heat() - activeRecipe.getSpecialValue()) / 900;
if (activeRecipe.getPower() <= 16) {
EUt = (activeRecipe.getPower() * (1L << tier - 1) * (1L << tier - 1));
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,17 @@
import muramasa.antimatter.machine.event.IMachineEvent;
import muramasa.antimatter.machine.types.Machine;
import muramasa.antimatter.recipe.IRecipe;
import muramasa.antimatter.recipe.Recipe;
import muramasa.antimatter.tile.TileEntityMachine;
import muramasa.antimatter.util.AntimatterPlatformUtils;
import muramasa.gregtech.data.GregTechTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.ItemStack;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import tesseract.TesseractGraphWrappers;

import java.util.Collections;
import java.util.List;

import static muramasa.antimatter.machine.Tier.BRONZE;
import static muramasa.gregtech.data.Machines.STEAM_FORGE_HAMMER;

public class TileEntitySteamMachine extends TileEntityMachine<TileEntitySteamMachine> {

public static final TagKey<Fluid> STEAM = TagKey.create(Registry.FLUID_REGISTRY, new ResourceLocation((AntimatterPlatformUtils.isForge() ? "forge" : "c"), "steam"));

public TileEntitySteamMachine(Machine<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
recipeHandler.set(() -> new SteamMachineRecipeHandler(this));
Expand All @@ -48,7 +37,7 @@ public SteamMachineRecipeHandler(TileEntitySteamMachine tile) {

@Override
public boolean consumeResourceForRecipe(boolean simulate) {
return tile.fluidHandler.map(t -> t.consumeTaggedInput(STEAM, getPower() * TesseractGraphWrappers.dropletMultiplier, simulate).getFluidAmount() > 0)
return tile.fluidHandler.map(t -> t.consumeTaggedInput(GregTechTags.STEAM, getPower() * TesseractGraphWrappers.dropletMultiplier, simulate).getFluidAmount() > 0)
.orElse(false);
}
//Allow up to 16 .
Expand Down Expand Up @@ -88,7 +77,7 @@ public int getOverclock() {

@Override
public boolean accepts(FluidHolder stack) {
return stack.getFluid().builtInRegistryHolder().is(STEAM);
return stack.getFluid().builtInRegistryHolder().is(GregTechTags.STEAM);
}

@Override
Expand All @@ -102,7 +91,7 @@ public void onMachineEvent(IMachineEvent event, Object... data) {
if (event instanceof ContentEvent) {
if (event == ContentEvent.FLUID_INPUT_CHANGED) {
if (data != null && data.length > 0) {
if (data[0] instanceof FluidHolder && ((FluidHolder)data[0]).getFluid().builtInRegistryHolder().is(STEAM)) {
if (data[0] instanceof FluidHolder && ((FluidHolder)data[0]).getFluid().builtInRegistryHolder().is(GregTechTags.STEAM)) {
checkRecipe();
}
}
Expand Down

0 comments on commit 073a43f

Please sign in to comment.