Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ho ho hotfix #324

Merged
merged 37 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
baaabbc
Stop using Scala arrays
Desoroxxx Dec 18, 2023
40666dd
Fix skins
Desoroxxx Dec 18, 2023
6bcf961
Delete Drum100rndMag.png
Desoroxxx Dec 18, 2023
f5a5a5e
Fix `postflat.frag` shader
Desoroxxx Dec 18, 2023
aeeb477
Fix `postflat.frag` shader for real this time
Desoroxxx Dec 18, 2023
c61162a
#150 Patched to hot-fix version
Paneedah Dec 18, 2023
82065b8
Merge branch 'main' into Ho-ho-hotfix
Desoroxxx Dec 18, 2023
aa0aecc
Merge branch 'Ho-ho-hotfix' of https://github.com/Cubed-Development/Mโ€ฆ
Desoroxxx Dec 18, 2023
3077d34
Fix non standard missing texture
Desoroxxx Dec 19, 2023
9d6086d
Fixed fog rendering ignoring if fog should render
Desoroxxx Dec 21, 2023
a3113f3
Fixed multiple `ResourceLocation` in the `PostProcessPipeline`
Desoroxxx Dec 21, 2023
9050673
Fixed depth testing being disabled in the world post processing
Desoroxxx Dec 21, 2023
1d27989
Fixed the issue where fog was hardcoded to be disabled
Desoroxxx Dec 21, 2023
bb29908
Fixed world post processing never rendering due to bandage fix
Desoroxxx Dec 21, 2023
28434c7
Fixed world post processing causing a white screen
Desoroxxx Dec 21, 2023
f642b32
Added missing JVM arg
Desoroxxx Dec 21, 2023
5ba1700
Fixed core mod
Desoroxxx Dec 21, 2023
54e4e73
Removed now useless knockback bandage fix
Desoroxxx Dec 21, 2023
92c0e2d
Multiple config related lang fixes
Desoroxxx Dec 21, 2023
ee87e06
Fixed Bloom
Desoroxxx Dec 21, 2023
d166334
Changed default `filmGrain` config from `0.025` to `0.03`
Desoroxxx Dec 21, 2023
0089207
Changed default `onScreenRainAndSnow` config from `false` to `true`
Desoroxxx Dec 21, 2023
382fa09
Changed default `enableFancyRainAndSnow` config from `false` to `true`
Desoroxxx Dec 21, 2023
142e7e0
Add todo
Desoroxxx Dec 21, 2023
7dd0353
Fixed fancy rain and snow never replacing vanilla rain and snow
Desoroxxx Dec 21, 2023
8a8e101
Added new fancy rain splash to go with the fancy rain
Desoroxxx Dec 21, 2023
7edb7d0
Make weather render switching more robust
Desoroxxx Dec 21, 2023
1a12b45
Fixed entities not having a prefix causing collisions with other mods
Desoroxxx Dec 21, 2023
72c7e1e
Fixed skins again
Desoroxxx Dec 21, 2023
cee2236
Fixed ammunition press animating even when it wasn't actively crafting
Desoroxxx Dec 21, 2023
53e9170
Fixed ammunition press setting the ammunition of the magazines after โ€ฆ
Desoroxxx Dec 21, 2023
5736ef4
Fixed tooltip formatting in the ammunition press
Desoroxxx Dec 21, 2023
b6ecd7e
Added remaining time for the craft in the ammunition press
Desoroxxx Dec 21, 2023
e29c38b
Crafting stations (Workbench, Ammunition Press etc...) now display thโ€ฆ
Desoroxxx Dec 21, 2023
06dad05
Fixed lang entry for `onScreenRainAndSnow`
Desoroxxx Dec 21, 2023
cd520a1
Update Changelog.md
Desoroxxx Dec 21, 2023
feea46f
Update Changelog.md
Desoroxxx Dec 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/main/java/com/paneedah/mwc/skins/CustomSkin.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
package com.paneedah.mwc.skins;

import com.paneedah.mwc.utils.ModReference;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;

import javax.imageio.ImageIO;
import java.io.File;

import static com.paneedah.mwc.proxies.ClientProxy.mc;
import static com.paneedah.mwc.utils.ModReference.ID;
import static com.paneedah.mwc.utils.ModReference.RED_LOG;

public class CustomSkin {

protected ResourceLocation resourceLocation;

public CustomSkin(String name, File file) {
try {
resourceLocation = new ResourceLocation(ModReference.ID, "customskin_"+name.toLowerCase());
final TextureManager textureManager = mc.getTextureManager();
file = new File(file.getPath(), name.toLowerCase()+".png.mcmeta");
textureManager.loadTexture(resourceLocation, new DynamicTexture(ImageIO.read(file)));
textureManager.bindTexture(resourceLocation);
} catch (Exception e) { e.printStackTrace(); }
resourceLocation = new ResourceLocation(ID, "customskin_" + name);
mc.getTextureManager().loadTexture(resourceLocation, new DynamicTexture(ImageIO.read(file)));
mc.getTextureManager().bindTexture(resourceLocation);
} catch (Exception e) {
RED_LOG.printFramedError("Load Custom Skin", "Failed to load custom skin: " + name + " from file: " + file.getAbsolutePath(), "Skin will not be loaded.");
}
}

public static ResourceLocation getCustomSkinResource(String skinName) {
File image = new File("./config/mwc/skins/"+skinName+".png");
public static ResourceLocation getCustomSkinResource(final String skinName) {
final File image = new File("./config/mwc/skins/" + skinName.replace("customskin_", "") + ".png");

if (!image.exists())
return new ResourceLocation(ModReference.ID +":textures/models/"+GunSkins.WoodlandCamo.getTextureName()+".png");
return new ResourceLocation(ID + ":textures/models/" + GunSkins.WoodlandCamo.getTextureName() + ".png");

if (!GunSkins.customSkins.containsKey(skinName))
GunSkins.customSkins.put(skinName, new CustomSkin(skinName, image));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ protected void renderModelSource(RenderContext<RenderableState> renderContext, I

for(Tuple<ModelBase, String> texturedModel: modelSource.getTexturedModels()) {
if (texturedModel.getV().startsWith("customskin_")) {
mc.renderEngine.bindTexture(CustomSkin.getCustomSkinResource(texturedModel.getV().toLowerCase().replace("customskin_", "").replace(".png", "")));
mc.renderEngine.bindTexture(CustomSkin.getCustomSkinResource(texturedModel.getV()));
} else {
mc.renderEngine.bindTexture(new ResourceLocation(ModReference.ID + ":textures/models/" + texturedModel.getV()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3315,7 +3315,7 @@ public void renderItem(ItemStack weaponItemStack, RenderContext<RenderableState>
GlStateManager.setActiveTexture(GL13.GL_TEXTURE0 + 3);

if (itemSkin.getTextureName().startsWith("customskin_")) {
mc.getTextureManager().bindTexture(CustomSkin.getCustomSkinResource(itemSkin.getTextureName().toLowerCase().replace("customskin_", "")));
mc.getTextureManager().bindTexture(CustomSkin.getCustomSkinResource(itemSkin.getTextureName()));
} else {
mc.getTextureManager().bindTexture(new ResourceLocation(ModReference.ID +":textures/models/"+itemSkin.getTextureName()+".png"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.Vec3d;
import scala.actors.threadpool.Arrays;

import java.util.Arrays;

public class WeaponDebugCommand extends TidyCompatibleCommand {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import com.google.common.reflect.ClassPath;
import com.google.common.reflect.ClassPath.ClassInfo;
import org.lwjgl.opengl.GLContext;
import scala.actors.threadpool.Arrays;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/mwc/shaders/postflat.frag
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ vec4 raindrop(vec4 color, vec2 c) {
// d.r -> only x% of drops are kept on, with x depending on the size of drops
if (d.r < (5.-r)*.08 && t > .5) {
// Drop normal
vec3 v = normalize(-vec3(cos(p), mix(.2, 1., t-.5)));
// vec3 v = normalize(-vec3(cos(p), mix(.2, 1., t-.5)));
// fragColor = vec4(v * 0.5 + 0.5, 1.0); // show normals

// Poor man's refraction (no visual need to do more)
Expand Down
Binary file not shown.