-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add a KJS block type for renderer blocks. (#353) * add ability to create renderer blocks from KJS, make the simple machines' arrays match the tier indexes * do the same to KJS machine builders * Implementation of Machine Modes (#359) * first attempt at implementing machine modes screret pls help * fix the issue * next attempt for the configurator * latest commit * latest stuff * change activerecipetype to int * final touch + method rename * dev QoL stuffs * final commit * run data * js^3 support added --------- Co-authored-by: screret <[email protected]> * shit. these should stack. * Implementation of Gregicality Multiblocks (#369) * gcmb first additions * fix ABS (no textures tho) * slight refactor * blast alloy changes * fix molten fluid texture (it was easy) * more refactoring * first attempt at implementing machine modes screret pls help * fix the issue * next attempt for the configurator * latest commit * latest stuff * change activerecipetype to int * final touch + method rename * dev QoL stuffs * final commit * run data * js^3 support added * final touch * Update GTRecipeTypes.java * Update GTMachines.java * gcmb first additions * slight refactor * fix ABS (no textures tho) * blast alloy changes * fix molten fluid texture (it was easy) * more refactoring * first attempt at implementing machine modes screret pls help * fix the issue * next attempt for the configurator * latest stuff * change activerecipetype to int * final touch + method rename * js^3 support added * dev QoL stuffs * run data * gcmb first additions * slight refactor * fix ABS (no textures tho) * blast alloy changes * fix molten fluid texture (it was easy) * gcmb first additions * fix ABS (no textures tho) * blast alloy changes * fix molten fluid texture (it was easy) * fix some KJS builders having issues in array indexing, rebase to upstream * fix some KJS builders having issues in array indexing, rebase to upstream HOLY SHIT THIS WAS PAINFUL * add the parallel hatch, fix a lot of bugs, rename the casings to make sense, etc. run data. * parallel hatches + missing multis * finalized * requested fixes * datagen * more requested changes + datagen * Update common/src/main/java/com/gregtechceu/gtceu/common/data/GCyMMachines.java --------- Co-authored-by: screret <[email protected]> * it didnt build lol --------- Co-authored-by: Rundas <[email protected]>
- Loading branch information
Showing
562 changed files
with
6,178 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
common/src/main/java/com/gregtechceu/gtceu/api/capability/IParallelHatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.gregtechceu.gtceu.api.capability; | ||
|
||
public interface IParallelHatch { | ||
|
||
/** | ||
* | ||
* @return the current maximum amount of parallelization provided | ||
*/ | ||
int getCurrentParallel(); | ||
} |
11 changes: 11 additions & 0 deletions
11
common/src/main/java/com/gregtechceu/gtceu/api/data/chemical/fluid/FluidTypeMolten.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.gregtechceu.gtceu.api.data.chemical.fluid; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
public class FluidTypeMolten extends FluidTypeLiquid { | ||
|
||
public FluidTypeMolten(@Nonnull String name, @Nullable String prefix, @Nullable String suffix, @Nonnull String localization) { | ||
super(name, prefix, suffix, localization); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
.../java/com/gregtechceu/gtceu/api/data/chemical/material/properties/AlloyBlastProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.gregtechceu.gtceu.api.data.chemical.material.properties; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.gregtechceu.gtceu.data.recipe.misc.alloyblast.AlloyBlastRecipeProducer; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import net.minecraft.world.level.material.Fluid; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.function.Supplier; | ||
|
||
public class AlloyBlastProperty implements IMaterialProperty<AlloyBlastProperty> { | ||
|
||
/** | ||
* Internal material fluid field | ||
*/ | ||
private Supplier<? extends Fluid> fluidSupplier; | ||
private int temperature; | ||
|
||
@Getter | ||
@Setter | ||
@Nonnull | ||
private AlloyBlastRecipeProducer recipeProducer = AlloyBlastRecipeProducer.DEFAULT_PRODUCER; | ||
|
||
public AlloyBlastProperty(int temperature) { | ||
this.temperature = temperature; | ||
} | ||
|
||
@Override | ||
public void verifyProperty(MaterialProperties materialProperties) { | ||
materialProperties.ensureSet(PropertyKey.BLAST); | ||
materialProperties.ensureSet(PropertyKey.FLUID); | ||
this.temperature = materialProperties.getProperty(PropertyKey.BLAST).getBlastTemperature(); | ||
} | ||
|
||
/** | ||
* internal usage only | ||
*/ | ||
public void setFluid(@Nonnull Supplier<? extends Fluid> materialFluid) { | ||
Preconditions.checkNotNull(materialFluid); | ||
this.fluidSupplier = materialFluid; | ||
} | ||
|
||
public Fluid getFluid() { | ||
return fluidSupplier.get(); | ||
} | ||
|
||
public void setTemperature(int fluidTemperature) { | ||
Preconditions.checkArgument(fluidTemperature > 0, "Invalid temperature"); | ||
this.temperature = fluidTemperature; | ||
} | ||
|
||
public int getTemperature() { | ||
return temperature; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
...ava/com/gregtechceu/gtceu/api/machine/fancyconfigurator/MachineModeFancyConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package com.gregtechceu.gtceu.api.machine.fancyconfigurator; | ||
|
||
import com.gregtechceu.gtceu.api.gui.GuiTextures; | ||
import com.gregtechceu.gtceu.api.gui.fancy.IFancyConfigurator; | ||
import com.gregtechceu.gtceu.api.machine.feature.IRecipeLogicMachine; | ||
import com.gregtechceu.gtceu.utils.FormattingUtil; | ||
import com.lowdragmc.lowdraglib.gui.texture.IGuiTexture; | ||
import com.lowdragmc.lowdraglib.gui.texture.ResourceTexture; | ||
import com.lowdragmc.lowdraglib.gui.widget.SelectorWidget; | ||
import com.lowdragmc.lowdraglib.gui.widget.Widget; | ||
import com.lowdragmc.lowdraglib.gui.widget.WidgetGroup; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.chat.Component; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.function.BiConsumer; | ||
import java.util.function.Consumer; | ||
|
||
/** | ||
* @author Rundas/Screret | ||
* @implNote MachineModeFancyConfigurator | ||
*/ | ||
public class MachineModeFancyConfigurator implements IFancyConfigurator { | ||
protected IRecipeLogicMachine machine; | ||
|
||
public MachineModeFancyConfigurator(IRecipeLogicMachine machine) { | ||
this.machine = machine; | ||
} | ||
|
||
@Override | ||
public String getTitle() { | ||
return "gtceu.gui.machinemode.title"; | ||
} | ||
|
||
@Override | ||
public IGuiTexture getIcon() { | ||
return new ResourceTexture("gtceu:textures/item/lv_robot_arm.png"); | ||
} | ||
|
||
@Override | ||
public void writeInitialData(FriendlyByteBuf buffer) { | ||
buffer.writeVarInt(machine.getActiveRecipeType()); | ||
} | ||
|
||
@Override | ||
public void readInitialData(FriendlyByteBuf buffer) { | ||
machine.setActiveRecipeType(buffer.readVarInt()); | ||
} | ||
|
||
@Override | ||
public void detectAndSendChange(BiConsumer<Integer, Consumer<FriendlyByteBuf>> sender) { | ||
sender.accept(0, buf -> buf.writeVarInt(machine.getActiveRecipeType())); | ||
} | ||
|
||
@Override | ||
public void readUpdateInfo(int id, FriendlyByteBuf buffer) { | ||
if (id == 0) { | ||
machine.setActiveRecipeType(buffer.readVarInt()); | ||
} | ||
} | ||
|
||
@Override | ||
public Widget createConfigurator() { | ||
List<String> recipeTypeNames = Arrays.stream(machine.getRecipeTypes()).map(rt -> Component.translatable(rt.registryName.toLanguageKey()).getString()).toList(); | ||
return new WidgetGroup(0, 0, 140, 20 * recipeTypeNames.size()) { | ||
@Override | ||
public void initWidget() { | ||
super.initWidget(); | ||
setBackground(GuiTextures.BACKGROUND_INVERSE); | ||
addWidget(new SelectorWidget(2, 2, 136, 15, recipeTypeNames, -1).setOnChanged( | ||
rt -> { | ||
machine.setActiveRecipeType(recipeTypeNames.indexOf(rt)); | ||
machine.getRecipeLogic().resetRecipeLogic(); | ||
}).setSupplier(() -> { | ||
var index = recipeTypeNames.indexOf(Component.translatable(machine.getRecipeType().registryName.toLanguageKey()).getString()); | ||
return recipeTypeNames.get(Math.max(index, 0)); | ||
}) | ||
); | ||
} | ||
|
||
@Override | ||
public void writeInitialData(FriendlyByteBuf buffer) { | ||
buffer.writeVarInt(machine.getActiveRecipeType()); | ||
super.writeInitialData(buffer); | ||
} | ||
|
||
@Override | ||
public void readInitialData(FriendlyByteBuf buffer) { | ||
machine.setActiveRecipeType(buffer.readVarInt()); | ||
super.readInitialData(buffer); | ||
} | ||
|
||
@Override | ||
public void readUpdateInfo(int id, FriendlyByteBuf buffer) { | ||
super.readUpdateInfo(id, buffer); | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public List<Component> getTooltips() { | ||
List<Component> tooltip = new ArrayList<>(); | ||
tooltip.add(Component.literal("Change active Machine Mode")); | ||
return tooltip; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.