- Added worldProviderTCEldrichFake

This commit is contained in:
HellFirePvP committed 2015-11-04 17:00:29 +01:00
1 parent f588cfc4af
commit 0396d6cfab
6 files changed
+149 -11

No files matched your search

@@ -6,6 +6,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import makeo.gadomancy.client.ClientProxy;
import makeo.gadomancy.common.containers.ContainerInfusionClaw;
import makeo.gadomancy.common.data.ModConfig;
import makeo.gadomancy.common.events.EventHandlerEntity;
import makeo.gadomancy.common.events.EventHandlerGolem;
import makeo.gadomancy.common.events.EventHandlerNetwork;
@@ -20,11 +21,13 @@ import makeo.gadomancy.common.registration.RegisteredItems;
import makeo.gadomancy.common.registration.RegisteredPotions;
import makeo.gadomancy.common.registration.RegisteredRecipes;
import makeo.gadomancy.common.registration.RegisteredResearches;
import makeo.gadomancy.common.utils.WorldProviderTCEldrich;
import makeo.gadomancy.common.utils.Injector;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import thaumcraft.api.wands.WandTriggerRegistry;
import thaumcraft.common.entities.golems.ContainerGolem;
@@ -75,6 +78,9 @@ public class CommonProxy implements IGuiHandler {
ModSubstitutions.init();
RegisteredPotions.init();
//DimensionManager.registerProviderType(ModConfig.dimOuterId, WorldProviderTCEldrich.class, false);
//DimensionManager.registerDimension(ModConfig.dimOuterId, ModConfig.dimOuterId);
}
public void postInitalize() {
@@ -64,7 +64,7 @@ public class DefaultApiHandler implements IApiHandler {
@Override
public AdditionalGolemCore getAdditionalGolemCore(EntityGolemBase golem) {
String coreName = golem.getDataWatcher().getWatchableObjectString(ModConfig.getGolemDatawatcherId());
String coreName = golem.getDataWatcher().getWatchableObjectString(ModConfig.golemDatawatcherId);
if(!coreName.isEmpty()) {
return additionalGolemCores.get(coreName);
}
@@ -97,7 +97,7 @@ public class DefaultApiHandler implements IApiHandler {
String coreName = core == null ? "" : core.getName();
golem.setCore(core == null ? -1 : core.getBaseCore());
golem.getDataWatcher().updateObject(ModConfig.getGolemDatawatcherId(), coreName);
golem.getDataWatcher().updateObject(ModConfig.golemDatawatcherId, coreName);
if(!golem.worldObj.isRemote) {
NBTHelper.getPersistentData(golem).setString("Core", coreName);
@@ -13,8 +13,12 @@ import java.io.File;
* Created by makeo @ 15.09.2015 18:25
*/
public class ModConfig {
private static Configuration config;
public static int golemDatawatcherId = 29;
public static int dimOuterId = -73;
private ModConfig() {}
public static void init(File file) {
@@ -22,16 +26,13 @@ public class ModConfig {
config.load();
getGolemDatawatcherId();
loadFromConfig();
config.save();
}
private static int golemDatawatcherId = -1;
public static int getGolemDatawatcherId() {
if(golemDatawatcherId < 0) {
golemDatawatcherId = config.getInt("datawatcherId", "golem", 29, 0, 31, "Do not edit unless you know what are you doing!");
}
return golemDatawatcherId;
private static void loadFromConfig() {
golemDatawatcherId = config.getInt("datawatcherId", "golem", 29, 0, 31, "Do not edit unless you know what are you doing!");
dimOuterId = config.getInt("dimOuterId", "dimension", -73, Integer.MIN_VALUE, Integer.MAX_VALUE, "Dimension Id for the eldrich mazes accessed via Node Manipulator");
}
}
@@ -114,7 +114,7 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties {
if(persistent.hasKey("Core")) {
for(AdditionalGolemCore core : GadomancyApi.getAdditionalGolemCores()) {
if(core.getName().equals(persistent.getString("Core"))) {
golem.getDataWatcher().updateObject(ModConfig.getGolemDatawatcherId(), core.getName());
golem.getDataWatcher().updateObject(ModConfig.golemDatawatcherId, core.getName());
break;
}
}
@@ -53,7 +53,7 @@ public class EventHandlerGolem {
golem.registerExtendedProperties(Gadomancy.MODID, new ExtendedGolemProperties(golem));
golem.getDataWatcher().addObject(ModConfig.getGolemDatawatcherId(), "");
golem.getDataWatcher().addObject(ModConfig.golemDatawatcherId, "");
}
}
@@ -0,0 +1,131 @@
package makeo.gadomancy.common.utils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import thaumcraft.common.config.Config;
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
import thaumcraft.common.lib.world.dim.ChunkProviderOuter;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by HellFirePvP @ 03.11.2015 19:02
*/
public class WorldProviderTCEldrich extends WorldProvider {
@Override
public String getDimensionName() {
return "Outer Lands";
}
public String getWelcomeMessage() {
return "Entering The Outer Lands";
}
public String getDepartMessage() {
return "Leaving The Outer Lands";
}
public boolean shouldMapSpin(String entity, double x, double y, double z) {
return true;
}
public boolean canBlockFreeze(int x, int y, int z, boolean byWater) {
return false;
}
public boolean canSnowAt(int x, int y, int z, boolean checkLight) {
return false;
}
public boolean canDoLightning(Chunk chunk) {
return false;
}
public boolean canDoRainSnowIce(Chunk chunk) {
return false;
}
public void registerWorldChunkManager() {
this.worldChunkMgr = new WorldChunkManagerHell(ThaumcraftWorldGenerator.biomeEldritchLands, 0.0F);
this.dimensionId = Config.dimensionOuterId;
this.hasNoSky = true;
}
public IChunkProvider createChunkGenerator() {
return new ChunkProviderOuter(this.worldObj, this.worldObj.getSeed(), true);
}
public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) {
return 0.0F;
}
@SideOnly(Side.CLIENT)
public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) {
return null;
}
@SideOnly(Side.CLIENT)
public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) {
int i = 10518688;
float f2 = MathHelper.cos(p_76562_1_ * 3.141593F * 2.0F) * 2.0F + 0.5F;
if (f2 < 0.0F) {
f2 = 0.0F;
}
if (f2 > 1.0F) {
f2 = 1.0F;
}
float f3 = (i >> 16 & 0xFF) / 255.0F;
float f4 = (i >> 8 & 0xFF) / 255.0F;
float f5 = (i & 0xFF) / 255.0F;
f3 *= (f2 * 0.0F + 0.15F);
f4 *= (f2 * 0.0F + 0.15F);
f5 *= (f2 * 0.0F + 0.15F);
return Vec3.createVectorHelper(f3, f4, f5);
}
@SideOnly(Side.CLIENT)
public boolean isSkyColored() {
return false;
}
public boolean canRespawnHere() {
return false;
}
public boolean isSurfaceWorld() {
return false;
}
@SideOnly(Side.CLIENT)
public float getCloudHeight() {
return 1.0F;
}
public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) {
return this.worldObj.getTopBlock(p_76566_1_, p_76566_2_).getMaterial().blocksMovement();
}
public ChunkCoordinates getEntrancePortalLocation() {
return null;
}
public int getAverageGroundLevel() {
return 50;
}
@SideOnly(Side.CLIENT)
public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) {
return true;
}
}