mirror of
https://github.com/TeamMidnightDust/ThisRocks.git
synced 2025-12-17 03:15:09 +01:00
Fix polymer support in 1.21.4
You can now enjoy This Rocks on vanilla clients again :)
This commit is contained in:
@@ -37,10 +37,10 @@ public enum RockType {
|
||||
|
||||
public Identifier[] getVariations() {
|
||||
var variations = new Identifier[4];
|
||||
variations[0] = id("tiny_"+name);
|
||||
variations[1] = id("small_"+name);
|
||||
variations[2] = id("medium_"+name);
|
||||
variations[3] = id("large_"+name);
|
||||
variations[0] = id(name+"_tiny");
|
||||
variations[1] = id(name+"_small");
|
||||
variations[2] = id(name+"_medium");
|
||||
variations[3] = id(name+"_large");
|
||||
return variations;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import static eu.midnightdust.motschen.rocks.RocksMain.id;
|
||||
|
||||
@@ -32,18 +33,15 @@ public enum StickType {
|
||||
|
||||
public Identifier[] getVariations() {
|
||||
var variations = new Identifier[3];
|
||||
variations[0] = id("small_"+name);
|
||||
variations[1] = id("medium_"+name);
|
||||
variations[2] = id("large_"+name);
|
||||
variations[0] = id(name+"_stick_small");
|
||||
variations[1] = id(name+"_stick_medium");
|
||||
variations[2] = id(name+"_stick_large");
|
||||
return variations;
|
||||
}
|
||||
|
||||
public static StickType fromBlockName(String name) {
|
||||
return Arrays.stream(values()).filter(type -> name
|
||||
.replace("block.rocks.", "")
|
||||
.replace("small_", "")
|
||||
.replace("medium_", "")
|
||||
.replace("large_", "")
|
||||
.equals(type.getName())).findFirst().orElse(StickType.OAK);
|
||||
return Arrays.stream(StickType.values()).filter(woodType -> Objects.equals(woodType.getName(), name
|
||||
.replace("block.rocks.", "").replace("_stick", "")
|
||||
)).findFirst().orElse(StickType.OAK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import eu.pb4.polymer.core.api.item.PolymerItemGroupUtils;
|
||||
import eu.pb4.polymer.core.api.item.SimplePolymerItem;
|
||||
import eu.pb4.polymer.core.api.utils.PolymerSyncUtils;
|
||||
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
|
||||
import eu.pb4.polymer.resourcepack.extras.api.ResourcePackExtras;
|
||||
import eu.pb4.polymer.virtualentity.api.ElementHolder;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.BlockBoundAttachment;
|
||||
import eu.pb4.polymer.virtualentity.impl.HolderHolder;
|
||||
@@ -51,6 +52,9 @@ public class PolyUtil {
|
||||
if (PASSABLE_WATERLOGGED_BLOCK == null) SMALL_BLOCK = Blocks.BARRIER.getDefaultState().with(WATERLOGGED, true);
|
||||
|
||||
PolymerResourcePackUtils.addModAssets(MOD_ID);
|
||||
ResourcePackExtras.forDefault().addBridgedModelsFolder(id("block"), id("rocks"));
|
||||
ResourcePackExtras.forDefault().addBridgedModelsFolder(polymerId("block"), polymerId("polymer-rocks"));
|
||||
ResourcePackExtras.forDefault().addBridgedModelsFolder(polymerId("item"), polymerId("polymer-rocks"));
|
||||
|
||||
ItemDisplayNetherGeyserModel.initModels();
|
||||
ItemDisplayOverworldGeyserModel.initModels();
|
||||
|
||||
Reference in New Issue
Block a user