Skip to content

Commit 83ae710

Browse files
authored
Merge pull request #27 from Jab125/1.21.11
1.21.11 Fabric
2 parents b9c383d + 4ade6e1 commit 83ae710

36 files changed

Lines changed: 238 additions & 97 deletions

build.gradle

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,40 @@ dependencies {
5050
}
5151

5252
}
53+
54+
55+
stonecutter {
56+
replacements {
57+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
58+
replace("ResourceLocation", "Identifier")
59+
}
60+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
61+
replace("CommonNetwork.Identifier", "CommonNetwork.Identifier")
62+
}
63+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
64+
replace("Progress.Identifier", "Progress.Identifier")
65+
}
66+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
67+
replace("withSlotIdentifier", "withSlotIdentifier")
68+
}
69+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
70+
replace("record Identifier", "record Identifier")
71+
}
72+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
73+
replace("SlotsIdentifier", "SlotsIdentifier")
74+
}
75+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
76+
replace("IHasIdentifier", "IHasIdentifier")
77+
}
78+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
79+
replace("Identifier<T extends Payload>", "Identifier<T extends Payload>")
80+
}
81+
string(stonecutter.eval(stonecutter.current.version, ">=1.21.11")) {
82+
replace("import net.minecraft.Util;", "import net.minecraft.util.Util;")
83+
}
84+
}
85+
}
86+
5387
def aw = "${mod_id}-${stonecutter.eval(stonecutter.current.version, ">=1.21.2") ? 1212 : 120}.accesswidener"
5488

5589
loom {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle.kts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,35 @@ pluginManagement {
1010
}
1111

1212
plugins {
13-
id("dev.kikugie.stonecutter") version "0.7.6"
13+
id("dev.kikugie.stonecutter") version "0.8.1"
1414
}
1515

1616
stonecutter {
1717
create(rootProject) {
18-
vers("1.20.1-fabric", "1.20.1")
19-
vers("1.20.1-forge", "1.20.1")
20-
vers("1.20.4-fabric", "1.20.4")
21-
vers("1.20.4-forge", "1.20.4")
22-
vers("1.20.4-neoforge", "1.20.4")
23-
vers("1.21.1-fabric", "1.21.1")
24-
vers("1.21.1-forge", "1.21.1")
25-
vers("1.21.1-neoforge", "1.21.1")
26-
vers("1.21.3-fabric", "1.21.3")
27-
vers("1.21.3-forge", "1.21.3")
28-
vers("1.21.3-neoforge", "1.21.3")
29-
vers("1.21.4-fabric", "1.21.4")
30-
vers("1.21.4-forge", "1.21.4")
31-
vers("1.21.4-neoforge", "1.21.4")
32-
vers("1.21.5-fabric", "1.21.5")
33-
vers("1.21.5-forge", "1.21.5")
34-
vers("1.21.5-neoforge", "1.21.5")
35-
vers("1.21.8-fabric", "1.21.8")
36-
vers("1.21.8-forge", "1.21.8")
37-
vers("1.21.8-neoforge", "1.21.8")
38-
vers("1.21.10-fabric", "1.21.10")
39-
vers("1.21.10-forge", "1.21.10")
40-
vers("1.21.10-neoforge", "1.21.10")
18+
version("1.20.1-fabric", "1.20.1")
19+
version("1.20.1-forge", "1.20.1")
20+
version("1.20.4-fabric", "1.20.4")
21+
version("1.20.4-forge", "1.20.4")
22+
version("1.20.4-neoforge", "1.20.4")
23+
version("1.21.1-fabric", "1.21.1")
24+
version("1.21.1-forge", "1.21.1")
25+
version("1.21.1-neoforge", "1.21.1")
26+
version("1.21.3-fabric", "1.21.3")
27+
version("1.21.3-forge", "1.21.3")
28+
version("1.21.3-neoforge", "1.21.3")
29+
version("1.21.4-fabric", "1.21.4")
30+
version("1.21.4-forge", "1.21.4")
31+
version("1.21.4-neoforge", "1.21.4")
32+
version("1.21.5-fabric", "1.21.5")
33+
version("1.21.5-forge", "1.21.5")
34+
version("1.21.5-neoforge", "1.21.5")
35+
version("1.21.8-fabric", "1.21.8")
36+
version("1.21.8-forge", "1.21.8")
37+
version("1.21.8-neoforge", "1.21.8")
38+
version("1.21.10-fabric", "1.21.10")
39+
version("1.21.10-forge", "1.21.10")
40+
version("1.21.10-neoforge", "1.21.10")
41+
version("1.21.11-fabric", "1.21.11")
4142
vcsVersion = "1.20.4-fabric"
4243
}
4344
}

src/main/java/wily/factoryapi/FactoryAPI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static ResourceLocation createVanillaLocation(String path){
197197
//? if <1.20.5 {
198198
return new ResourceLocation(path);
199199
//?} else
200-
/*return ResourceLocation.withDefaultNamespace(path);*/
200+
//return ResourceLocation.withDefaultNamespace(path);
201201
}
202202

203203
public static Loader getLoader() {

src/main/java/wily/factoryapi/FactoryAPIClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
import net.minecraft.client.model.geom.builders.LayerDefinition;
3838
import net.minecraft.client.player.LocalPlayer;
3939
import net.minecraft.client.renderer.ItemBlockRenderTypes;
40+
//? if <1.21.11 {
4041
import net.minecraft.client.renderer.RenderType;
42+
//?} else {
43+
/*import net.minecraft.client.renderer.rendertype.RenderTypes;
44+
*///?}
4145
import net.minecraft.client.renderer.entity.EntityRenderer;
4246
import net.minecraft.client.renderer.entity.EntityRendererProvider;
4347
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
@@ -261,7 +265,7 @@ public static void init() {
261265
});
262266
//? if fabric {
263267
//? if >=1.21.9 {
264-
/*IFactoryItemClientExtension.map.forEach((i,c)-> ArmorRenderer.register((matrices, vertexConsumers, stack, entity, slot, light, contextModel)-> vertexConsumers.submitModel(c.getHumanoidArmorModel(entity,stack,slot,contextModel), entity, matrices, RenderType.entityCutout(((IFactoryItem) i).getArmorLocation(stack, slot)), light, OverlayTexture.NO_OVERLAY, 0xFFFFFF, null), i));
268+
/*IFactoryItemClientExtension.map.forEach((i,c)-> ArmorRenderer.register((matrices, vertexConsumers, stack, entity, slot, light, contextModel)-> vertexConsumers.submitModel(c.getHumanoidArmorModel(entity,stack,slot,contextModel), entity, matrices, /^?if <1.21.11 {^/RenderType/^?} else {^//^RenderTypes^//^?}^/.entityCutout(((IFactoryItem) i).getArmorLocation(stack, slot)), light, OverlayTexture.NO_OVERLAY, 0xFFFFFF, null), i));
265269
*///?} else {
266270
IFactoryItemClientExtension.map.forEach((i,c)-> ArmorRenderer.register((matrices, vertexConsumers, stack, entity, slot, light, contextModel)-> c.getHumanoidArmorModel(entity,stack,slot,contextModel).renderToBuffer(matrices,vertexConsumers.getBuffer(RenderType.entityCutout(((IFactoryItem) i).getArmorLocation(stack,/*? if <1.21.2 {*/ entity, /*?}*/slot))), light, OverlayTexture.NO_OVERLAY/*? if <=1.20.6 {*/, 1.0F,1.0F,1.0F, 1.0F/*?}*/),i));
267271
//?}

src/main/java/wily/factoryapi/FactoryAPIPlatform.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@
6565
import net.fabricmc.fabric.api.transfer.v1.storage.Storage;
6666
import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage;
6767
import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext;
68+
//? if <1.21.11 {
6869
import net.fabricmc.fabric.mixin.command.ArgumentTypesAccessor;
70+
//?} else {
71+
/*import net.fabricmc.fabric.mixin.command.ArgumentTypeInfosAccessor;
72+
*///?}
6973
import net.fabricmc.loader.api.FabricLoader;
7074
import net.fabricmc.loader.api.ModContainer;
7175
import net.fabricmc.loader.api.metadata.Person;
@@ -75,9 +79,6 @@
7579
import wily.factoryapi.base.fabric.FabricEnergyStoragePlatform;
7680
import wily.factoryapi.base.fabric.FabricFluidStoragePlatform;
7781
import wily.factoryapi.base.fabric.FabricItemStoragePlatform;
78-
//? if >=1.20.4 {
79-
import net.fabricmc.fabric.impl.resource.loader.FabricResourcePackProfile;
80-
//?}
8182
//?} elif neoforge {
8283
/*import net.neoforged.fml.ModList;
8384
import net.neoforged.neoforge.common.NeoForge;
@@ -436,7 +437,7 @@ static boolean isClient() {
436437

437438
static <A extends ArgumentType<?>, T extends ArgumentTypeInfo.Template<A>, I extends ArgumentTypeInfo<A, T>> void registerByClassArgumentType(Class<A> infoClass, I argumentTypeInfo) {
438439
//? if fabric {
439-
ArgumentTypesAccessor.fabric_getClassMap().put(infoClass,argumentTypeInfo);
440+
/*? if <1.21.11 {*/ArgumentTypesAccessor/*?} else {*//*ArgumentTypeInfosAccessor*//*?}*/.fabric_getClassMap().put(infoClass,argumentTypeInfo);
440441
//?} else if forge || neoforge {
441442
/*ArgumentTypeInfos.registerByClass(infoClass,argumentTypeInfo);
442443
*///?} else
@@ -712,6 +713,6 @@ public String getName() {
712713
}
713714

714715
static boolean isPackHidden(Pack pack) {
715-
return /*? if fabric && >=1.20.4 {*/ ((FabricResourcePackProfile)pack).fabric_isHidden() /*?} else {*/ /*false*//*?}*/;
716+
return /*? if fabric && >=1.20.4 && <1.21.11 {*/ ((net.fabricmc.fabric.impl.resource.loader.FabricResourcePackProfile)pack).fabric_isHidden() /*?} else {*/ /*false*//*?}*/;
716717
}
717718
}

src/main/java/wily/factoryapi/base/FactoryCapacityTier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import net.minecraft.network.chat.Component;
77
import net.minecraft.network.chat.MutableComponent;
88
//? if >=1.20.5
9-
/*import net.minecraft.network.codec.StreamCodec;*/
9+
//import net.minecraft.network.codec.StreamCodec;
1010
import net.minecraft.util.StringRepresentable;
1111
import wily.factoryapi.FactoryAPI;
1212

@@ -21,7 +21,7 @@ public enum FactoryCapacityTier implements StringRepresentable {
2121

2222
public static final Codec<FactoryCapacityTier> CODEC = StringRepresentable.fromEnum(FactoryCapacityTier::values);
2323
//? if >=1.20.5
24-
/*public static final StreamCodec<FriendlyByteBuf,FactoryCapacityTier> STREAM_CODEC = StreamCodec.of(FriendlyByteBuf::writeEnum, b->b.readEnum(FactoryCapacityTier.class));*/
24+
//public static final StreamCodec<FriendlyByteBuf,FactoryCapacityTier> STREAM_CODEC = StreamCodec.of(FriendlyByteBuf::writeEnum, b->b.readEnum(FactoryCapacityTier.class));
2525

2626
public final ChatFormatting formatting;
2727
private final double conductivity;

src/main/java/wily/factoryapi/base/FactoryItemEnergyStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void setEnergyStored(int energy) {
4949
//? if <1.20.5 {
5050
container.getOrCreateTag().putInt(KEY,energy);
5151
//?} else
52-
/*container.set(FactoryRegistries.ENERGY_COMPONENT.get(),energy);*/
52+
//container.set(FactoryRegistries.ENERGY_COMPONENT.get(),energy);
5353
}
5454
//? if <1.20.5 {
5555
@Override
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//? if >=1.21.11 {
2+
/*package wily.factoryapi.base;
3+
4+
import net.minecraft.client.gui.GuiGraphics;
5+
6+
public interface FactoryRenderingTextCollector {
7+
GuiGraphics getGuiGraphics();
8+
}
9+
*///?}

src/main/java/wily/factoryapi/base/IFactoryItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package wily.factoryapi.base;
22

33
//? if >=1.21.2
4-
/*import net.minecraft.core.component.DataComponents;*/
4+
//import net.minecraft.core.component.DataComponents;
55
import net.minecraft.resources.ResourceKey;
66
import net.minecraft.resources.ResourceLocation;
77
import net.minecraft.world.entity.Entity;
@@ -25,7 +25,7 @@ default <T extends IPlatformHandler> ArbitrarySupplier<T> getStorage(FactoryStor
2525
//?}
2626

2727
default @Nullable ResourceLocation getArmorLocation(ItemStack stack, /*? if <1.21.2 {*/Entity entity, /*?}*/ EquipmentSlot slot) {
28-
return /*? if <1.21.2 {*/null /*?} else if <1.21.4 {*/ /*stack.get(DataComponents.EQUIPPABLE).model().orElse(null)*//*?} else {*//*stack.get(DataComponents.EQUIPPABLE).assetId().map(ResourceKey::location).orElse(null)*//*?}*/;
28+
return /*? if <1.21.2 {*/null /*?} else if <1.21.4 {*/ /*stack.get(DataComponents.EQUIPPABLE).model().orElse(null)*//*?} else {*//*stack.get(DataComponents.EQUIPPABLE).assetId().map(ResourceKey::/^? if <1.21.11 {^/location/^?} else {^//^identifier^//^?}^/).orElse(null)*//*?}*/;
2929
}
3030

3131
default void clientExtension(Consumer<IFactoryItemClientExtension> clientExtensionConsumer){

0 commit comments

Comments
 (0)