fix issues with artillery proxy OC compat

also fix a big sound system issue where other mods would run out of sound memory on the sound card if they loaded after NTM reserved 1000 CHANNELS
This commit is contained in:
BallOfEnergy 2024-06-28 14:37:28 -05:00
parent 773db3c54c
commit 7022dcd1af
7 changed files with 75 additions and 7 deletions

View File

@ -36,6 +36,7 @@ public class GeneralConfig {
public static boolean enableSteamParticles = true;
public static boolean enableSoundExtension = true;
public static boolean enableMekanismChanges = true;
public static int normalSoundChannels = 100;
public static int hintPos = 0;
public static boolean enableExpensiveMode = false;
@ -105,6 +106,9 @@ public class GeneralConfig {
enableSteamParticles = config.get(CATEGORY_GENERAL, "1.38_enableSteamParticles", true, "If disabled, auxiliary cooling towers and large cooling towers will not emit steam particles when in use.").getBoolean(true);
enableSoundExtension = config.get(CATEGORY_GENERAL, "1.39_enableSoundExtension", true, "If enabled, will change the limit for how many sounds can play at once.").getBoolean(true);
enableMekanismChanges = config.get(CATEGORY_GENERAL, "1.40_enableMekanismChanges", true, "If enabled, will change some of Mekanism's recipes.").getBoolean(true);
normalSoundChannels = CommonConfig.createConfigInt(config, CATEGORY_GENERAL, "1.41_normalSoundChannels",
"The amount of channels to create while 1.39_enableSoundExtension is enabled.\n" +
"Note that a value below 28 or above 200 can cause buggy sounds and issues with other mods running out of sound memory.", 100);
enableExpensiveMode = config.get(CATEGORY_GENERAL, "1.99_enableExpensiveMode", false, "It does what the name implies.").getBoolean(false);

View File

@ -99,7 +99,7 @@ public class CompatHandler {
player.addChatComponentMessage(new ChatComponentTranslation(info).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
}
TileEntity te = (TileEntity) this;
if(Array.getLength(this.methods()) == 0 && te instanceof TileEntityProxyCombo || this.getComponentName().equals("ntm_null"))
if((Array.getLength(this.methods()) == 0 && te instanceof TileEntityProxyCombo) || this.getComponentName().equals("ntm_null"))
player.addChatComponentMessage(new ChatComponentTranslation("analyze.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
return null;
}

View File

@ -152,7 +152,7 @@ public class ClientProxy extends ServerProxy {
Jars.initJars();
if(GeneralConfig.enableSoundExtension) {
SoundSystemConfig.setNumberNormalChannels(1000);
SoundSystemConfig.setNumberNormalChannels(GeneralConfig.normalSoundChannels);
SoundSystemConfig.setNumberStreamingChannels(50);
}
}

View File

@ -548,8 +548,7 @@ public abstract class TileEntityLaunchPadBase extends TileEntityMachineBase impl
return getTier(context, args);
case ("launch"):
return launch(context, args);
}
}
throw new NoSuchMethodException();
}
}
}

View File

@ -431,7 +431,12 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
@Override
public String[] methods() {
return new String[] {"getFluidStored", "getMaxStored", "getTypeStored", "getInfo"};
return new String[] {
"getFluidStored",
"getMaxStored",
"getTypeStored",
"getInfo"
};
}
@Override

View File

@ -518,7 +518,11 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
@Override
public String[] methods() {
return new String[] {"getFluidStored", "getMaxStored", "getTypeStored", "getInfo"};
return new String[] {
"getFluidStored",
"getMaxStored",
"getTypeStored",
"getInfo"};
}
@Override

View File

@ -477,4 +477,60 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
targetQueue.add(Vec3.createVectorHelper(args.checkDouble(0), args.checkDouble(1), args.checkDouble(2)));
return new Object[] {true};
}
@Override
public String[] methods() { // :vomit:
return new String[] {
"setActive",
"isActive",
"getEnergyInfo",
"getWhitelisted",
"addWhitelist",
"removeWhitelist",
"setTargeting",
"getTargeting",
"hasTarget",
"getAngle",
"isAligned",
"getCurrentTarget",
"getTargetDistance",
"addCoords"
};
}
@Override
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
switch (method) {
case "setActive":
return setActive(context, args);
case "isActive":
return isActive(context, args);
case "getEnergyInfo":
return getEnergyInfo(context, args);
case "getWhitelisted":
return getWhitelisted(context, args);
case "addWhitelist":
return addWhitelist(context, args);
case "removeWhitelist":
return removeWhitelist(context, args);
case "setTargeting":
return setTargeting(context, args);
case "getTargeting":
return getTargeting(context, args);
case "hasTarget":
return hasTarget(context, args);
case "getAngle":
return getAngle(context, args);
case "isAligned":
return isAligned(context, args);
case "getCurrentTarget":
return getCurrentTarget(context, args);
case "getTargetDistance":
return getTargetDistance(context, args);
case "addCoords":
return addCoords(context, args);
}
throw new NoSuchMethodException();
}
}