From 75925fbb105f0edaa06224b7dba14860ee072cab Mon Sep 17 00:00:00 2001 From: Cocona Date: Tue, 18 Oct 2022 21:58:07 -0400 Subject: [PATCH] final cleanup and last minute bugfixes before 0.1.0 --- src/main/java/cocona20xx/glowstick/EmissiveDataReloader.java | 5 +++-- src/main/java/cocona20xx/glowstick/GlowstickModClient.java | 1 - .../java/cocona20xx/glowstick/mixins/ItemRenderMixin.java | 4 +--- .../cocona20xx/glowstick/mixins/JsonUnbakedModelMixin.java | 3 --- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/cocona20xx/glowstick/EmissiveDataReloader.java b/src/main/java/cocona20xx/glowstick/EmissiveDataReloader.java index 164e6d4..e63840a 100644 --- a/src/main/java/cocona20xx/glowstick/EmissiveDataReloader.java +++ b/src/main/java/cocona20xx/glowstick/EmissiveDataReloader.java @@ -25,11 +25,11 @@ public class EmissiveDataReloader implements SimpleSynchronousResourceReloader { private static final ArrayList BLACKLIST_LIST = Lists.newArrayList(PARENT_BLACKLIST); public static final Identifier RELOADER_ID = new Identifier(GlowstickModClient.MOD_ID, "emissive"); public static final String ET_MEMBER_NAME = "emissive_textures"; - private static final String[] flags = {"layer0", "layer1", "layer2", "layer3", "layer4"}; + //private static final String[] flags = {"layer0", "layer1", "layer2", "layer3", "layer4"}; @Override public void reload(ResourceManager manager) { - GlowstickModClient.LOGGER.info("Starting Emissive Load..."); + GlowstickModClient.LOGGER.info("Loading Emissive Textures data..."); EMISSIVE_MAP.clear(); for(Identifier modelId : manager.findResources("models/item", path -> path.toString().endsWith(".json")).keySet()){ try { @@ -95,6 +95,7 @@ public static Identifier sanitizeValidId(Identifier toSanitize){ path = removeFirstIfValid(path, "models/"); path = removeFirstIfValid(path, "textures/"); path = removeFirstIfValid(path, "item"); + path = removeFirstIfValid(path, "/"); return new Identifier(toSanitize.getNamespace(), path); } diff --git a/src/main/java/cocona20xx/glowstick/GlowstickModClient.java b/src/main/java/cocona20xx/glowstick/GlowstickModClient.java index e3a8427..62fdd79 100644 --- a/src/main/java/cocona20xx/glowstick/GlowstickModClient.java +++ b/src/main/java/cocona20xx/glowstick/GlowstickModClient.java @@ -20,7 +20,6 @@ public class GlowstickModClient implements ClientModInitializer { public static final int EMISSIVE_MODIFIER = 200; @Override public void onInitializeClient(ModContainer mod) { - LOGGER.info("Glowstick is loading..."); ResourceLoader.get(ResourceType.CLIENT_RESOURCES).registerReloader(new EmissiveDataReloader()); ResourceLoader.get(ResourceType.CLIENT_RESOURCES).addReloaderOrdering(EmissiveDataReloader.RELOADER_ID, ResourceReloaderKeys.BEFORE_VANILLA); } diff --git a/src/main/java/cocona20xx/glowstick/mixins/ItemRenderMixin.java b/src/main/java/cocona20xx/glowstick/mixins/ItemRenderMixin.java index 0bc8226..916a6df 100644 --- a/src/main/java/cocona20xx/glowstick/mixins/ItemRenderMixin.java +++ b/src/main/java/cocona20xx/glowstick/mixins/ItemRenderMixin.java @@ -25,9 +25,7 @@ public int modifyLighting(MatrixStack.Entry matrixEntry, BakedQuad quad, float r if((wrap.getModifier() != 0 && block < 240)) { short mod = (short) (block + wrap.getModifier()); mod = GlowstickModClient.shortMin(mod, (short) 240); - //short finalMod = (short) (mod >> 4); - int combined = (sky << 16) | (mod & 0xFFFF); - return combined; + return (sky << 16) | (mod & 0xFFFF); } else return light; } diff --git a/src/main/java/cocona20xx/glowstick/mixins/JsonUnbakedModelMixin.java b/src/main/java/cocona20xx/glowstick/mixins/JsonUnbakedModelMixin.java index 064e38c..8eaf52b 100644 --- a/src/main/java/cocona20xx/glowstick/mixins/JsonUnbakedModelMixin.java +++ b/src/main/java/cocona20xx/glowstick/mixins/JsonUnbakedModelMixin.java @@ -27,9 +27,6 @@ public class JsonUnbakedModelMixin{ @Inject(method = "createQuad", at = @At("RETURN"), cancellable = true) private static void createQuadInjector(ModelElement element, ModelElementFace elementFace, Sprite sprite, Direction side, ModelBakeSettings settings, Identifier id, CallbackInfoReturnable cir){ BakedQuad initReturn = cir.getReturnValue(); - if(sprite.getId().toString().contains("test")){ - boolean useless = true; - } if(EmissiveDataReloader.checkValidity(EmissiveDataReloader.sanitizeValidId(sprite.getId()), EmissiveDataReloader.sanitizeValidId(id))){ BakedQuadAccessor bakedQuadAccessor = (BakedQuadAccessor)initReturn; bakedQuadAccessor.storeActual(initReturn);