11package com .illuminatijoe .refactorycore .machines .multiblock .generator ;
22
3- import com .illuminatijoe .refactorycore .data .materials .ReFactoryMaterials ;
4-
53import com .gregtechceu .gtceu .api .GTValues ;
6- import com .gregtechceu .gtceu .api .data .chemical .material .Material ;
74import com .gregtechceu .gtceu .api .machine .IMachineBlockEntity ;
85import com .gregtechceu .gtceu .api .machine .MetaMachine ;
96import com .gregtechceu .gtceu .api .machine .feature .ITieredMachine ;
1714import com .gregtechceu .gtceu .api .recipe .modifier .ModifierFunction ;
1815import com .gregtechceu .gtceu .api .recipe .modifier .ParallelLogic ;
1916import com .gregtechceu .gtceu .api .recipe .modifier .RecipeModifier ;
20- import com .gregtechceu .gtceu .common .data .GTMaterials ;
21- import com .gregtechceu .gtceu .data .recipe .builder .GTRecipeBuilder ;
17+ import com .gregtechceu .gtceu .config .ConfigHolder ;
2218import com .gregtechceu .gtceu .utils .FormattingUtil ;
2319import com .gregtechceu .gtceu .utils .GTMath ;
2420
25- import com .lowdragmc .lowdraglib .syncdata .annotation .DescSynced ;
2621import com .lowdragmc .lowdraglib .syncdata .field .ManagedFieldHolder ;
2722
2823import net .minecraft .ChatFormatting ;
24+ import net .minecraft .core .BlockPos ;
25+ import net .minecraft .core .Direction ;
2926import net .minecraft .network .chat .Component ;
27+ import net .minecraft .sounds .SoundEvents ;
28+ import net .minecraft .sounds .SoundSource ;
29+ import net .minecraft .util .RandomSource ;
3030import net .minecraftforge .fluids .FluidStack ;
3131
3232import lombok .Getter ;
@@ -41,39 +41,14 @@ public class LargeManaBurnerMachine extends WorkableElectricMultiblockMachine im
4141 protected static final ManagedFieldHolder MANAGED_FIELD_HOLDER = new ManagedFieldHolder (
4242 LargeManaBurnerMachine .class , WorkableMultiblockMachine .MANAGED_FIELD_HOLDER );
4343
44- private static final Material CLEANER = ReFactoryMaterials .MANA_CLEANER_FLUID ;
45-
4644 @ Getter
4745 private final int tier ;
4846
49- @ DescSynced
50- private int runningTimer = 0 ;
51- @ DescSynced
52- private double efficiency = 1 ; // [0, 1]
53- @ DescSynced
54- private double taint = 0 ; // [0, 1]
55-
5647 public LargeManaBurnerMachine (IMachineBlockEntity holder , int tier ) {
5748 super (holder );
5849 this .tier = tier ;
5950 }
6051
61- protected GTRecipe getCleanerRecipe () {
62- FluidStack cleaner = getCleanerFluidStack ();
63- FluidStack dirty = new FluidStack (GTMaterials .Lava .getFluid (), cleaner .getAmount ());
64-
65- return GTRecipeBuilder .ofRaw ()
66- .inputFluids (cleaner )
67- .outputFluids (dirty )
68- .buildRawRecipe ();
69- }
70-
71- private FluidStack getCleanerFluidStack () {
72- // 10mb when clean, 210mb when at 100% taint
73- int amount = 10 + (int ) (taint * taint * 200 );
74- return CLEANER .getFluid (amount );
75- }
76-
7752 @ Override
7853 public long getOverclockVoltage () {
7954 return GTValues .V [tier ];
@@ -102,12 +77,6 @@ public static ModifierFunction recipeModifier(@NotNull MetaMachine machine, @Not
10277 return ModifierFunction .NULL ;
10378 }
10479
105- private void updateEfficiency () {
106- // Clamp taint to [0,1]
107- taint = Math .min (1.0 , Math .max (taint , 0.0 ));
108- efficiency = 1.0 - taint ;
109- }
110-
11180 @ Override
11281 public boolean onWorking () {
11382 boolean value = super .onWorking ();
@@ -125,8 +94,8 @@ public boolean onWorking() {
12594 // updateEfficiency();
12695 // }
12796
128- runningTimer ++;
129- if (runningTimer > 72000 ) runningTimer %= 72000 ;
97+ // runningTimer++;
98+ // if (runningTimer > 72000) runningTimer %= 72000;
13099
131100 return value ;
132101 }
@@ -158,7 +127,7 @@ public void addDisplayText(List<Component> textList) {
158127
159128 builder .addFuelNeededLine (getRecipeFluidInputInfo (), recipeLogic .getDuration ());
160129 builder .addWorkingStatusLine ();
161- textList .add (Component .translatable ("tooltip.refactorycore.taint_amount" , (int ) (taint * 100 )));
130+ // textList.add(Component.translatable("tooltip.refactorycore.taint_amount", (int) (taint * 100)));
162131 }
163132
164133 @ Nullable
@@ -176,6 +145,33 @@ public String getRecipeFluidInputInfo() {
176145 return ChatFormatting .RED + FormattingUtil .formatNumbers (neededAmount ) + "mB" ;
177146 }
178147
148+ @ Override
149+ public void animateTick (RandomSource random ) {
150+ if (this .isActive ()) {
151+ final BlockPos pos = getPos ();
152+ float x = pos .getX () + 0.5F ;
153+ float z = pos .getZ () + 0.5F ;
154+
155+ final var facing = getFrontFacing ();
156+ final float horizontalOffset = GTValues .RNG .nextFloat () * 0.6F - 0.3F ;
157+ final float y = pos .getY () + GTValues .RNG .nextFloat () * 0.375F + 0.3F ;
158+
159+ if (facing .getAxis () == Direction .Axis .X ) {
160+ if (facing .getAxisDirection () == Direction .AxisDirection .POSITIVE ) x += 0.52F ;
161+ else x -= 0.52F ;
162+ z += horizontalOffset ;
163+ } else if (facing .getAxis () == Direction .Axis .Z ) {
164+ if (facing .getAxisDirection () == Direction .AxisDirection .POSITIVE ) z += 0.52F ;
165+ else z -= 0.52F ;
166+ x += horizontalOffset ;
167+ }
168+ if (ConfigHolder .INSTANCE .machines .machineSounds && GTValues .RNG .nextDouble () < 0.1 ) {
169+ getLevel ().playLocalSound (x , y , z , SoundEvents .FURNACE_FIRE_CRACKLE , SoundSource .BLOCKS , 1.0F , 1.0F ,
170+ false );
171+ }
172+ }
173+ }
174+
179175 @ Override
180176 public ManagedFieldHolder getFieldHolder () {
181177 return MANAGED_FIELD_HOLDER ;
0 commit comments