Compare commits

...
Author SHA1 Message Date
Martin Robertz 53ebb0bb25 update 2024-05-20 13:44:22 +02:00
Jason Mitchell 1c5ebd322f cuz more safer (#51)
(cherry picked from commit ff36cef1f2)
2024-05-20 13:43:18 +02:00
LuluTheDog 64aca85ede Added GoG Skybox support for all dimensions (#42)
* Added GoG Skybox support for all dimensions

- Added a boolean to toggle the feature to the config
- Added an int array to contain the dimension you would like to recieve the Skybox

-Changed the GoG Skybox render check to include above changes

Basically this allows you to display the Garden of Glass in any dimension you wish, instead of just in the overworld. I like to use this to have the skybox in my personal void dimension.

* Changed dimension ID to HashSet

- Changed the dimension ID handling from int[] to a HashSet of Integers

-Added loadPropIntSet()

Im sorry if there is better ways to handle the loading of the IDs from the file, this is what i was able to come up with, if theres a way to directly save a set to file please do tell

(cherry picked from commit 6610499e7c)
2024-05-20 13:43:06 +02:00
9 changed files with 55 additions and 22 deletions

No files matched your search

+3 -3
View File
@@ -5,12 +5,12 @@ dependencies {
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.7:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.4-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.8:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.5-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api') {transitive=false}
compile('com.github.GTNewHorizons:GTNHLib:0.2.10:dev')
compile('com.github.GTNewHorizons:GTNHLib:0.2.11:dev')
compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
+1 -1
View File
@@ -117,7 +117,7 @@ minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.19'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.22'
}
@@ -40,11 +40,11 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMulti
}
// Copied from RenderBlocks
public static boolean renderCrossedSquares(IBlockAccess blockAccess, Block par1Block, int par2, int par3, int par4, RenderBlocks render) {
public static boolean renderCrossedSquares(IBlockAccess blockAccess, Block block, int x, int y, int z, RenderBlocks render) {
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4));
tessellator.setBrightness(block.getMixedBrightnessForBlock(blockAccess, x, y, z));
float f = 1.0F;
int l = par1Block.colorMultiplier(blockAccess, par2, par3, par4);
int l = block.colorMultiplier(blockAccess, x, y, z);
float f1 = (l >> 16 & 255) / 255.0F;
float f2 = (l >> 8 & 255) / 255.0F;
float f3 = (l & 255) / 255.0F;
@@ -59,12 +59,12 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMulti
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
double d1 = par2;
double d2 = par3;
double d0 = par4;
double d1 = x;
double d2 = y;
double d0 = z;
long sh;
sh = par2 * 3129871 ^ par4 * 116129781L ^ par3;
sh = x * 3129871 ^ z * 116129781L ^ y;
sh = sh * sh * 42317861L + sh * 11L;
d1 += ((sh >> 16 & 15L) / 15.0F - 0.5D) * 0.3D;
d2 += (sh >> 32 & 15L) / 15.0F * -0.15D;
@@ -72,8 +72,8 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMulti
// Only change here, to use xyz rather than side/meta
IIcon icon = render.getBlockIcon(par1Block, blockAccess, par2, par3, par4, 0);
drawCrossedSquares(blockAccess, par1Block, icon, par2, par3, par4, d1, d2, d0, 1.0F, render);
IIcon icon = render.getBlockIcon(block, blockAccess, x, y, z, 0);
drawCrossedSquares(blockAccess, block, icon, x, y, z, d1, d2, d0, 1.0F, render);
return true;
}
@@ -16,13 +16,21 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.world.WorldTypeSkyblock;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.stream.IntStream;
public final class SkyblockRenderEvents {
@SubscribeEvent
public void onRender(RenderWorldLastEvent event) {
World world = Minecraft.getMinecraft().theWorld;
if(ConfigHandler.enableFancySkybox && world.provider.dimensionId == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) {
boolean renderFancySkybox = ConfigHandler.enableFancySkybox && (
(ConfigHandler.enableFancySkyboxInNormalWorlds && (world.provider.dimensionId == 0) ) ||
(ConfigHandler.enableFancySkyboxInDimension && ConfigHandler.fancySkyboxDimensions.contains(world.provider.dimensionId)) ||
(WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))
);
if(renderFancySkybox) {
if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer))
world.provider.setSkyRenderer(new SkyblockSkyRenderer());
}
@@ -176,12 +176,13 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
}
@Override
public IIcon getIcon(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) {
return ((TileSpecialFlower) par1iBlockAccess.getTileEntity(par2, par3, par4)).getIcon();
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
final TileSpecialFlower flower = (TileSpecialFlower) world.getTileEntity(x, y, z);
return flower != null ? flower.getIcon() : BlockModFlower.icons[16];
}
@Override
public IIcon getIcon(int par1, int par2) {
public IIcon getIcon(int side, int meta) {
return BlockModFlower.icons[16];
}
@@ -11,10 +11,13 @@
package vazkii.botania.common.core.handler;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.stream.Collectors;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
@@ -66,6 +69,8 @@ public final class ConfigHandler {
public static boolean enableArmorModels = true;
public static boolean enableFancySkybox = true;
public static boolean enableFancySkyboxInNormalWorlds = false;
public static boolean enableFancySkyboxInDimension = false;
public static HashSet<Integer> fancySkyboxDimensions = new HashSet<Integer>() {};
public static int manaBarHeight = 29;
public static int flightBarHeight = 49;
@@ -197,7 +202,13 @@ public final class ConfigHandler {
desc = "Set this to true to enable the fancy skybox in non Garden of Glass worlds. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)";
enableFancySkyboxInNormalWorlds = loadPropBool("fancySkybox.normalWorlds", desc, enableFancySkyboxInNormalWorlds);
desc = "Set this to true to enable the fancy skybox in custom dimension. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)";
enableFancySkyboxInDimension = loadPropBool("fancySkybox.customDim", desc, enableFancySkyboxInDimension);
desc = "The ID of the dimension to use";
fancySkyboxDimensions = loadPropIntSet("fancySkybox.customDimID", desc, fancySkyboxDimensions);
desc = "The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is.";
manaBarHeight = loadPropInt("manaBar.height", desc, manaBarHeight);
@@ -364,6 +375,19 @@ public final class ConfigHandler {
return prop.getIntList();
}
public static HashSet<Integer> loadPropIntSet(String propName, String desc, HashSet<Integer> intSet) {
int[] defaultValues = intSet.stream().mapToInt(Number::intValue).toArray();
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, defaultValues);
prop.comment = desc;
if(adaptor != null)
adaptor.adaptPropertyIntArray(prop, prop.getIntList());
return Arrays.stream(prop.getIntList())
.boxed()
.collect(Collectors.toCollection(HashSet::new));
}
public static int loadPropPotionId(String propName, int default_) {
if(!verifiedPotionArray)
verifyPotionArray();