diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67bb96bee..f1ecbc07a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,29 +3,28 @@ name: Universal Mod Core CI on: [push] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: '21' # The JDK version to make available on the path. - java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk - architecture: x64 # (x64 or x86) - defaults to x64 - - run: | - ref=`echo ${github_ref} | sed -e 's,refs/heads/,,' | tr '/' '-'` - echo $ref - echo "::set-env name=ref::$ref" - env: - github_ref: ${{ github.ref }} - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - name: keyscan - run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa teamopenindustry.cc >> ~/.ssh/known_hosts - - name: Gradle publish - env: - MAVENCI_PASS: ${{ secrets.MAVENCI_PASS }} - run: ./gradlew publish - - uses: actions/upload-artifact@v4 - with: - name: UniversalModCore-${{ env.ref }} - path: build/libs/UniversalModCore-*.jar + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + - run: | + ref=`echo ${github_ref} | sed -e 's,refs/heads/,,' | tr '/' '-'` + echo $ref + echo "::set-env name=ref::$ref" + env: + github_ref: ${{ github.ref }} + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + - name: keyscan + run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa teamopenindustry.cc >> ~/.ssh/known_hosts + - name: Gradle publish + env: + MAVENCI_PASS: ${{ secrets.MAVENCI_PASS }} + run: ./gradlew publish + - uses: actions/upload-artifact@v6 + with: + name: UniversalModCore-${{ env.ref }} + path: build/libs/UniversalModCore-*.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b83f2a7fe..52bedba21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,34 +3,57 @@ name: Universal Mod Core Release on: [workflow_dispatch] jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - branch: [1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge] - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - uses: actions/setup-java@v1 - with: - java-version: '1.8' # The JDK version to make available on the path. - java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk - architecture: x64 # (x64 or x86) - defaults to x64 - - run: | - ref=`echo ${github_ref} | sed -e 's,refs/heads/,,' | tr '/' '-'` - echo $ref - echo "::set-env name=ref::$ref" - env: - github_ref: ${{ github.ref }} - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - name: keyscan - run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa teamopenindustry.cc >> ~/.ssh/known_hosts - - name: Gradle publish - env: - MAVENCI_PASS: ${{ secrets.MAVENCI_PASS }} - run: ./gradlew publish -Dtarget=release - - uses: actions/upload-artifact@v4 - with: - name: UniversalModCore-${{ env.ref }} - path: build/libs/UniversalModCore-*.jar + build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - branch: 1.7.10-forge + java: 25 # RFG uses gradle 9 + - branch: 1.10.2-forge + java: 8 + - branch: 1.11.2-forge + java: 8 + - branch: 1.12.2-forge + java: 8 + - branch: 1.14.4-forge + java: 8 + - branch: 1.15.2-forge + java: 8 + - branch: 1.16.5-forge + java: 8 + - branch: 1.17.1-forge + java: 16 + - branch: 1.18.2-forge + java: 17 + - branch: 1.19.4-forge + java: 17 + - branch: 1.20.1-forge + java: 17 + - branch: 1.21.1-neoforge + java: 21 + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ matrix.branch }} + - uses: actions/setup-java@v5 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + - run: | + ref=`echo ${github_ref} | sed -e 's,refs/heads/,,' | tr '/' '-'` + echo $ref + echo "::set-env name=ref::$ref" + env: + github_ref: ${{ github.ref }} + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + - name: keyscan + run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa teamopenindustry.cc >> ~/.ssh/known_hosts + - name: Gradle publish + env: + MAVENCI_PASS: ${{ secrets.MAVENCI_PASS }} + run: ./gradlew publish -Dtarget=release + - uses: actions/upload-artifact@v6 + with: + name: UniversalModCore-${{ env.ref }} + path: build/libs/UniversalModCore-*.jar diff --git a/.gitignore b/.gitignore index 5a73809cc..c414f1210 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ build # other eclipse runs +logs # sketchup *.skb diff --git a/build.gradle b/build.gradle index 184e999de..7d4b2cd66 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ repositories { } } -String umcVersion = "1.3.0" +String umcVersion = "1.3.1" if (!"release".equalsIgnoreCase(System.getProperty("target"))) { try { umcVersion += "-${(providers.exec { commandLine("git", "rev-parse", "--verify", "--short=7", "HEAD") }.standardOutput.asText.get() as String).substring(0, 7)}" @@ -116,7 +116,7 @@ dependencies { // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" - + // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b13bd40f4..6db08db4e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip diff --git a/src/main/java/cam72cam/mod/ModCore.java b/src/main/java/cam72cam/mod/ModCore.java index bdf2763da..987fd43f2 100644 --- a/src/main/java/cam72cam/mod/ModCore.java +++ b/src/main/java/cam72cam/mod/ModCore.java @@ -63,7 +63,7 @@ public class ModCore { public static final String MODID = "universalmodcore"; public static final String NAME = "UniversalModCore"; - public static final String VERSION = "1.3.0"; + public static final String VERSION = "1.3.1"; public static ModCore instance; public static boolean hasResources; private static boolean isInReload; diff --git a/src/main/java/cam72cam/mod/entity/EntityRegistry.java b/src/main/java/cam72cam/mod/entity/EntityRegistry.java index 153915efc..761702062 100644 --- a/src/main/java/cam72cam/mod/entity/EntityRegistry.java +++ b/src/main/java/cam72cam/mod/entity/EntityRegistry.java @@ -20,6 +20,8 @@ import net.minecraftforge.api.distmarker.OnlyIn; import org.apache.commons.lang3.tuple.Pair; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.function.Supplier; @@ -100,7 +102,11 @@ public static void registerClientEvents() { if (w.isClientSide) { // Cleanup client side since mc does not call setDead client side... // See ClientEvents registration for related crap - for (net.minecraft.world.entity.Entity entity : ((ClientLevel) w).entitiesForRendering()) { + Iterable iter = ((ClientLevel) w).entitiesForRendering(); + if (iter instanceof Collection e) { + iter = new ArrayList<>(e); + } + for (net.minecraft.world.entity.Entity entity : iter) { if (entity instanceof ModdedEntity) { entity.remove(net.minecraft.world.entity.Entity.RemovalReason.DISCARDED); } diff --git a/src/main/java/cam72cam/mod/entity/ModdedEntity.java b/src/main/java/cam72cam/mod/entity/ModdedEntity.java index 7b7c6b754..e00b05489 100644 --- a/src/main/java/cam72cam/mod/entity/ModdedEntity.java +++ b/src/main/java/cam72cam/mod/entity/ModdedEntity.java @@ -10,6 +10,7 @@ import cam72cam.mod.serialization.*; import cam72cam.mod.util.SingleCache; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; @@ -120,6 +121,7 @@ private void load(TagCompound data) { } catch (SerializationException e) { ModCore.catching(e, "Error during entity load: %s - %s", this, data); } + applySavedVelocity(data); if (!this.level().isClientSide()) { getEntityData().set(ROLL, this.roll); @@ -574,6 +576,14 @@ public void setDeltaMovement(double x, double y, double z) { } } + private void applySavedVelocity(TagCompound data) { + ListTag vel = data.internal.getList("Motion", 6); + double x = vel.getDouble(0); + double y = vel.getDouble(1); + double z = vel.getDouble(2); + super.setDeltaMovement(x, y, z); + } + /* @Override public String getName() { diff --git a/src/main/java/cam72cam/mod/item/Fuzzy.java b/src/main/java/cam72cam/mod/item/Fuzzy.java index 2617d7498..4a630bc04 100644 --- a/src/main/java/cam72cam/mod/item/Fuzzy.java +++ b/src/main/java/cam72cam/mod/item/Fuzzy.java @@ -6,8 +6,11 @@ import net.minecraft.core.HolderSet; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; +import cam72cam.mod.util.RegistryUtil; import net.minecraft.resources.ResourceLocation; import cam72cam.mod.resource.BuiltinPack; +import cam72cam.mod.resource.Identifier; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; @@ -101,8 +104,8 @@ public class Fuzzy { " \"values\": []\n" + "}").getBytes(StandardCharsets.UTF_8); BuiltinPack.addNamespace("c"); - BuiltinPack.putData(ResourceLocation.parse("c:tags/items/ingots/steel.json"), data); - BuiltinPack.putData(ResourceLocation.parse("c:tags/items/storage_blocks/steel.json"), data); + BuiltinPack.putData(new Identifier("c:tags/items/ingots/steel.json"), data); + BuiltinPack.putData(new Identifier("c:tags/items/storage_blocks/steel.json"), data); } static Map registered; diff --git a/src/main/java/cam72cam/mod/render/ItemRender.java b/src/main/java/cam72cam/mod/render/ItemRender.java index 2d7971ce2..8a75a2822 100644 --- a/src/main/java/cam72cam/mod/render/ItemRender.java +++ b/src/main/java/cam72cam/mod/render/ItemRender.java @@ -4,19 +4,18 @@ import cam72cam.mod.MinecraftClient; import cam72cam.mod.ModCore; import cam72cam.mod.event.ClientEvents; +import cam72cam.mod.event.CommonEvents; import cam72cam.mod.gui.Progress; import cam72cam.mod.item.CustomItem; import cam72cam.mod.item.ItemStack; import cam72cam.mod.render.opengl.RenderContext; import cam72cam.mod.render.opengl.RenderState; +import cam72cam.mod.resource.BuiltinPack; import cam72cam.mod.resource.Identifier; import cam72cam.mod.util.With; import cam72cam.mod.world.World; -import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.pipeline.TextureTarget; import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.math.Transformation; -import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; @@ -28,14 +27,11 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.*; import net.minecraft.core.Direction; -import net.minecraft.resources.ResourceLocation; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.ItemLayerModel; -import net.minecraftforge.client.model.SimpleModelState; +import net.minecraftforge.client.model.*; import net.minecraftforge.client.model.geometry.IGeometryBakingContext; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.BufferUtils; @@ -46,21 +42,25 @@ import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; import java.util.function.BiConsumer; -import java.util.stream.Collectors; /** Item Render Registry (Here be dragons...) */ public class ItemRender { private static final List EMPTY = Collections.emptyList(); private static final SpriteSheet iconSheet = new SpriteSheet(Config.SpriteSize); - private static final Executor POOL = Executors.newFixedThreadPool(1); + //String template for simple item models + private static final String modelTemplate = "models/item/%s.json"; + private static final String jsonTemplate = """ + { + "parent": "minecraft:item/generated", + "textures": { + "layer0": "%s" + } + }"""; /** Register a simple image for an item */ public static void register(CustomItem item, Identifier tex) { @@ -130,8 +130,7 @@ public boolean isComponentVisible(String s, boolean b) { }, foo, ItemOverrides.EMPTY/*, tex.internal*/)); }); - ClientEvents.TEXTURE_STITCH.subscribe(list -> list.addSprite(tex.internal)); - ClientEvents.MODEL_CREATE.subscribe(() -> Minecraft.getInstance().getItemRenderer().getItemModelShaper().register(item.internal, new ModelResourceLocation(item.getRegistryName().internal, ""))); + ClientEvents.TEXTURE_STITCH.subscribe(evt -> evt.addSprite(tex.internal)); } /** Register a complex model for an item */ diff --git a/src/main/java/cam72cam/mod/resource/BuiltinPack.java b/src/main/java/cam72cam/mod/resource/BuiltinPack.java index cbb9ebe1d..d2e00215d 100644 --- a/src/main/java/cam72cam/mod/resource/BuiltinPack.java +++ b/src/main/java/cam72cam/mod/resource/BuiltinPack.java @@ -42,33 +42,33 @@ * */ @EventBusSubscriber(modid = ModCore.MODID) public class BuiltinPack { - private static final HashMap DIRECT_RESOURCES = new HashMap<>(); + private static final HashMap directResources = new HashMap<>(); //Stringified identifier, longer is better - private static final TreeMap REDIRECTS = + private static final TreeMap redirectors = new TreeMap<>((a, b) -> { int d = Integer.compare(b.length(), a.length()); return d != 0 ? d : a.compareTo(b); }); - private static final List> GENERATORS = new LinkedList<>(); - private static final HashMap CACHED_GENERATOR_RESULTS = new HashMap<>(); - private static final HashSet EXTRA_NAMESPACES = new HashSet<>(); + private static final List> generators = new LinkedList<>(); + private static final HashMap generatorMemento = new HashMap<>(); + private static final HashSet extraNamespaces = new HashSet<>(); static { addNamespace("universalmodcore"); } /** - * Registers a static resource. + * Registers a static client resource. *

* The given bytes are returned as-is whenever this identifier is requested. * If the same identifier is registered again, the latest value wins. */ public static void put(Identifier resource, byte[] content) { - DIRECT_RESOURCES.put(resource, content); + directResources.put(resource, content); } /** - * Registers a conditional resource generator. + * Registers a conditional client resource generator. *

* The function is called with the requested identifier and should return: *

    @@ -78,11 +78,11 @@ public static void put(Identifier resource, byte[] content) { * Generated results are cached after the first successful generation, until next resource reload. */ public static void conditional(Function func) { - GENERATORS.add(func); + generators.add(func); } /** - * Registers a resource path redirect. + * Registers a client resource path redirect. *

    * Any requested identifier whose string form starts with {@code requestedPrefix} * will be remapped back to {@code actualPrefix} (simple replacement). @@ -95,7 +95,7 @@ public static void redirect(Identifier requestedPrefix, Identifier actualPrefix) if (actual.startsWith(requested)) { throw new IllegalArgumentException("Attempting to redirect to child folders, this is not allowed! Redirect with full file name instead!"); } - REDIRECTS.put(requested, actual); + redirectors.put(requested, actual); } /** @@ -109,20 +109,6 @@ public static PackResources attach(File path) { } } - /** - * Internal, for putting datapack entries - */ - public static void putData(ResourceLocation location, byte[] content) { - InternalDataPack.data.put(location, content); - } - - /** - * Internal - */ - public static void addNamespace(String namespace) { - EXTRA_NAMESPACES.add(namespace); - } - /** * Internal */ @@ -165,6 +151,20 @@ public PackResources openFull(PackLocationInfo p_326241_, Pack.Metadata p_325959 }); } + /** + * Registers a static datapack entry + */ + public static void putData(Identifier resource, byte[] content) { + InternalDataPack.data.put(resource.internal, content); + } + + /** + * Add a processable namespace other than loaded mods + */ + public static void addNamespace(String namespace) { + extraNamespaces.add(namespace); + } + /** * Internal */ @@ -205,7 +205,7 @@ private static void loadModResource(ModCore.Mod mod, List packs) * Internal */ public static void reload() { - CACHED_GENERATOR_RESULTS.clear(); + generatorMemento.clear(); } /** @@ -241,11 +241,11 @@ private InputStream getResource(String resourcePath) { Identifier ident = nameToLocation(resourcePath); try { - if (DIRECT_RESOURCES.containsKey(ident)) { - return new ByteArrayInputStream(DIRECT_RESOURCES.get(ident)); + if (directResources.containsKey(ident)) { + return new ByteArrayInputStream(directResources.get(ident)); } - for (Map.Entry entry : REDIRECTS.entrySet()) { + for (Map.Entry entry : redirectors.entrySet()) { String src = ident.toString(); if (src.startsWith(entry.getKey())) { Identifier redirect = handleRedirect(ident, entry.getKey(), entry.getValue()); @@ -254,11 +254,10 @@ private InputStream getResource(String resourcePath) { } //It must already have been populated in hasResourceName if exists - if (CACHED_GENERATOR_RESULTS.containsKey(ident)) { - return new ByteArrayInputStream(CACHED_GENERATOR_RESULTS.get(ident)); + if (generatorMemento.containsKey(ident)) { + return new ByteArrayInputStream(generatorMemento.get(ident)); } - } catch (Exception ignored) { - } + } catch (Exception ignored) {} return null; } @@ -270,11 +269,11 @@ private boolean hasResource(String resourcePath) { Identifier ident = nameToLocation(resourcePath); - if (DIRECT_RESOURCES.containsKey(ident)) { + if (directResources.containsKey(ident)) { return true; } - for (Map.Entry entry : REDIRECTS.entrySet()) { + for (Map.Entry entry : redirectors.entrySet()) { //Check if it's start with any of the [to]s if (ident.toString().startsWith(entry.getKey()) && handleRedirect(ident, entry.getKey(), entry.getValue()).canLoad()) { @@ -282,15 +281,15 @@ && handleRedirect(ident, entry.getKey(), entry.getValue()).canLoad()) { } } - if (CACHED_GENERATOR_RESULTS.containsKey(ident)) { + if (generatorMemento.containsKey(ident)) { return true; } - synchronized (GENERATORS) { - for (Function generator : GENERATORS) { + synchronized (generators) { + for (Function generator : generators) { byte[] stream = generator.apply(ident); if (stream != null) { - CACHED_GENERATOR_RESULTS.put(ident, stream); + generatorMemento.put(ident, stream); return true; } } @@ -303,14 +302,14 @@ && handleRedirect(ident, entry.getKey(), entry.getValue()).canLoad()) { public void listResources(PackType type, String namespace, String pathIn, PackResources.ResourceOutput output) { //TODO list all redirect/conditional resources, may need new parameters in API? final String folder = pathIn + "/"; // Ensure folders - DIRECT_RESOURCES.forEach((k, v) -> { + directResources.forEach((k, v) -> { String path = k.getPath(); if(k.getDomain().equals(namespace) && path.startsWith(folder)) { output.accept(k.internal, () -> new ByteArrayInputStream(v)); } }); - CACHED_GENERATOR_RESULTS.forEach((k, v) -> { + generatorMemento.forEach((k, v) -> { String path = k.getPath(); if(k.getDomain().equals(namespace) && path.startsWith(folder)) { output.accept(k.internal, () -> new ByteArrayInputStream(v)); @@ -321,7 +320,7 @@ public void listResources(PackType type, String namespace, String pathIn, PackRe @Override public Set getNamespaces(PackType type) { Set collect = ModCore.instance.getLoadedMods().stream().map(ModCore.Mod::modID).collect(Collectors.toSet()); - collect.addAll(EXTRA_NAMESPACES); + collect.addAll(extraNamespaces); return collect; } @@ -340,12 +339,13 @@ public void close() { /** * Internal, Server side assets loading */ - public static InputStream loadServerResource(Identifier ident) throws IOException { - if (DIRECT_RESOURCES.containsKey(ident)) { - return new ByteArrayInputStream(DIRECT_RESOURCES.get(ident)); + @OnlyIn(Dist.DEDICATED_SERVER) + public static InputStream loadServerSideResource(Identifier ident) throws IOException { + if (directResources.containsKey(ident)) { + return new ByteArrayInputStream(directResources.get(ident)); } - for (Map.Entry entry : REDIRECTS.entrySet()) { + for (Map.Entry entry : redirectors.entrySet()) { String src = ident.toString(); if (src.startsWith(entry.getKey())) { Identifier redirect = handleRedirect(ident, entry.getKey(), entry.getValue()); @@ -353,16 +353,16 @@ public static InputStream loadServerResource(Identifier ident) throws IOExceptio } } - if (CACHED_GENERATOR_RESULTS.containsKey(ident)) { - return new ByteArrayInputStream(CACHED_GENERATOR_RESULTS.get(ident)); + if (generatorMemento.containsKey(ident)) { + return new ByteArrayInputStream(generatorMemento.get(ident)); } - synchronized (GENERATORS) { - for (Function generator : GENERATORS) { + synchronized (generators) { + for (Function generator : generators) { byte[] stream = generator.apply(ident); if (stream != null) { - CACHED_GENERATOR_RESULTS.put(ident, stream); - return new ByteArrayInputStream(CACHED_GENERATOR_RESULTS.get(ident)); + generatorMemento.put(ident, stream); + return new ByteArrayInputStream(generatorMemento.get(ident)); } } } @@ -438,7 +438,7 @@ public void listResources(PackType type, String namespace, String pathIn, PackRe @Override public Set getNamespaces(PackType type) { Set collect = ModCore.instance.getLoadedMods().stream().map(ModCore.Mod::modID).collect(Collectors.toSet()); - collect.addAll(EXTRA_NAMESPACES); + collect.addAll(extraNamespaces); return collect; } diff --git a/src/main/java/cam72cam/mod/resource/Data.java b/src/main/java/cam72cam/mod/resource/Data.java index 362052a5c..7c28ab97a 100644 --- a/src/main/java/cam72cam/mod/resource/Data.java +++ b/src/main/java/cam72cam/mod/resource/Data.java @@ -144,7 +144,7 @@ public List getResourceStreamAll(Identifier identifier) throws IOEx public static class ServerProxy extends DataProxy { private InputStream getEmbeddedResourceStream(Identifier location) throws IOException { //Check our custom logic first - InputStream stream = BuiltinPack.loadServerResource(location); + InputStream stream = BuiltinPack.loadServerSideResource(location); if (stream != null) { return stream; } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index e3a47e231..1f64feb51 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -29,4 +29,4 @@ public net.minecraft.world.phys.shapes.VoxelShape shape # shape public net.minecraft.util.math.shapes.VoxelShapeCube (Lnet/minecraft/world/phys/shapes/DiscreteVoxelShape;)V public net.minecraftforge.common.conditions.ConditionalOps context public com.mojang.blaze3d.platform.Lighting DIFFUSE_LIGHT_0 -public com.mojang.blaze3d.platform.Lighting DIFFUSE_LIGHT_1 \ No newline at end of file +public com.mojang.blaze3d.platform.Lighting DIFFUSE_LIGHT_1 diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 4cb4bd9b6..a20a29408 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -5,7 +5,7 @@ license="LGPL" [[mods]] modId="universalmodcore" -version="1.3.0" +version="1.3.1" displayName="Universal Mod Core" displayURL="https://github.com/TeamOpenIndustry/UniversalModCore" authors="cam72cam" diff --git a/src/main/resources/assets/minecraft/shaders/core/umc_core.vsh b/src/main/resources/assets/minecraft/shaders/core/umc_core.vsh index c5f882e10..b54223909 100644 --- a/src/main/resources/assets/minecraft/shaders/core/umc_core.vsh +++ b/src/main/resources/assets/minecraft/shaders/core/umc_core.vsh @@ -39,7 +39,7 @@ void main() { vertexColor = Color; lightMapColor = texelFetch(Sampler2, ivec2(15, 15), 0); } else { - vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, norm.xyz, Color); + vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, normalize(norm.xyz), Color); lightMapColor = texelFetch(Sampler2, UV2 / 16, 0); } diff --git a/src/main/resources/template/src/main/resources/META-INF/mods.toml b/src/main/resources/template/src/main/resources/META-INF/mods.toml index 09c0e4510..e3c31b6e0 100644 --- a/src/main/resources/template/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/template/src/main/resources/META-INF/mods.toml @@ -4,7 +4,7 @@ license="TODO" [[mods]] modId="#ID#" -version="${file.jarVersion}" +version="#VERSION#" displayName="#NAME#" [[dependencies.#ID#]]