Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
final cleanup and last minute bugfixes before 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cocona20xx committed Oct 19, 2022
1 parent c539afa commit 75925fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/main/java/cocona20xx/glowstick/EmissiveDataReloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class EmissiveDataReloader implements SimpleSynchronousResourceReloader {
private static final ArrayList<String> 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 {
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/cocona20xx/glowstick/GlowstickModClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<BakedQuad> 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);
Expand Down

0 comments on commit 75925fb

Please sign in to comment.