Skip to content

Commit

Permalink
Merge branch '1.20.1' into ldlib-dump
Browse files Browse the repository at this point in the history
  • Loading branch information
krossgg committed Sep 20, 2024
2 parents fd37ae4 + f4a01cb commit 11b347f
Show file tree
Hide file tree
Showing 197 changed files with 1,537 additions and 498 deletions.
1 change: 0 additions & 1 deletion .github/actions/build_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ runs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
cache-write-only: ${{ inputs.update-cache }}
generate-job-summary: false
gradle-home-cache-includes: |
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencyResolutionManagement {
def vineFlowerVersion = "1.+"
def macheteVersion = "1.+"
def configurationVersion = "2.2.0"
def ldLibVersion = "1.0.27.b"
def ldLibVersion = "1.0.28.a"
def mixinextrasVersion = "0.2.0"
def shimmerVersion = "0.2.4"
def lombokPluginVersion = "8.7.1"
Expand Down
6 changes: 6 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -2586,6 +2586,8 @@
"enchantment.gtceu.disjunction.desc": "˙sqoɯ pǝʇɐןǝɹ-ɹǝpuƎ oʇ ssǝuʍoןS puɐ ssǝuʞɐǝM sǝıןddⱯ",
"enchantment.gtceu.hard_hammer.desc": "˙ɹǝɯɯɐH ɥɔǝ⟘bǝɹ⅁ ɐ ɥʇıʍ pǝuıɯ ǝɹǝʍ ʎǝɥʇ ɟı sɐ sʞɔoןq sʞɐǝɹᗺ",
"enchantment.hard_hammer": "buıɹǝɯɯɐH",
"entity.gtceu.boat": "ʇɐoᗺ",
"entity.gtceu.chest_boat": "ʇɐoᗺ ʇsǝɥƆ",
"entity.gtceu.dynamite": "ǝʇıɯɐuʎᗡ",
"entity.gtceu.industrial_tnt": "⟘N⟘ ןɐıɹʇsnpuI",
"entity.gtceu.powderbarrel": "ןǝɹɹɐqɹǝpʍoԀ",
Expand Down Expand Up @@ -4716,6 +4718,8 @@
"item.gtceu.rotor_casting_mold.tooltip": "sɹoʇoᴚ buıʞɐɯ ɹoɟ pןoWㄥ§",
"item.gtceu.rotor_extruder_mold": ")ɹoʇoᴚ( pןoW ɹǝpnɹʇxƎ",
"item.gtceu.rotor_extruder_mold.tooltip": "sɹoʇoᴚ buıʞɐɯ ɹoɟ ǝdɐɥS ɹǝpnɹʇxƎㄥ§",
"item.gtceu.rubber_boat": "ʇɐoᗺ ɹǝqqnᴚ",
"item.gtceu.rubber_chest_boat": "ʇsǝɥƆ ɥʇıʍ ʇɐoᗺ ɹǝqqnᴚ",
"item.gtceu.rubber_gloves": "sǝʌoן⅁ ɹǝqqnᴚ",
"item.gtceu.salt_dust": "ʇןɐS",
"item.gtceu.saw_extruder_mold.tooltip": "sʍɐS buıʞɐɯ ɹoɟ ǝdɐɥS ɹǝpnɹʇxƎㄥ§",
Expand Down Expand Up @@ -4928,7 +4932,9 @@
"item.gtceu.tool.wrench.tooltip": "sǝuıɥɔɐW ǝןʇuɐɯsıp oʇ ʞɔıןɔ ʇɟǝן pןoH8§",
"item.gtceu.transistor": "ɹoʇsısuɐɹ⟘",
"item.gtceu.transistor.tooltip": "ʇuǝuodɯoƆ ɔıuoɹʇɔǝןƎ ɔısɐᗺㄥ§",
"item.gtceu.treated_wood_boat": "ʇɐoᗺ pooM pǝʇɐǝɹ⟘",
"item.gtceu.treated_wood_bolt": "ʞɔıʇS pooM pǝʇɐǝɹ⟘ ʇɹoɥS",
"item.gtceu.treated_wood_chest_boat": "ʇsǝɥƆ ɥʇıʍ ʇɐoᗺ pooM pǝʇɐǝɹ⟘",
"item.gtceu.treated_wood_dust": "dןnԀ pooM pǝʇɐǝɹ⟘",
"item.gtceu.treated_wood_plate": "ʞuɐןԀ pooM pǝʇɐǝɹ⟘",
"item.gtceu.treated_wood_rod": "ʞɔıʇS pooM pǝʇɐǝɹ⟘",
Expand Down
6 changes: 6 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2586,6 +2586,8 @@
"enchantment.gtceu.disjunction.desc": "Applies Weakness and Slowness to Ender-related mobs.",
"enchantment.gtceu.hard_hammer.desc": "Breaks blocks as if they were mined with a GregTech Hammer.",
"enchantment.hard_hammer": "Hammering",
"entity.gtceu.boat": "Boat",
"entity.gtceu.chest_boat": "Chest Boat",
"entity.gtceu.dynamite": "Dynamite",
"entity.gtceu.industrial_tnt": "Industrial TNT",
"entity.gtceu.powderbarrel": "Powderbarrel",
Expand Down Expand Up @@ -4716,6 +4718,8 @@
"item.gtceu.rotor_casting_mold.tooltip": "§7Mold for making Rotors",
"item.gtceu.rotor_extruder_mold": "Extruder Mold (Rotor)",
"item.gtceu.rotor_extruder_mold.tooltip": "§7Extruder Shape for making Rotors",
"item.gtceu.rubber_boat": "Rubber Boat",
"item.gtceu.rubber_chest_boat": "Rubber Boat with Chest",
"item.gtceu.rubber_gloves": "Rubber Gloves",
"item.gtceu.salt_dust": "Salt",
"item.gtceu.saw_extruder_mold.tooltip": "§7Extruder Shape for making Saws",
Expand Down Expand Up @@ -4928,7 +4932,9 @@
"item.gtceu.tool.wrench.tooltip": "§8Hold left click to dismantle Machines",
"item.gtceu.transistor": "Transistor",
"item.gtceu.transistor.tooltip": "§7Basic Electronic Component",
"item.gtceu.treated_wood_boat": "Treated Wood Boat",
"item.gtceu.treated_wood_bolt": "Short Treated Wood Stick",
"item.gtceu.treated_wood_chest_boat": "Treated Wood Boat with Chest",
"item.gtceu.treated_wood_dust": "Treated Wood Pulp",
"item.gtceu.treated_wood_plate": "Treated Wood Plank",
"item.gtceu.treated_wood_rod": "Treated Wood Stick",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/empty_tier_i/top",
"side": "gtceu:block/casings/battery/empty_tier_i/top",
"top": "gtceu:block/casings/battery/empty_tier_i/side"
"side": "gtceu:block/casings/battery/empty_tier_i/side",
"top": "gtceu:block/casings/battery/empty_tier_i/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/empty_tier_ii/top",
"side": "gtceu:block/casings/battery/empty_tier_ii/top",
"top": "gtceu:block/casings/battery/empty_tier_ii/side"
"side": "gtceu:block/casings/battery/empty_tier_ii/side",
"top": "gtceu:block/casings/battery/empty_tier_ii/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/empty_tier_iii/top",
"side": "gtceu:block/casings/battery/empty_tier_iii/top",
"top": "gtceu:block/casings/battery/empty_tier_iii/side"
"side": "gtceu:block/casings/battery/empty_tier_iii/side",
"top": "gtceu:block/casings/battery/empty_tier_iii/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/ev_lapotronic/top",
"side": "gtceu:block/casings/battery/ev_lapotronic/top",
"top": "gtceu:block/casings/battery/ev_lapotronic/side"
"side": "gtceu:block/casings/battery/ev_lapotronic/side",
"top": "gtceu:block/casings/battery/ev_lapotronic/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "minecraft:block/tnt_bottom",
"side": "gtceu:block/industrial_tnt_side",
"side": "gtceu:block/misc/industrial_tnt_side",
"top": "minecraft:block/tnt_top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/iv_lapotronic/top",
"side": "gtceu:block/casings/battery/iv_lapotronic/top",
"top": "gtceu:block/casings/battery/iv_lapotronic/side"
"side": "gtceu:block/casings/battery/iv_lapotronic/side",
"top": "gtceu:block/casings/battery/iv_lapotronic/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/luv_lapotronic/top",
"side": "gtceu:block/casings/battery/luv_lapotronic/top",
"top": "gtceu:block/casings/battery/luv_lapotronic/side"
"side": "gtceu:block/casings/battery/luv_lapotronic/side",
"top": "gtceu:block/casings/battery/luv_lapotronic/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/uhv_ultimate/top",
"side": "gtceu:block/casings/battery/uhv_ultimate/top",
"top": "gtceu:block/casings/battery/uhv_ultimate/side"
"side": "gtceu:block/casings/battery/uhv_ultimate/side",
"top": "gtceu:block/casings/battery/uhv_ultimate/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/uv_lapotronic/top",
"side": "gtceu:block/casings/battery/uv_lapotronic/top",
"top": "gtceu:block/casings/battery/uv_lapotronic/side"
"side": "gtceu:block/casings/battery/uv_lapotronic/side",
"top": "gtceu:block/casings/battery/uv_lapotronic/top"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:block/cube_bottom_top",
"textures": {
"bottom": "gtceu:block/casings/battery/zpm_lapotronic/top",
"side": "gtceu:block/casings/battery/zpm_lapotronic/top",
"top": "gtceu:block/casings/battery/zpm_lapotronic/side"
"side": "gtceu:block/casings/battery/zpm_lapotronic/side",
"top": "gtceu:block/casings/battery/zpm_lapotronic/top"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/rubber_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/rubber_chest_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/treated_wood_boat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtceu:item/treated_wood_chest_boat"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"values": [
"gtceu:rubber_log"
"gtceu:rubber_log",
"gtceu:stripped_rubber_log",
"gtceu:rubber_wood",
"gtceu:stripped_rubber_wood"
]
}
}
5 changes: 0 additions & 5 deletions src/main/java/com/gregtechceu/gtceu/api/addon/IGTAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ default void registerCovers() {}
*/
default void registerRecipeCapabilities() {}

/**
* Call init on your custom Recipe Conditions here
*/
default void registerRecipeConditions() {}

/**
* Call init on your custom IWorldGenLayer class(es) here
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.gregtechceu.gtceu.api.recipe.lookup.*;
import com.gregtechceu.gtceu.api.recipe.modifier.ParallelLogic;
import com.gregtechceu.gtceu.api.recipe.ui.GTRecipeTypeUI;
import com.gregtechceu.gtceu.common.recipe.ResearchCondition;
import com.gregtechceu.gtceu.common.recipe.condition.ResearchCondition;
import com.gregtechceu.gtceu.common.valueprovider.AddedFloat;
import com.gregtechceu.gtceu.common.valueprovider.CastedFloat;
import com.gregtechceu.gtceu.common.valueprovider.FlooredInt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gregtechceu.gtceu.api.capability.recipe;

import com.gregtechceu.gtceu.api.codec.DispatchedMapCodec;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.api.recipe.content.Content;
Expand All @@ -8,13 +9,15 @@
import com.gregtechceu.gtceu.api.recipe.lookup.AbstractMapIngredient;
import com.gregtechceu.gtceu.api.recipe.modifier.ParallelLogic;
import com.gregtechceu.gtceu.api.recipe.ui.GTRecipeTypeUI;
import com.gregtechceu.gtceu.api.registry.GTRegistries;

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 com.mojang.serialization.Codec;
import io.netty.buffer.Unpooled;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
Expand All @@ -29,6 +32,10 @@
*/
public abstract class RecipeCapability<T> {

public static final Codec<RecipeCapability<?>> DIRECT_CODEC = GTRegistries.RECIPE_CAPABILITIES.codec();
public static final Codec<Map<RecipeCapability<?>, List<Content>>> CODEC = new DispatchedMapCodec<>(
RecipeCapability.DIRECT_CODEC,
RecipeCapability::contentCodec);
public static final Comparator<RecipeCapability<?>> COMPARATOR = Comparator.comparingInt(o -> o.sortIndex);

public final String name;
Expand All @@ -46,6 +53,10 @@ protected RecipeCapability(String name, int color, boolean doRenderSlot, int sor
this.serializer = serializer;
}

public static Codec<List<Content>> contentCodec(RecipeCapability<?> capability) {
return Content.codec(capability).listOf();
}

/**
* deep copy of this content. recipe need it for searching and such things
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package com.gregtechceu.gtceu.api.codec;

import com.gregtechceu.gtceu.GTCEu;

import com.google.common.collect.ImmutableMap;
import com.mojang.datafixers.util.Pair;
import com.mojang.datafixers.util.Unit;
import com.mojang.serialization.*;
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap;

import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;

public record DispatchedMapCodec<K, V>(
Codec<K> keyCodec,
Function<K, Codec<? extends V>> valueCodecFunction)
implements Codec<Map<K, V>> {

@Override
public <T> DataResult<T> encode(final Map<K, V> input, final DynamicOps<T> ops, final T prefix) {
final RecordBuilder<T> mapBuilder = ops.mapBuilder();
for (final Map.Entry<K, V> entry : input.entrySet()) {
mapBuilder.add(keyCodec.encodeStart(ops, entry.getKey()),
encodeValue(valueCodecFunction.apply(entry.getKey()), entry.getValue(), ops));
}
return mapBuilder.build(prefix);
}

@SuppressWarnings("unchecked")
private <T, V2 extends V> DataResult<T> encodeValue(final Codec<V2> codec, final V input, final DynamicOps<T> ops) {
return codec.encodeStart(ops, (V2) input);
}

@Override
public <T> DataResult<Pair<Map<K, V>, T>> decode(final DynamicOps<T> ops, final T input) {
return ops.getMap(input).flatMap(map -> {
final Map<K, V> entries = new Object2ObjectArrayMap<>();
final Stream.Builder<Pair<T, T>> failed = Stream.builder();

final DataResult<Unit> finalResult = map.entries().reduce(
DataResult.success(Unit.INSTANCE, Lifecycle.stable()),
(result, entry) -> parseEntry(result, ops, entry, entries, failed),
(r1, r2) -> r1.apply2stable((u1, u2) -> u1, r2));

final Pair<Map<K, V>, T> pair = Pair.of(ImmutableMap.copyOf(entries), input);
final T errors = ops.createMap(failed.build());

return finalResult.map(ignored -> pair).setPartial(pair)
.mapError(error -> error + " missed input: " + errors);
});
}

private <T> DataResult<Unit> parseEntry(final DataResult<Unit> result, final DynamicOps<T> ops,
final Pair<T, T> input, final Map<K, V> entries,
final Stream.Builder<Pair<T, T>> failed) {
final DataResult<K> keyResult = keyCodec.parse(ops, input.getFirst());
final DataResult<V> valueResult = keyResult.map(valueCodecFunction)
.flatMap(valueCodec -> valueCodec.parse(ops, input.getSecond()).map(Function.identity()));
final DataResult<Pair<K, V>> entryResult = keyResult.apply2stable(Pair::of, valueResult);

final Optional<Pair<K, V>> entry = entryResult.resultOrPartial(GTCEu.LOGGER::error);
if (entry.isPresent()) {
final K key = entry.get().getFirst();
final V value = entry.get().getSecond();
if (entries.putIfAbsent(key, value) != null) {
failed.add(input);
return result.apply2stable((u, p) -> u,
DataResult.error(() -> "Duplicate entry for key: '" + key + "'"));
}
}
if (entryResult.error().isPresent()) {
failed.add(input);
}

return result.apply2stable((u, p) -> u, entryResult);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.level.Level;

import com.mojang.serialization.Codec;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
Expand All @@ -22,7 +23,10 @@
public class MedicalCondition {

public static final Map<String, MedicalCondition> CONDITIONS = new HashMap<>();
public static final Codec<MedicalCondition> CODEC = Codec.STRING.xmap(MedicalCondition.CONDITIONS::get,
MedicalCondition::getName);

@Getter
public final String name;
public final int color;
public final float maxProgression; // amount of seconds until maximum progression is reached
Expand Down
Loading

0 comments on commit 11b347f

Please sign in to comment.