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 36 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
27 changes: 26 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ and this project follows to [Ragnarรถk Versioning Convention](https://gist.githu
- penetratesGlass
- explosionBreak
- penetrableBlocks
- knockbackOnHi
- hipFireSpread
- ammoCounterX
- ammoCounterY
Expand All @@ -37,6 +36,8 @@ and this project follows to [Ragnarรถk Versioning Convention](https://gist.githu
- GitHub URL in `mcmod.info`
- Proning in single player mode (**Note: Currently unanimated; player will appear standing**)
- Shells life got increased to 1606 with no performance impact in extreme cases
- Added new fancy rain splash to go with the fancy rain
- Added remaining time for the craft in the ammunition press

### Changed

Expand Down Expand Up @@ -74,6 +75,11 @@ and this project follows to [Ragnarรถk Versioning Convention](https://gist.githu
- Magazines are created empty
- The position of the bullet when shooting is now centered when aiming
- Explosive projectiles are now linked to the player who launched them meaning that the kill message will say who killed whom
- Crafting stations (Workbench, Ammunition Press etc...) now display the remaining time with millisecond precision
- Changed default `filmGrain` config from `0.025` to `0.03`
- Changed default `onScreenRainAndSnow` config from `false` to `true`
- Changed default `enableFancyRainAndSnow` config from `false` to `true`
- Changed base fog density from `0.6` to `0.2`

### Fixed

Expand Down Expand Up @@ -103,6 +109,25 @@ and this project follows to [Ragnarรถk Versioning Convention](https://gist.githu
- Dumpster
- Sandbag
- Duel Floodlight
- Fixed unused variable in shader `postflat.frag` causing a crash
- Fixed `20rnd 6.5mm Magazine` using the wrong bullet
- Fixed unused variable in shader `postflat.frag` causing a crash
- Fixed `20rnd 6.5mm Magazine` using the wrong bullet
- Fixed custom skin system not using the Minecraft missing texture
- Fixed multiple `ResourceLocation` in the `PostProcessPipeline` being incorrect leading to missing textures
- Fixed fog rendering ignoring if fog should render
- Fixed depth testing being disabled in the world post processing causing issue with first person hand rendering
- Fixed the issue where fog was hardcoded to be disabled
- Fixed world post processing never rendering due to bandage fix
- Fixed world post processing causing a white screen
- Fixed `onScreenRainAndSnow` missing lang entries
- Fixed `enableFancyRainAndSnow` missing lang entries
- Fixed `enableFancyRainAndSnow` having the lang entries for `onScreenRainAndSnow`
- Fixed fancy rain and snow never replacing vanilla rain and snow
- Fixed entities not having a prefix causing collisions with other mods
- Fixed ammunition press animating even when it wasn't actively crafting
- Fixed ammunition press setting the ammunition of the magazines after they where crafted when this isn't necessary anymore
- Fixed tooltip formatting in the ammunition press

### Removed

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ minecraft {

username = 'Desoroxxx'

extraRunJvmArguments.addAll('-Xmx4G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dmixin.hotSwap=true', '-Dmixin.checks.interfaces=true', '-Dmixin.debug.export=true')
extraRunJvmArguments.addAll('-Xmx4G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dfml.coreMods.load=com.paneedah.weaponlib.core.WeaponlibCorePlugin', '-Dmixin.hotSwap=true', '-Dmixin.checks.interfaces=true', '-Dmixin.debug.export=true')

injectedTags.put('ID', project.id)
injectedTags.put('VERSION', project.version)
Expand Down
25 changes: 11 additions & 14 deletions src/main/java/com/paneedah/mwc/skins/CustomSkin.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
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");
if (!image.exists())
return new ResourceLocation(ModReference.ID +":textures/models/"+GunSkins.WoodlandCamo.getTextureName()+".png");

public static ResourceLocation getCustomSkinResource(final String skinName) {
if (!GunSkins.customSkins.containsKey(skinName))
GunSkins.customSkins.put(skinName, new CustomSkin(skinName, image));
GunSkins.customSkins.put(skinName, new CustomSkin(skinName, new File("./config/mwc/skins/" + skinName.replace("customskin_", ""))));

return GunSkins.customSkins.get(skinName).resourceLocation;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/paneedah/mwc/weapons/Magazines.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static void init(Object mod) {

Magazines.NGSWRMag = new ItemMagazine.Builder()
.withCapacity(20)
.withCompatibleBullet(Bullets.Bullet556x45)
.withCompatibleBullet(Bullets.Bullet65)
.withName("NGSWR_Mag")
.withRotationPoint(-0.16000000476837162, -0.44000001311302195, -1.4800000441074375)

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/paneedah/weaponlib/ClientEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ public void onRenderWorldLastEvent(RenderWorldLastEvent renderWorldLastEvent) {
PostProcessPipeline.captureMatricesIntoBuffers();

// Replaces the weather renderer.
if (!ModernConfigManager.enableFancyRainAndSnow)
PostProcessPipeline.setWorldElements();
PostProcessPipeline.setWorldElements();
Desoroxxx marked this conversation as resolved.
Show resolved Hide resolved

// Marks the frame-timer
frametimer.markFrame();
Expand Down Expand Up @@ -444,7 +443,8 @@ public void onRenderWorldLastEvent(RenderWorldLastEvent renderWorldLastEvent) {
}

if (ModernConfigManager.enableAllShaders && ModernConfigManager.enableWorldShaders) {
PostProcessPipeline.blitDepth();
if (PostProcessPipeline.shouldDoFog())
PostProcessPipeline.blitDepth();
// PostProcessPipeline.setupDistortionBufferEffects();
PostProcessPipeline.doWorldProcessing();
}
Desoroxxx marked this conversation as resolved.
Show resolved Hide resolved
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() + ".png"));
} else {
mc.getTextureManager().bindTexture(new ResourceLocation(ModReference.ID +":textures/models/"+itemSkin.getTextureName()+".png"));
}
Desoroxxx marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/com/paneedah/weaponlib/WeaponSpawnEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ protected void onImpact(final RayTraceResult position) {
else
position.entityHit.attackEntityFrom(new DamageSource("thrown"), damage);

// Todo: Actually fix this, currently we are reproducing the effect of not apply knockback.
// If you are standing still it's not a big deal everything seems fine.
// But if you are moving you will basically freeze/slowdown greatly (see CS:GO for example).
// The correct fix to this would be to actually not apply knockback instead of "canceling it".
// But I (Desoroxxx) was not able in time to find where is the knockback applied, so bandage fix it is.
if (!ModernConfigManager.knockbackOnHit) {
position.entityHit.motionX = motionX / 1500;
position.entityHit.motionY = motionY / 1500;
position.entityHit.motionZ = motionZ / 1500;
position.entityHit.isAirBorne = true;
}

Desoroxxx marked this conversation as resolved.
Show resolved Hide resolved
position.entityHit.hurtResistantTime = 0;
position.entityHit.prevRotationYaw -= 0.3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public void register(ModContext context) {

SecondaryEntityRegistry.map.put(name, entityClass);

net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(new ResourceLocation(ModReference.ID, entityName), entityClass, entityName, modEntityId, context.getMod(), trackingRange, updateFrequency, sendVelocityUpdates);
net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(new ResourceLocation(ModReference.ID, entityName), entityClass, ModReference.ID + "_" + entityName, modEntityId, context.getMod(), trackingRange, updateFrequency, sendVelocityUpdates);

if(spawnEgg)
EntityRegistry.registerEgg(EntityList.getKey(entityClass), primaryEggColor, secondaryEggColor);
Desoroxxx marked this conversation as resolved.
Show resolved Hide resolved
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
@@ -0,0 +1,19 @@
package com.paneedah.weaponlib.compatibility;

import com.paneedah.weaponlib.WeaponSpawnEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;

public class ServerInterceptors {

public static float getKnockback(DamageSource source) {
float strength = 0.4f;
if(source instanceof EntityDamageSourceIndirect) {
EntityDamageSourceIndirect indirectSource = (EntityDamageSourceIndirect) source;
if(indirectSource.getImmediateSource() instanceof WeaponSpawnEntity) {
strength = 0.05f;
}
}
return strength;
}
}
Desoroxxx marked this conversation as resolved.
Show resolved Hide resolved
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class ModernConfigManager {

@RangeDouble(min = 0.0, max = 1.0)
@ConfigSync(category = CATEGORY_RENDERING_SCREENSHADERS, comment = "Configures the intensity of the film grain effect")
public static double filmGrainIntensity = 0.025;
public static double filmGrainIntensity = 0.03;

@ConfigSync(category = CATEGORY_RENDERING_SCREENSHADERS, comment = "Enables glow around bright objects (bloom)")
public static boolean bloomEffect = true;
Expand All @@ -80,14 +80,14 @@ public class ModernConfigManager {
public static int bloomLayers = 3;

@ConfigSync(category = CATEGORY_RENDERING_SCREENSHADERS, comment = "Enable on-screen rain/snow VFX")
public static boolean onScreenRainAndSnow = false;
public static boolean onScreenRainAndSnow = true;

@RequiresMcRestart
@ConfigSync(category = CATEGORY_RENDERING, comment = "Enables the HDR framebuffer, requires restart. The HDR is the cause of a lot of shader incompat")
public static boolean enableHDRFramebuffer = true;

@ConfigSync(category = CATEGORY_RENDERING, comment = "Enables the fancy MWC snow/rain")
public static boolean enableFancyRainAndSnow = false;
public static boolean enableFancyRainAndSnow = true;


// Fixing Method
Expand Down Expand Up @@ -126,9 +126,6 @@ public class ModernConfigManager {
@ConfigSync(category = CATEGORY_GAMEPLAY, comment = "A list of blocks that should be penetrable by bullets ")
public static String penetrableBlocks = "minecraft:glass, minecraft:glass_pane, minecraft:stained_glass, minecraft:stained_glass_pane";

@ConfigSync(category = CATEGORY_GAMEPLAY, comment = "Whether entities should have knockback applied to them when shot.")
public static boolean knockbackOnHit = true;

@ConfigSync(category = CATEGORY_GAMEPLAY, comment = "Enables muzzle effects.")
public static boolean enableMuzzleEffects = true;

Expand Down
Loading