Biome fixes
This commit is contained in:
parent
30e735385f
commit
4c7c10f5d3
22 changed files with 405 additions and 340 deletions
|
@ -8,7 +8,9 @@ import com.zixiken.dimdoors.shared.sound.ModSounds;
|
||||||
import com.zixiken.dimdoors.shared.tileentities.*;
|
import com.zixiken.dimdoors.shared.tileentities.*;
|
||||||
import com.zixiken.dimdoors.shared.util.DefaultSchematicGenerator;
|
import com.zixiken.dimdoors.shared.util.DefaultSchematicGenerator;
|
||||||
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
||||||
|
import com.zixiken.dimdoors.shared.world.ModBiomes;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
@ -24,10 +26,11 @@ public abstract class DDProxyCommon implements IDDProxy {
|
||||||
MinecraftForge.EVENT_BUS.register(ModItems.class);
|
MinecraftForge.EVENT_BUS.register(ModItems.class);
|
||||||
MinecraftForge.EVENT_BUS.register(CraftingManager.class); // TODO: ModRecipes?
|
MinecraftForge.EVENT_BUS.register(CraftingManager.class); // TODO: ModRecipes?
|
||||||
MinecraftForge.EVENT_BUS.register(ModSounds.class);
|
MinecraftForge.EVENT_BUS.register(ModSounds.class);
|
||||||
|
MinecraftForge.EVENT_BUS.register(ModBiomes.class);
|
||||||
|
|
||||||
DimDoorDimensions.init();
|
DimDoorDimensions.registerDimensions();
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileEntityVerticalEntranceRift.class, "TileEntityVerticalEntranceRift"); // TODO: use new registry
|
GameRegistry.registerTileEntity(TileEntityVerticalEntranceRift.class, "TileEntityVerticalEntranceRift"); // TODO: new forge registry system?
|
||||||
GameRegistry.registerTileEntity(TileEntityFloatingRift.class, "TileEntityFloatingRift");
|
GameRegistry.registerTileEntity(TileEntityFloatingRift.class, "TileEntityFloatingRift");
|
||||||
GameRegistry.registerTileEntity(TileEntityHorizontalEntranceRift.class, "TileEntityHorizontalEntranceRift");
|
GameRegistry.registerTileEntity(TileEntityHorizontalEntranceRift.class, "TileEntityHorizontalEntranceRift");
|
||||||
|
|
||||||
|
@ -37,6 +40,7 @@ public abstract class DDProxyCommon implements IDDProxy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialization(FMLInitializationEvent event) {
|
public void onInitialization(FMLInitializationEvent event) {
|
||||||
|
|
||||||
SchematicHandler.INSTANCE.loadSchematics();
|
SchematicHandler.INSTANCE.loadSchematics();
|
||||||
DefaultSchematicGenerator.generateDefaultSchematics();
|
DefaultSchematicGenerator.generateDefaultSchematics();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,13 @@ import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.event.entity.EntityEvent;
|
import net.minecraftforge.event.entity.EntityEvent;
|
||||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
public class EventHandler {
|
public class EventHandler {
|
||||||
|
@ -25,11 +28,11 @@ public class EventHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent(priority = EventPriority.LOWEST) // don't let other mods do something based on the event
|
||||||
public static void onLivingFall(LivingFallEvent event) {
|
public static void onLivingHurt(LivingHurtEvent event) {
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
if (entity.dimension == DimDoorDimensions.LIMBO.getId()) {
|
if (entity.dimension == DimDoorDimensions.LIMBO.getId() && event.getSource() == DamageSource.FALL) {
|
||||||
event.setCanceled(true); // no fall damage in limbo
|
event.setCanceled(true);// no fall damage in LIMBO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -291,13 +291,19 @@ public abstract class TileEntityRift extends TileEntity implements ITickable { /
|
||||||
RiftRegistry privateRiftRegistry = RiftRegistry.getForDim(DimDoorDimensions.getPrivateDimID());
|
RiftRegistry privateRiftRegistry = RiftRegistry.getForDim(DimDoorDimensions.getPrivateDimID());
|
||||||
/*Pocket*/ pocket = privatePocketRegistry.getPocket(privatePocketRegistry.getPrivatePocketID(uuid));
|
/*Pocket*/ pocket = privatePocketRegistry.getPocket(privatePocketRegistry.getPrivatePocketID(uuid));
|
||||||
if (pocket == null) { // generate the private pocket and get its entrance
|
if (pocket == null) { // generate the private pocket and get its entrance
|
||||||
pocket = PocketGenerator.generatePrivatePocket(virtualLocation != null ? virtualLocation.toBuilder().depth(-2).build() : null); // set to where the pocket was first created TODO: private pocket deletion
|
pocket = PocketGenerator.generatePrivatePocket(virtualLocation != null ? virtualLocation.toBuilder().depth(-2).build() : null); // set to where the pocket was first created
|
||||||
pocket.setup();
|
pocket.setup();
|
||||||
privatePocketRegistry.setPrivatePocketID(uuid, pocket.getId());
|
privatePocketRegistry.setPrivatePocketID(uuid, pocket.getId());
|
||||||
destLoc = pocket.getEntrance();
|
destLoc = pocket.getEntrance();
|
||||||
} else {
|
} else {
|
||||||
destLoc = privateRiftRegistry.getPrivatePocketEntrance(uuid); // get the last used entrance
|
destLoc = privateRiftRegistry.getPrivatePocketEntrance(uuid); // get the last used entrance
|
||||||
if (destLoc == null) destLoc = pocket.getEntrance(); // if there's none, then set the target to the main entrance
|
if (destLoc == null) destLoc = pocket.getEntrance(); // if there's none, then set the target to the main entrance
|
||||||
|
if (destLoc == null) { // if the pocket entrance is gone, then create a new private pocket
|
||||||
|
pocket = PocketGenerator.generatePrivatePocket(virtualLocation != null ? virtualLocation.toBuilder().depth(-2).build() : null);
|
||||||
|
pocket.setup();
|
||||||
|
privatePocketRegistry.setPrivatePocketID(uuid, pocket.getId());
|
||||||
|
destLoc = pocket.getEntrance();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// privateRiftRegistry.setPrivatePocketEntrance(uuid, null); // --forget the last entered entrance-- Actually, remember it. We'll eventually store it only in the rift registry, not in the pocket.
|
// privateRiftRegistry.setPrivatePocketEntrance(uuid, null); // --forget the last entered entrance-- Actually, remember it. We'll eventually store it only in the rift registry, not in the pocket.
|
||||||
} else {
|
} else {
|
||||||
|
@ -321,7 +327,7 @@ public abstract class TileEntityRift extends TileEntity implements ITickable { /
|
||||||
}
|
}
|
||||||
if (destLoc == null) {
|
if (destLoc == null) {
|
||||||
if (entity instanceof EntityPlayer) DimDoors.chat((EntityPlayer) entity, "You tried to escape a pocket or leave your private pocket, but you teleported into it!");
|
if (entity instanceof EntityPlayer) DimDoors.chat((EntityPlayer) entity, "You tried to escape a pocket or leave your private pocket, but you teleported into it!");
|
||||||
return false; // TODO: limbo?
|
return false; // TODO: LIMBO?
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false; // Non-player/owned entity tried to escape/leave private pocket
|
return false; // Non-player/owned entity tried to escape/leave private pocket
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
package com.zixiken.dimdoors.shared.util;
|
package com.zixiken.dimdoors.shared.util;
|
||||||
|
|
||||||
import com.zixiken.dimdoors.DimDoors;
|
import com.zixiken.dimdoors.DimDoors;
|
||||||
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
|
||||||
|
|
||||||
public class WorldUtils {
|
public class WorldUtils {
|
||||||
public static World getWorld(int dim) {
|
public static World getWorld(int dim) {
|
||||||
World world = DimDoors.proxy.getWorldServer(dim);
|
return DimDoors.proxy.getWorldServer(dim);
|
||||||
if (world == null) {
|
|
||||||
throw new RuntimeException("Something went wrong!");
|
|
||||||
}
|
|
||||||
return world;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getDim(World world) {
|
public static int getDim(World world) {
|
||||||
|
|
|
@ -22,14 +22,13 @@ public class DimDoorDimensions {
|
||||||
@Getter private static int maxPocketDimID;
|
@Getter private static int maxPocketDimID;
|
||||||
private static final List<EnumPocketType> pocketTypes = new ArrayList<>();
|
private static final List<EnumPocketType> pocketTypes = new ArrayList<>();
|
||||||
private static final Map<EnumPocketType, DimensionType> pocketDimensionTypes = new HashMap<>();
|
private static final Map<EnumPocketType, DimensionType> pocketDimensionTypes = new HashMap<>();
|
||||||
private static final List<DimensionType> CUSTOM = new ArrayList<>();
|
|
||||||
|
|
||||||
@Getter private static int limboDimID;
|
@Getter private static int limboDimID;
|
||||||
@Getter private static int privateDimID;
|
@Getter private static int privateDimID;
|
||||||
@Getter private static int publicDimID;
|
@Getter private static int publicDimID;
|
||||||
@Getter private static int dungeonDimID;
|
@Getter private static int dungeonDimID;
|
||||||
|
|
||||||
public static void init() {
|
public static void registerDimensions() { // TODO: new forge registry system?
|
||||||
// Lowercase names because all minecraft dimensions are lowercase, _pockets suffix to make it clear what the world is
|
// Lowercase names because all minecraft dimensions are lowercase, _pockets suffix to make it clear what the world is
|
||||||
minPocketDimID = DDConfig.getBaseDimID();
|
minPocketDimID = DDConfig.getBaseDimID();
|
||||||
int dimID = minPocketDimID;
|
int dimID = minPocketDimID;
|
||||||
|
@ -50,14 +49,6 @@ public class DimDoorDimensions {
|
||||||
for (EnumPocketType pocketType : pocketDimensionTypes.keySet()) {
|
for (EnumPocketType pocketType : pocketDimensionTypes.keySet()) {
|
||||||
registerDimension(pocketDimensionTypes.get(pocketType));
|
registerDimension(pocketDimensionTypes.get(pocketType));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: For future use? Like, server owners can add their own set of DimDoors DimensionTypes via the configs? Or is this nonsense?
|
|
||||||
// for (int i = 0; i < 0; i++) {
|
|
||||||
// dimID++;
|
|
||||||
// DimensionType tempType = DimensionType.register("Name", "_name", dimID, WorldProvider.class, false);
|
|
||||||
// CUSTOM.add(tempType);
|
|
||||||
// registerDimension(tempType);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerDimension(DimensionType dimension) {
|
public static void registerDimension(DimensionType dimension) {
|
||||||
|
@ -68,7 +59,7 @@ public class DimDoorDimensions {
|
||||||
return pocketDimensionTypes.get(pocketType);
|
return pocketDimensionTypes.get(pocketType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isPocketDimension(int id) {
|
public static boolean isPocketDimension(int id) { // TODO: also add isPocketDimension(World)?
|
||||||
return id >= minPocketDimID && id <= maxPocketDimID;
|
return id >= minPocketDimID && id <= maxPocketDimID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.zixiken.dimdoors.shared.world;
|
||||||
|
|
||||||
|
import com.zixiken.dimdoors.DimDoors;
|
||||||
|
import com.zixiken.dimdoors.shared.world.limbodimension.BiomeLimbo;
|
||||||
|
import com.zixiken.dimdoors.shared.world.pocketdimension.BiomeBlank;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
|
import net.minecraftforge.common.BiomeDictionary;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
public class ModBiomes {
|
||||||
|
public static final BiomeLimbo LIMBO = new BiomeLimbo();
|
||||||
|
public static final BiomeBlank WHITE_VOID = new BiomeBlank(true, false);
|
||||||
|
public static final BiomeBlank BLACK_VOID = new BiomeBlank(false, false);
|
||||||
|
public static final BiomeBlank DANGEROUS_BLACK_VOID = new BiomeBlank(false, true);
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void registerBiomes(RegistryEvent.Register<Biome> event) {
|
||||||
|
LIMBO.setRegistryName(new ResourceLocation(DimDoors.MODID, "limbo"));
|
||||||
|
WHITE_VOID.setRegistryName(new ResourceLocation(DimDoors.MODID, "white_void"));
|
||||||
|
BLACK_VOID.setRegistryName(new ResourceLocation(DimDoors.MODID, "black_void"));
|
||||||
|
DANGEROUS_BLACK_VOID.setRegistryName(new ResourceLocation(DimDoors.MODID, "dangerous_black_void"));
|
||||||
|
event.getRegistry().registerAll(
|
||||||
|
LIMBO,
|
||||||
|
WHITE_VOID,
|
||||||
|
BLACK_VOID,
|
||||||
|
DANGEROUS_BLACK_VOID);
|
||||||
|
BiomeDictionary.addTypes(LIMBO, BiomeDictionary.Type.VOID); // TODO: check that this prevents other mods' worldgen (ex. Biomes O' Plenty)
|
||||||
|
BiomeDictionary.addTypes(WHITE_VOID, BiomeDictionary.Type.VOID);
|
||||||
|
BiomeDictionary.addTypes(BLACK_VOID, BiomeDictionary.Type.VOID);
|
||||||
|
BiomeDictionary.addTypes(DANGEROUS_BLACK_VOID, BiomeDictionary.Type.VOID);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
package com.zixiken.dimdoors.shared.world;
|
|
||||||
|
|
||||||
import net.minecraft.world.DimensionType;
|
|
||||||
import net.minecraft.world.WorldProvider;
|
|
||||||
|
|
||||||
public class PocketProvider extends WorldProvider {
|
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public String getDimensionName() {
|
|
||||||
return "Pocket Dimension";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInternalNameSuffix() {
|
|
||||||
return "_pocket";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DimensionType getDimensionType() {
|
|
||||||
return DimensionType.OVERWORLD;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
package com.zixiken.dimdoors.shared.world.biomes;
|
|
||||||
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Jared Johnson on 1/24/2017.
|
|
||||||
*/
|
|
||||||
public class DimDoorsBiome extends Biome {
|
|
||||||
|
|
||||||
public DimDoorsBiome(String name) {
|
|
||||||
super(new BiomeProperties(name));
|
|
||||||
decorator.treesPerChunk = 0;
|
|
||||||
decorator.flowersPerChunk = 0;
|
|
||||||
decorator.grassPerChunk = 0;
|
|
||||||
|
|
||||||
spawnableMonsterList.clear();
|
|
||||||
spawnableCreatureList.clear();
|
|
||||||
spawnableWaterCreatureList.clear();
|
|
||||||
spawnableCaveCreatureList.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canRain() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ package com.zixiken.dimdoors.shared.world.gateways;
|
||||||
|
|
||||||
import com.zixiken.dimdoors.shared.DDConfig;
|
import com.zixiken.dimdoors.shared.DDConfig;
|
||||||
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
|
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
|
||||||
import com.zixiken.dimdoors.shared.world.PocketProvider;
|
import com.zixiken.dimdoors.shared.world.pocketdimension.WorldProviderPocket;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -51,7 +51,7 @@ public class GatewayGenerator implements IWorldGenerator
|
||||||
// Also don't generate anything in the Nether, The End, or in Witchery's Spirit World.
|
// Also don't generate anything in the Nether, The End, or in Witchery's Spirit World.
|
||||||
// We only match against Spirit World using hashing to speed up the process a little (hopefully).
|
// We only match against Spirit World using hashing to speed up the process a little (hopefully).
|
||||||
int dimensionID = world.provider.getDimension();
|
int dimensionID = world.provider.getDimension();
|
||||||
if (world.isRemote || (world.provider instanceof PocketProvider) || (dimensionID == END_DIMENSION_ID) || (dimensionID == NETHER_DIMENSION_ID)) {
|
if (world.isRemote || (world.provider instanceof WorldProviderPocket) || (dimensionID == END_DIMENSION_ID) || (dimensionID == NETHER_DIMENSION_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class GatewaySandstonePillars extends BaseSchematicGateway {
|
||||||
super("sandstonePillars");
|
super("sandstonePillars");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Biome[] getBiomes() {
|
public Biome[] getBiomes() {
|
||||||
return new Biome[] {Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.MUTATED_DESERT};
|
return new Biome[] {Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.MUTATED_DESERT};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.zixiken.dimdoors.shared.world.limbodimension;
|
||||||
|
|
||||||
|
import com.zixiken.dimdoors.shared.entities.EntityMonolith;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
|
import net.minecraft.world.biome.BiomeDecorator;
|
||||||
|
import net.minecraft.world.chunk.ChunkPrimer;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BiomeLimbo extends Biome {
|
||||||
|
|
||||||
|
public BiomeLimbo() {
|
||||||
|
super(new Biome.BiomeProperties("Limbo")
|
||||||
|
.setRainDisabled()
|
||||||
|
.setRainfall(0)
|
||||||
|
.setWaterColor(0x000000));
|
||||||
|
|
||||||
|
// topBlock = Blocks.AIR.getDefaultState();
|
||||||
|
// fillerBlock = Blocks.AIR.getDefaultState();
|
||||||
|
|
||||||
|
spawnableMonsterList.clear();
|
||||||
|
spawnableCreatureList.clear();
|
||||||
|
spawnableWaterCreatureList.clear();
|
||||||
|
spawnableCaveCreatureList.clear();
|
||||||
|
spawnableMonsterList.add(new SpawnListEntry(EntityMonolith.class, 100, 4, 4));
|
||||||
|
|
||||||
|
flowers.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: move generation here
|
||||||
|
|
||||||
|
@Override public BiomeDecorator createBiomeDecorator() { return null; }
|
||||||
|
|
||||||
|
@Override public void decorate(World worldIn, Random rand, BlockPos pos) {}
|
||||||
|
|
||||||
|
@Override public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getSkyColorByTemp(float currentTemperature) { // TODO: what does this do?
|
||||||
|
return super.getSkyColorByTemp(currentTemperature);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: check that black/white grass and foliage in getModdedBiomeGrassColor is compatible with other mods such as Quark's greener grass option
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getGrassColorAtPos(BlockPos pos) {
|
||||||
|
return getModdedBiomeGrassColor(0x000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getFoliageColorAtPos(BlockPos pos) {
|
||||||
|
return getModdedBiomeFoliageColor(0x000000);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
package com.zixiken.dimdoors.shared.world.limbodimension;
|
|
||||||
|
|
||||||
import com.zixiken.dimdoors.shared.world.biomes.DimDoorsBiome;
|
|
||||||
|
|
||||||
public class LimboBiome extends DimDoorsBiome {
|
|
||||||
|
|
||||||
public LimboBiome() {
|
|
||||||
super("limbo");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,6 +2,7 @@ package com.zixiken.dimdoors.shared.world.limbodimension;
|
||||||
|
|
||||||
import com.zixiken.dimdoors.shared.blocks.BlockFabric;
|
import com.zixiken.dimdoors.shared.blocks.BlockFabric;
|
||||||
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
|
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
|
||||||
|
import com.zixiken.dimdoors.shared.world.ModBiomes;
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
import net.minecraft.entity.EnumCreatureType;
|
||||||
import net.minecraft.init.Biomes;
|
import net.minecraft.init.Biomes;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -53,7 +54,7 @@ public class LimboGenerator implements IChunkGenerator {
|
||||||
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
|
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
|
||||||
|
|
||||||
/** The biomes that are used to generate the chunk */
|
/** The biomes that are used to generate the chunk */
|
||||||
private Biome[] biomesForGeneration = { new LimboBiome() };
|
private Biome[] biomesForGeneration = { ModBiomes.LIMBO };
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen3 */
|
/** A double array that hold terrain noise from noiseGen3 */
|
||||||
double[] noise3;
|
double[] noise3;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.zixiken.dimdoors.shared.blocks.BlockFabric;
|
||||||
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
|
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
|
||||||
import com.zixiken.dimdoors.shared.util.Location;
|
import com.zixiken.dimdoors.shared.util.Location;
|
||||||
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
||||||
|
import com.zixiken.dimdoors.shared.world.ModBiomes;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
@ -13,7 +14,7 @@ import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.DimensionType;
|
import net.minecraft.world.DimensionType;
|
||||||
import net.minecraft.world.WorldProvider;
|
import net.minecraft.world.WorldProvider;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.BiomeProviderSingle;
|
||||||
import net.minecraft.world.gen.IChunkGenerator;
|
import net.minecraft.world.gen.IChunkGenerator;
|
||||||
import net.minecraftforge.client.IRenderHandler;
|
import net.minecraftforge.client.IRenderHandler;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
@ -21,41 +22,18 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class WorldProviderLimbo extends WorldProvider {
|
public class WorldProviderLimbo extends WorldProvider {
|
||||||
|
|
||||||
private IRenderHandler skyRenderer;
|
@SideOnly(Side.CLIENT) private final IRenderHandler skyRenderer = new LimboSkyProvider();
|
||||||
private LimboBiome limboBiome;
|
@SideOnly(Side.CLIENT) private final IRenderHandler cloudRenderer = new CloudRenderBlank();
|
||||||
|
|
||||||
public WorldProviderLimbo() {
|
@Override
|
||||||
|
public void init() {
|
||||||
hasSkyLight = false;
|
hasSkyLight = false;
|
||||||
skyRenderer = new LimboSkyProvider();
|
biomeProvider = new BiomeProviderSingle(ModBiomes.LIMBO);
|
||||||
limboBiome = new LimboBiome();
|
|
||||||
//this.spawner
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public IRenderHandler getSkyRenderer() {
|
|
||||||
return skyRenderer;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome getBiomeForCoords(BlockPos pos) {
|
|
||||||
return limboBiome;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRespawnHere() {
|
public boolean canRespawnHere() {
|
||||||
return false; //properties.HardcoreLimboEnabled;
|
return false; // TODO: properties.HardcoreLimboEnabled;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isBlockHighHumidity(BlockPos pos)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canSnowAt(BlockPos pos, boolean checkLight) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,8 +42,7 @@ public class WorldProviderLimbo extends WorldProvider {
|
||||||
|
|
||||||
for (int steps = 0; steps <= 15; ++steps) {
|
for (int steps = 0; steps <= 15; ++steps) {
|
||||||
float var3 = 1.0F - steps / 15.0F;
|
float var3 = 1.0F - steps / 15.0F;
|
||||||
lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier) * 3;
|
||||||
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,14 +56,10 @@ public class WorldProviderLimbo extends WorldProvider {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getMoonPhase(long par1, float par3) {
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSaveFolder() {
|
@SideOnly(Side.CLIENT)
|
||||||
return "DIM" + getDimension() + "DimDoorsLimbo";
|
public int getMoonPhase(long worldTime) {
|
||||||
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -100,20 +73,6 @@ public class WorldProviderLimbo extends WorldProvider {
|
||||||
return (double) world.getHeight() / 4 - 800;
|
return (double) world.getHeight() / 4 - 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public Vec3d getSkyColor(Entity cameraEntity, float partialTicks)
|
|
||||||
{
|
|
||||||
setCloudRenderer( new CloudRenderBlank());
|
|
||||||
return Vec3d.ZERO;
|
|
||||||
|
|
||||||
}
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public Vec3d getFogColor(float p_76562_1_, float p_76562_2_) {
|
|
||||||
return new Vec3d(.2, .2, .2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRespawnDimension(EntityPlayerMP player) {
|
public int getRespawnDimension(EntityPlayerMP player) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -121,17 +80,12 @@ public class WorldProviderLimbo extends WorldProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IChunkGenerator createChunkGenerator() {
|
public IChunkGenerator createChunkGenerator() {
|
||||||
return new LimboGenerator(world, 45);
|
return new LimboGenerator(world, world.getSeed());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canBlockFreeze(BlockPos pos, boolean byWater) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Location getLimboSkySpawn(EntityPlayer player) {
|
public static Location getLimboSkySpawn(EntityPlayer player) {
|
||||||
int x = (int) player.posX + MathHelper.clamp(player.world.rand.nextInt(), -100, 100); //-properties.LimboEntryRange, properties.LimboEntryRange);
|
int x = (int) player.posX + MathHelper.clamp(player.world.rand.nextInt(), -100, 100); // TODO: -properties.LimboEntryRange, properties.LimboEntryRange);
|
||||||
int z = (int) player.posZ + MathHelper.clamp(player.world.rand.nextInt(), -100, 100); //-properties.LimboEntryRange, properties.LimboEntryRange);
|
int z = (int) player.posZ + MathHelper.clamp(player.world.rand.nextInt(), -100, 100); // TODO: -properties.LimboEntryRange, properties.LimboEntryRange);
|
||||||
return new Location(DimDoorDimensions.LIMBO.getId(), x, 700, z);
|
return new Location(DimDoorDimensions.LIMBO.getId(), x, 700, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,4 +100,29 @@ public class WorldProviderLimbo extends WorldProvider {
|
||||||
public DimensionType getDimensionType() {
|
public DimensionType getDimensionType() {
|
||||||
return DimDoorDimensions.LIMBO;
|
return DimDoorDimensions.LIMBO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public Vec3d getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||||
|
return Vec3d.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public Vec3d getFogColor(float celestialAngle, float partialTicks) {
|
||||||
|
return new Vec3d(.2, .2, .2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IRenderHandler getSkyRenderer() {
|
||||||
|
return skyRenderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IRenderHandler getCloudRenderer() {
|
||||||
|
return cloudRenderer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
||||||
|
|
||||||
|
import com.zixiken.dimdoors.shared.entities.EntityMonolith;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
|
import net.minecraft.world.biome.BiomeDecorator;
|
||||||
|
import net.minecraft.world.chunk.ChunkPrimer;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BiomeBlank extends Biome {
|
||||||
|
|
||||||
|
private boolean white;
|
||||||
|
|
||||||
|
public BiomeBlank(boolean white, boolean monoliths) { // TODO: split this class
|
||||||
|
super(new BiomeProperties((monoliths ? "Dangerous " : "") + (white ? "White" : "Black") + " Void")
|
||||||
|
.setBaseHeight(0F)
|
||||||
|
.setHeightVariation(0F)
|
||||||
|
.setRainDisabled()
|
||||||
|
.setRainfall(0));
|
||||||
|
// TODO: set water color too?
|
||||||
|
this.white = white;
|
||||||
|
|
||||||
|
topBlock = Blocks.AIR.getDefaultState();
|
||||||
|
fillerBlock = Blocks.AIR.getDefaultState();
|
||||||
|
|
||||||
|
spawnableMonsterList.clear();
|
||||||
|
spawnableCreatureList.clear();
|
||||||
|
spawnableWaterCreatureList.clear();
|
||||||
|
spawnableCaveCreatureList.clear();
|
||||||
|
if (monoliths) spawnableMonsterList.add(new SpawnListEntry(EntityMonolith.class, 100, 4, 4));
|
||||||
|
|
||||||
|
flowers.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public BiomeDecorator createBiomeDecorator() { return null; } // For efficiency
|
||||||
|
|
||||||
|
@Override public void decorate(World worldIn, Random rand, BlockPos pos) {}
|
||||||
|
|
||||||
|
@Override public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getSkyColorByTemp(float currentTemperature) {
|
||||||
|
return white ? 0xFFFFFF : 0x000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: check that black/white grass and foliage in getModdedBiomeGrassColor is compatible with other mods such as Quark's greener grass option
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getGrassColorAtPos(BlockPos pos) {
|
||||||
|
return getModdedBiomeGrassColor(white ? 0xFFFFFF : 0x111111);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getFoliageColorAtPos(BlockPos pos) {
|
||||||
|
return getModdedBiomeFoliageColor(white ? 0xFFFFFF : 0x111111);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EnumCreatureType;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
import net.minecraft.world.chunk.ChunkPrimer;
|
||||||
|
import net.minecraft.world.gen.IChunkGenerator;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ChunkGeneratorBlank implements IChunkGenerator {
|
||||||
|
|
||||||
|
private World world;
|
||||||
|
|
||||||
|
public ChunkGeneratorBlank(World world, long seed) {
|
||||||
|
this.world = world;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Chunk generateChunk(int x, int z) {
|
||||||
|
Chunk chunk = new Chunk(world, new ChunkPrimer(), x, z);
|
||||||
|
if(!chunk.isTerrainPopulated()) chunk.setTerrainPopulated(true);
|
||||||
|
return chunk;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void populate(int x, int z) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean generateStructures(Chunk chunkIn, int x, int z) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override @Nullable public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { return null; }
|
||||||
|
|
||||||
|
@Override public void recreateStructures(Chunk chunkIn, int x, int z) {}
|
||||||
|
|
||||||
|
@Override public boolean isInsideStructure(World worldIn, String structureName, BlockPos pos) { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) {
|
||||||
|
return world.getBiome(pos).getSpawnableList(creatureType);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,69 +0,0 @@
|
||||||
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
import net.minecraft.world.gen.IChunkGenerator;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class PocketChunkGenerator implements IChunkGenerator {
|
|
||||||
|
|
||||||
private World worldObj;
|
|
||||||
|
|
||||||
//private CustomLimboPopulator spawner;
|
|
||||||
|
|
||||||
public PocketChunkGenerator(World world, long seed /*CustomLimboPopulator spawner*/) {
|
|
||||||
worldObj = world;
|
|
||||||
|
|
||||||
//this.spawner = spawner;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Chunk generateChunk(int x, int z) {
|
|
||||||
ChunkPrimer primer = new ChunkPrimer();
|
|
||||||
Chunk chunk = new Chunk(worldObj, primer, x, z);
|
|
||||||
|
|
||||||
if(!chunk.isTerrainPopulated()) {
|
|
||||||
chunk.setTerrainPopulated(true);
|
|
||||||
//spawner.registerChunkForPopulation(worldObj.provider.dimensionId, chunkX, chunkZ);
|
|
||||||
}
|
|
||||||
return chunk;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void populate(int x, int z) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean generateStructures(Chunk chunkIn, int x, int z) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void recreateStructures(Chunk chunkIn, int x, int z) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isInsideStructure(World worldIn, String structureName, BlockPos pos) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
|
||||||
|
|
||||||
import com.zixiken.dimdoors.shared.world.CustomSkyProvider;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Jared Johnson on 1/24/2017.
|
|
||||||
*/
|
|
||||||
public class PocketSkyProvider extends CustomSkyProvider {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResourceLocation getMoonRenderPath() {
|
|
||||||
return new ResourceLocation("DimDoors:textures/other/limbo_moon.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResourceLocation getSunRenderPath() {
|
|
||||||
return new ResourceLocation("DimDoors:textures/other/limbo_sun.png");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +1,44 @@
|
||||||
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
||||||
|
|
||||||
|
import com.zixiken.dimdoors.client.CloudRenderBlank;
|
||||||
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
||||||
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
||||||
|
import com.zixiken.dimdoors.shared.world.ModBiomes;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.world.biome.BiomeProviderSingle;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class WorldProviderDungeonPocket extends WorldProviderPublicPocket {
|
public class WorldProviderDungeonPocket extends WorldProviderPocket {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
super.init();
|
||||||
|
biomeProvider = new BiomeProviderSingle(ModBiomes.DANGEROUS_BLACK_VOID);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumPocketType getPocketType() {
|
public EnumPocketType getPocketType() {
|
||||||
return EnumPocketType.DUNGEON;
|
return EnumPocketType.DUNGEON;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSaveFolder() {
|
|
||||||
return "DIM" + getDimension() + "DimDoorsDungeon";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRespawnDimension(EntityPlayerMP player) {
|
public int getRespawnDimension(EntityPlayerMP player) {
|
||||||
return DimDoorDimensions.LIMBO.getId();
|
return DimDoorDimensions.LIMBO.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public Vec3d getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||||
|
setCloudRenderer(new CloudRenderBlank());
|
||||||
|
return Vec3d.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Vec3d getFogColor(float celestialAngle, float partialTicks) {
|
||||||
|
return Vec3d.ZERO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,27 +2,30 @@ package com.zixiken.dimdoors.shared.world.pocketdimension;
|
||||||
|
|
||||||
import com.zixiken.dimdoors.client.CloudRenderBlank;
|
import com.zixiken.dimdoors.client.CloudRenderBlank;
|
||||||
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
||||||
|
import com.zixiken.dimdoors.shared.world.ModBiomes;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.world.biome.BiomeProviderSingle;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
/**
|
public class WorldProviderPersonalPocket extends WorldProviderPocket {
|
||||||
* Created by Jared Johnson on 1/24/2017.
|
|
||||||
*/
|
|
||||||
public class WorldProviderPersonalPocket extends WorldProviderPublicPocket {
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3d getSkyColor(Entity cameraEntity, float partialTicks) {
|
public void init() {
|
||||||
setCloudRenderer(new CloudRenderBlank());
|
super.init();
|
||||||
return new Vec3d(1, 1, 1);
|
biomeProvider = new BiomeProviderSingle(ModBiomes.WHITE_VOID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumPocketType getPocketType() {
|
||||||
|
return EnumPocketType.PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void generateLightBrightnessTable() {
|
protected void generateLightBrightnessTable() {
|
||||||
for (int i = 0; i <= 15; ++i) {
|
for (int i = 0; i <= 15; ++i) {
|
||||||
this.lightBrightnessTable[i] = (15);
|
lightBrightnessTable[i] = 15;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,24 +34,20 @@ public class WorldProviderPersonalPocket extends WorldProviderPublicPocket {
|
||||||
return world.getHeight() - 256;
|
return world.getHeight() - 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public Vec3d getFogColor(float p_76562_1_, float p_76562_2_) {
|
|
||||||
return new Vec3d(1, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getActualHeight() {
|
public int getActualHeight() {
|
||||||
return -256;
|
return -256;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public EnumPocketType getPocketType() {
|
public Vec3d getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||||
return EnumPocketType.PRIVATE;
|
return new Vec3d(1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSaveFolder() {
|
@SideOnly(Side.CLIENT)
|
||||||
return "DIM" + getDimension() + "DimDoorsPersonal";
|
public Vec3d getFogColor(float celestialAngle, float partialTicks) {
|
||||||
|
return new Vec3d(1, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.zixiken.dimdoors.shared.world.pocketdimension;
|
||||||
|
|
||||||
|
import com.zixiken.dimdoors.client.CloudRenderBlank;
|
||||||
|
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
||||||
|
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.world.DimensionType;
|
||||||
|
import net.minecraft.world.WorldProvider;
|
||||||
|
import net.minecraft.world.gen.IChunkGenerator;
|
||||||
|
import net.minecraftforge.client.IRenderHandler;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public abstract class WorldProviderPocket extends WorldProvider {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT) private final IRenderHandler cloudRenderer = new CloudRenderBlank();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
// TODO: save pocket registry nbt here? (see WorldProviderEnd)
|
||||||
|
hasSkyLight = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IChunkGenerator createChunkGenerator() {
|
||||||
|
return new ChunkGeneratorBlank(world, world.getSeed());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DimensionType getDimensionType() {
|
||||||
|
return DimDoorDimensions.getPocketDimensionType(getPocketType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public float calculateCelestialAngle(long worldTime, float partialTicks) { return 0.0F; }
|
||||||
|
|
||||||
|
@Override public boolean canRespawnHere() { return false; }
|
||||||
|
|
||||||
|
@Override public boolean isSurfaceWorld() { return false; }
|
||||||
|
|
||||||
|
@Override public boolean canCoordinateBeSpawn(int x, int z) { return true; } // Spawn is set even if it canCoordinateBeSpawn is false after 1000 tries anyway
|
||||||
|
|
||||||
|
@Override public int getAverageGroundLevel() { return 15; } // TODO: set this to 10 + yBase in the config
|
||||||
|
|
||||||
|
@Override public boolean shouldMapSpin(String entity, double x, double z, double rotation) { return true; }
|
||||||
|
|
||||||
|
@Override @Nullable
|
||||||
|
@SideOnly(Side.CLIENT) public float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks) { return null; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IRenderHandler getCloudRenderer() {
|
||||||
|
return cloudRenderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override @SideOnly(Side.CLIENT) public boolean doesXZShowFog(int x, int z) {
|
||||||
|
return false; // TODO: set this to true outside of pockets
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Vec3d getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||||
|
return Vec3d.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override @SideOnly(Side.CLIENT) public Vec3d getFogColor(float celestialAngle, float partialTicks) { return Vec3d.ZERO; }
|
||||||
|
|
||||||
|
public abstract EnumPocketType getPocketType();
|
||||||
|
}
|
|
@ -2,24 +2,24 @@ package com.zixiken.dimdoors.shared.world.pocketdimension;
|
||||||
|
|
||||||
import com.zixiken.dimdoors.client.CloudRenderBlank;
|
import com.zixiken.dimdoors.client.CloudRenderBlank;
|
||||||
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
import com.zixiken.dimdoors.shared.pockets.EnumPocketType;
|
||||||
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
|
import com.zixiken.dimdoors.shared.world.ModBiomes;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.DimensionType;
|
import net.minecraft.world.biome.BiomeProviderSingle;
|
||||||
import net.minecraft.world.WorldProvider;
|
|
||||||
import net.minecraft.world.gen.IChunkGenerator;
|
|
||||||
import net.minecraftforge.client.IRenderHandler;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class WorldProviderPublicPocket extends WorldProvider { //@todo, we might want an abstract super class to this one?
|
public class WorldProviderPublicPocket extends WorldProviderPocket {
|
||||||
|
|
||||||
//protected CustomLimboPopulator spawner;
|
@Override
|
||||||
protected IRenderHandler skyRenderer;
|
public void init() {
|
||||||
|
super.init();
|
||||||
|
biomeProvider = new BiomeProviderSingle(ModBiomes.BLACK_VOID);
|
||||||
|
}
|
||||||
|
|
||||||
public WorldProviderPublicPocket() {
|
@Override
|
||||||
hasSkyLight = true;
|
public EnumPocketType getPocketType() {
|
||||||
|
return EnumPocketType.PUBLIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
@ -29,72 +29,9 @@ public class WorldProviderPublicPocket extends WorldProvider { //@todo, we might
|
||||||
return Vec3d.ZERO;
|
return Vec3d.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3d getFogColor(float p_76562_1_, float p_76562_2_) {
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Vec3d getFogColor(float celestialAngle, float partialTicks) {
|
||||||
return Vec3d.ZERO;
|
return Vec3d.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getHorizon() {
|
|
||||||
return world.getHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IChunkGenerator createChunkGenerator() {
|
|
||||||
return new PocketChunkGenerator(world, 0); //, spawner);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canSnowAt(BlockPos pos, boolean checkLight) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canBlockFreeze(BlockPos pos, boolean byWater) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float calculateCelestialAngle(long worldTime, float partialTicks) {
|
|
||||||
return .5F;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSurfaceWorld() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*@Override
|
|
||||||
protected void generateLightBrightnessTable() {
|
|
||||||
for (int steps = 0; steps <= 15; ++steps) {
|
|
||||||
float var3 = (float) (Math.pow(steps, 1.5) / Math.pow(15.0F, 1.5));
|
|
||||||
this.lightBrightnessTable[15 - steps] = var3;
|
|
||||||
System.out.println(this.lightBrightnessTable[steps] + "light");
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canRespawnHere() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getActualHeight() {
|
|
||||||
return 256;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumPocketType getPocketType() {
|
|
||||||
return EnumPocketType.PUBLIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSaveFolder() {
|
|
||||||
return "DIM" + getDimension() + "DimDoorsPublic";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DimensionType getDimensionType() {
|
|
||||||
return DimDoorDimensions.getPocketDimensionType(getPocketType());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue