Split the fabrics and implement colored fabric, fix #29

This commit is contained in:
Runemoro 2018-01-18 21:14:00 -05:00
parent 92eb69c2e0
commit 87416e442d
133 changed files with 649 additions and 409 deletions

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.ddutils;
package org.dimdev.ddutils;
import org.jgrapht.Graph;

View file

@ -1,5 +1,6 @@
package org.dimdev.dimdoors.client;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import org.dimdev.dimdoors.shared.CommonProxy;
import org.dimdev.dimdoors.shared.entities.EntityMonolith;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
@ -21,11 +22,20 @@ public class ClientProxy extends CommonProxy {
@Override
public void onPreInitialization(FMLPreInitializationEvent event) {
super.onPreInitialization(event);
// ModelManager.addCustomStateMappers(); // TODO: fix this
ModelManager.registerModelVariants();
registerRenderers();
}
@Override
public void afterItemsRegistered() {
// Model variants can't be registered from onInitialization because that's too late (models have
// already been loaded by minecraft), but they can't be registered from the onPreInitialization
// event because that's too early (items haven't been registered yet, so RegistryDelegate.name == null.
// causing all item variants to be added to the same item (RegistryDelegate.equals compares the names
// of the delegates only).
ModelManager.registerModelVariants();
// ModelManager.addCustomStateMappers(); // TODO: fix this
}
@Override
public void onInitialization(FMLInitializationEvent event) {
super.onInitialization(event);

View file

@ -1,5 +1,6 @@
package org.dimdev.dimdoors.client;
import net.minecraft.item.EnumDyeColor;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.items.ModItems;
import net.minecraft.block.BlockDoor;
@ -19,13 +20,12 @@ import static net.minecraft.item.Item.getItemFromBlock;
public final class ModelManager {
public static void registerModels() {
//ItemBlock registration
register(getItemFromBlock(ModBlocks.FABRIC), 0, "reality");
register(getItemFromBlock(ModBlocks.FABRIC), 1, "ancient");
register(getItemFromBlock(ModBlocks.FABRIC), 2, "altered");
register(getItemFromBlock(ModBlocks.FABRIC), 3, "ancient_altered");
register(getItemFromBlock(ModBlocks.FABRIC), 4, "unraveled");
register(getItemFromBlock(ModBlocks.FABRIC), 5, "eternal");
for (EnumDyeColor color : EnumDyeColor.values()) {
register(getItemFromBlock(ModBlocks.FABRIC), color.getMetadata(), color.getName());
register(getItemFromBlock(ModBlocks.ANCIENT_FABRIC), color.getMetadata(), color.getName());
}
register(getItemFromBlock(ModBlocks.UNRAVELLED_FABRIC));
register(getItemFromBlock(ModBlocks.ETERNAL_FABRIC));
register(getItemFromBlock(ModBlocks.RIFT));
register(getItemFromBlock(ModBlocks.WOOD_DIMENSIONAL_TRAPDOOR));
@ -52,13 +52,42 @@ public final class ModelManager {
}
public static void registerModelVariants() {
ModelBakery.registerItemVariants(ModItems.FABRIC, // we can't use getItemForBlock yet since items have not yet been registered (and this can't be run later)
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_reality"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_ancient"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_altered"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_ancient_altered"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_unraveled"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_eternal"));
ModelBakery.registerItemVariants(ModItems.FABRIC,
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_white"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_orange"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_magenta"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_light_blue"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_yellow"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_lime"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_pink"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_gray"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_silver"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_cyan"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_purple"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_blue"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_brown"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_green"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_red"),
new ResourceLocation(ModBlocks.FABRIC.getRegistryName() + "_black"));
ModelBakery.registerItemVariants(ModItems.ANCIENT_FABRIC,
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_white"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_orange"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_magenta"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_light_blue"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_yellow"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_lime"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_pink"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_gray"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_silver"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_cyan"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_purple"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_blue"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_brown"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_green"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_red"),
new ResourceLocation(ModBlocks.ANCIENT_FABRIC.getRegistryName() + "_black"));
}
private static void register(Item item) {
@ -82,7 +111,6 @@ public final class ModelManager {
ModelLoader.setCustomStateMapper(ModBlocks.UNSTABLE_DIMENSIONAL_DOOR, map);
ModelLoader.setCustomStateMapper(ModBlocks.WARP_DIMENSIONAL_DOOR, map);
ModelLoader.setCustomStateMapper(ModBlocks.DIMENSIONAL_PORTAL, new StateMap.Builder().ignore(
BlockDoor.FACING, BlockDoor.HALF, BlockDoor.HINGE, BlockDoor.OPEN, BlockDoor.POWERED).build());
ModelLoader.setCustomStateMapper(ModBlocks.DIMENSIONAL_PORTAL, new StateMap.Builder().ignore(BlockDoor.FACING, BlockDoor.HALF, BlockDoor.HINGE, BlockDoor.OPEN, BlockDoor.POWERED).build());
}
}

View file

@ -3,6 +3,7 @@ package org.dimdev.dimdoors.shared;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.WorldProvider;
import net.minecraftforge.client.IRenderHandler;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.entities.EntityMonolith;
@ -40,6 +41,8 @@ public abstract class CommonProxy {
registerRiftDestinations();
}
public void afterItemsRegistered() {}
public void registerRiftDestinations() {
RiftDestination.destinationRegistry.put("available_link", AvailableLinkDestination.class);
RiftDestination.destinationRegistry.put("escape", EscapeDestination.class);
@ -71,4 +74,5 @@ public abstract class CommonProxy {
public abstract void setCloudRenderer(WorldProvider provider, IRenderHandler renderer);
public abstract void setSkyRenderer(WorldProvider provider, IRenderHandler renderer);
}

View file

@ -11,7 +11,7 @@ import org.dimdev.dimdoors.shared.pockets.Pocket;
import org.dimdev.dimdoors.shared.pockets.PocketRegistry;
import org.dimdev.ddutils.Location;
import org.dimdev.dimdoors.shared.world.ModDimensions;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
/*@Value*/ @ToString @AllArgsConstructor @NoArgsConstructor @Builder(toBuilder = true)
@NBTSerializable public class VirtualLocation implements INBTStorable { // TODO: fix AnnotatedNBT and rename this class back to VirtualLocation

View file

@ -1,5 +1,6 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.BlockStainedHardenedClay;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import org.dimdev.dimdoors.DimDoors;

View file

@ -42,7 +42,7 @@ public class BlockDimensionalDoorWood extends BlockDimensionalDoor {
.negativeDepthFactor(80)
.positiveDepthFactor(Double.MAX_VALUE)
.weightMaximum(100)
.noLink(false).newRiftWeight(1).build());
.noLink(false).newRiftWeight(0).build());
}
@Override

View file

@ -7,7 +7,6 @@ import org.dimdev.dimdoors.shared.items.ModItems;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -23,7 +22,7 @@ public class BlockDoorGold extends BlockDoor {
super(Material.IRON);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(CreativeTabs.REDSTONE);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setHardness(0.1F);
}

View file

@ -7,7 +7,6 @@ import org.dimdev.dimdoors.shared.items.ModItems;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -23,7 +22,7 @@ public class BlockDoorQuartz extends BlockDoor {
super(Material.ROCK);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(CreativeTabs.REDSTONE);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setHardness(0.1F);
}

View file

@ -1,142 +1,47 @@
package org.dimdev.dimdoors.shared.blocks;
import java.util.Random;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.world.limbodimension.LimboDecay;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import org.dimdev.dimdoors.DimDoors;
public class BlockFabric extends Block {
import java.util.Random;
public class BlockFabric extends BlockColored {
public static final Material FABRIC = new Material(MapColor.BLACK);
public static final String ID = "fabric";
public static final PropertyEnum<EnumType> TYPE = PropertyEnum.create("type", BlockFabric.EnumType.class);
public enum EnumType implements IStringSerializable {
REALITY("reality", 0),
ANCIENT("ancient", 1),
ALTERED("altered", 2),
ANCIENT_ALTERED("ancient_altered", 3),
UNRAVELED("unraveled", 4),
ETERNAL("eternal", 5);
@Getter private final String name;
@Getter private final int meta;
EnumType(String name, int meta) {
this.name = name;
this.meta = meta;
}
public String toString() {
return name;
}
}
public BlockFabric() {
super(FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setDefaultState(getDefaultState().withProperty(COLOR, EnumDyeColor.BLACK));
setHardness(0.1F);
setSoundType(SoundType.STONE);
setDefaultState(getDefaultState().withProperty(TYPE, EnumType.REALITY));
setTickRandomly(true);
}
// States
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, TYPE);
setLightLevel(1);
}
@Override
@SuppressWarnings("deprecation")
public IBlockState getStateFromMeta(int meta) {
if (meta < EnumType.values().length) {
return getDefaultState().withProperty(TYPE, EnumType.values()[meta]);
} else {
return getDefaultState();
}
}
@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(TYPE).ordinal();
}
@Override
public int damageDropped(IBlockState state) {
return getMetaFromState(state);
}
@Override
public void getSubBlocks(CreativeTabs item, NonNullList<ItemStack> items) {
for (BlockFabric.EnumType type : EnumType.values()) {
items.add(new ItemStack(this, 1, type.getMeta()));
}
}
// Block properties
// TODO: Maybe we should split this into several classes, since different fabrics have very little in common other than the name:
// 1. Reality/Altered
// 2. Ancient/Altered Ancient
// 3. Unravelled
// 4. Eternal (which we should make a liquid)
@Override
@SuppressWarnings("deprecation")
public float getBlockHardness(IBlockState state, World world, BlockPos pos) {
if (state.getValue(TYPE).equals(EnumType.ANCIENT) || state.getValue(TYPE).equals(EnumType.ANCIENT_ALTERED) || state.getValue(TYPE).equals(EnumType.ETERNAL)) {
return -1; // unbreakable
} else {
return super.getBlockHardness(state, world, pos);
}
}
@Override
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) {
IBlockState state = world.getBlockState(pos);
if (state.getValue(TYPE).equals(EnumType.ANCIENT) || state.getValue(TYPE).equals(EnumType.ANCIENT_ALTERED) || state.getValue(TYPE).equals(EnumType.ETERNAL)) {
return 6000000.0F / 5;
} else {
return super.getExplosionResistance(world, pos, exploder, explosion);
}
}
@Override
@SuppressWarnings("deprecation")
public int getLightValue(IBlockState state) {
switch (state.getValue(TYPE)) {
case REALITY:
case ALTERED:
case ANCIENT:
case ANCIENT_ALTERED:
return 15;
default:
return 0;
}
public void getSubBlocks(CreativeTabs item, NonNullList<ItemStack> items) { // TODO: make textures for all colors
items.add(new ItemStack(this, 1, EnumDyeColor.BLACK.getMetadata()));
items.add(new ItemStack(this, 1, EnumDyeColor.WHITE.getMetadata()));
}
@Override
@ -145,68 +50,24 @@ public class BlockFabric extends Block {
}
@Override
@SuppressWarnings("deprecation")
public MapColor getMapColor(IBlockState state, IBlockAccess world, BlockPos pos) {
switch (state.getValue(TYPE)) {
case REALITY:
case ANCIENT:
return MapColor.BLOCK_COLORS[EnumDyeColor.BLACK.getMetadata()];
case ALTERED:
case ANCIENT_ALTERED:
return MapColor.BLOCK_COLORS[EnumDyeColor.WHITE.getMetadata()];
case UNRAVELED:
return MapColor.BLOCK_COLORS[EnumDyeColor.GRAY.getMetadata()]; // TODO: make black?
case ETERNAL:
return MapColor.BLOCK_COLORS[EnumDyeColor.PINK.getMetadata()];
}
return MapColor.BLACK;
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Items.AIR;
}
// Block logic
/**
* Replace the block clicked with the held block instead of placing the
* block on top of it. Shift click to disable.
*/
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
ItemStack heldItem = player.getHeldItem(hand);
if (heldItem.getItem() instanceof ItemBlock && (state.getValue(TYPE).equals(EnumType.REALITY) || state.getValue(TYPE).equals(EnumType.ALTERED))) {
Block block = Block.getBlockFromItem(heldItem.getItem());
if (!block.getDefaultState().isNormalCube() || block.hasTileEntity(block.getDefaultState())
|| block == this // this also keeps it from being replaced by Ancient Fabric
|| player.isSneaking()) { // TODO: what if the player is holding shift but not sneaking?
return false;
}
if (!world.isRemote) { //@todo on a server, returning false or true determines where the block gets placed?
if (!player.isCreative()) heldItem.setCount(heldItem.getCount() - 1);
world.setBlockState(pos, block.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, heldItem.getMetadata(), player, hand)); //choosing getStateForPlacement over getDefaultState, because it will cause directional blocks, like logs to rotate correctly
}
return true;
Block block = Block.getBlockFromItem(heldItem.getItem());
if (!block.getDefaultState().isNormalCube() || block.hasTileEntity(block.getDefaultState())
|| block == this
|| player.isSneaking()) { // TODO: what if the player is holding shift but not sneaking?
return false;
}
return false;
}
// TODO
/*
@Override
public void onEntityWalk(World world, BlockPos pos, Entity entity) {
IBlockState state = world.getBlockState(pos);
if (state.getValue(TYPE) == EnumType.ETERNAL && world.provider instanceof WorldProviderLimbo && entity instanceof EntityPlayer) {
Location loc = VirtualLocation.fromLocation(new Location(world, pos)).projectToWorld();
BlockPos correctedPos = loc.getWorld().getTopSolidOrLiquidBlock(loc.getPos());
Random random = new Random();
TeleportUtils.teleport(entity, new Location(loc.getDim(), correctedPos), random.nextFloat() * 360, random.nextFloat() * 360);
}
}
*/
@Override
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
// Spread unravelled fabric decay in Limbo
if (state.getValue(TYPE) == EnumType.UNRAVELED && world.provider instanceof WorldProviderLimbo) {
LimboDecay.applySpreadDecay(world, pos);
if (!world.isRemote) { //@todo on a server, returning false or true determines where the block gets placed?
if (!player.isCreative()) heldItem.setCount(heldItem.getCount() - 1);
world.setBlockState(pos, block.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, heldItem.getMetadata(), player, hand)); //choosing getStateForPlacement over getDefaultState, because it will cause directional blocks, like logs to rotate correctly
}
return true;
}
}

View file

@ -0,0 +1,52 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.BlockColored;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import org.dimdev.dimdoors.DimDoors;
import java.util.Random;
public class BlockFabricAncient extends BlockColored {
public static final String ID = "ancient_fabric";
public static final PropertyEnum<EnumDyeColor> COLOR = PropertyEnum.create("color", EnumDyeColor.class);
public BlockFabricAncient() {
super(Material.ROCK);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setDefaultState(getDefaultState().withProperty(COLOR, EnumDyeColor.BLACK));
setHardness(-1);
setResistance(6000000.0F);
disableStats();
setSoundType(SoundType.STONE);
setLightLevel(1);
}
@Override
public void getSubBlocks(CreativeTabs item, NonNullList<ItemStack> items) { // TODO: make textures for all colors
items.add(new ItemStack(this, 1, EnumDyeColor.BLACK.getMetadata()));
items.add(new ItemStack(this, 1, EnumDyeColor.WHITE.getMetadata()));
}
@Override
public int quantityDropped(Random random) {
return 1;
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Items.AIR;
}
}

View file

@ -0,0 +1,34 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.BlockEmptyDrops;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.dimdev.dimdoors.DimDoors;
public class BlockFabricEternal extends BlockEmptyDrops { // TODO: make this a glowing red liquid
public static final Material ETERNAL_FABRIC = new Material(MapColor.PINK);
public static final String ID = "eternal_fabric";
public BlockFabricEternal() {
super(ETERNAL_FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setHardness(-1);
setResistance(6000000.0F);
disableStats();
setLightLevel(1);
setSoundType(SoundType.STONE);
}
@Override
public void onEntityWalk(World world, BlockPos pos, Entity entity) {
// TODO: implement using a destination
}
}

View file

@ -0,0 +1,40 @@
package org.dimdev.dimdoors.shared.blocks;
import net.minecraft.block.BlockEmptyDrops;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.world.limbo.LimboDecay;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
import java.util.Random;
public class BlockFabricUnravelled extends BlockEmptyDrops {
public static final Material UNRAVELLED_FABRIC = new Material(MapColor.GRAY);
public static final String ID = "unravelled_fabric";
public BlockFabricUnravelled() {
super(UNRAVELLED_FABRIC);
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setHardness(0.1F);
setSoundType(SoundType.STONE);
setTickRandomly(true);
}
@Override
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
// Spread decay in Limbo
if (world.provider instanceof WorldProviderLimbo) {
LimboDecay.applySpreadDecay(world, pos);
}
}
}

View file

@ -21,6 +21,9 @@ public final class ModBlocks {
// Blocks
public static final BlockFabric FABRIC = new BlockFabric();
public static final BlockFabricAncient ANCIENT_FABRIC = new BlockFabricAncient();
public static final BlockFabricEternal ETERNAL_FABRIC = new BlockFabricEternal();
public static final BlockFabricUnravelled UNRAVELLED_FABRIC = new BlockFabricUnravelled();
public static final BlockFloatingRift RIFT = new BlockFloatingRift();
@SubscribeEvent
@ -36,6 +39,9 @@ public final class ModBlocks {
WARP_DIMENSIONAL_DOOR,
WOOD_DIMENSIONAL_TRAPDOOR,
FABRIC,
ANCIENT_FABRIC,
UNRAVELLED_FABRIC,
ETERNAL_FABRIC,
RIFT);
}
}

View file

@ -4,7 +4,7 @@ import org.dimdev.dimdoors.shared.sound.ModSounds;
import org.dimdev.dimdoors.shared.Config;
import org.dimdev.ddutils.Location;
import org.dimdev.ddutils.TeleportUtils;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.pocketdimension.WorldProviderDungeonPocket;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityFlying;

View file

@ -1,31 +0,0 @@
package org.dimdev.dimdoors.shared.items;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemFabric extends ItemBlock {
private static final String[] subNames = {"_reality", "_ancient", "_altered", "_ancient_altered", "_unraveled", "_eternal"};
public ItemFabric() {
super(ModBlocks.FABRIC);
setMaxDamage(0);
setHasSubtypes(true);
setCreativeTab(DimDoors.DIM_DOORS_CREATIVE_TAB);
setUnlocalizedName(BlockFabric.ID);
setRegistryName(BlockFabric.ID);
}
@Override
public int getMetadata(int damage) {
return damage;
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName() + subNames[getDamage(stack)];
}
}

View file

@ -3,8 +3,10 @@ package org.dimdev.dimdoors.shared.items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemColored;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
public final class ModItems {
@ -38,7 +40,11 @@ public final class ModItems {
public static final ItemWovenWorldThreadArmor BOOTS_WOVEN_WORLD_THREAD = new ItemWovenWorldThreadArmor("boots_woven_world_thread", 1, EntityEquipmentSlot.FEET);
// ItemBlocks
public static final ItemFabric FABRIC = new ItemFabric();
public static final Item FABRIC = new ItemColored(ModBlocks.FABRIC, true).setSubtypeNames(new String[] {"white", "orange", "magenta", "lightBlue", "yellow", "lime", "pink", "gray", "silver", "cyan", "purple", "blue", "brown", "green", "red", "black"}).setRegistryName(ModBlocks.FABRIC.getRegistryName());
public static final Item ANCIENT_FABRIC = new ItemColored(ModBlocks.ANCIENT_FABRIC, true).setSubtypeNames(new String[] {"white", "orange", "magenta", "lightBlue", "yellow", "lime", "pink", "gray", "silver", "cyan", "purple", "blue", "brown", "green", "red", "black"}).setRegistryName(ModBlocks.ANCIENT_FABRIC.getRegistryName());
public static final Item UNRAVELLED_FABRIC = new ItemBlock(ModBlocks.UNRAVELLED_FABRIC).setRegistryName(ModBlocks.UNRAVELLED_FABRIC.getRegistryName());
public static final Item ETERNAL_FABRIC = new ItemBlock(ModBlocks.ETERNAL_FABRIC).setRegistryName(ModBlocks.ETERNAL_FABRIC.getRegistryName());
public static final Item RIFT = new ItemBlock(ModBlocks.RIFT).setRegistryName(ModBlocks.RIFT.getRegistryName());
public static final ItemDimensionalTrapdoorWood WOOD_DIMENSIONAL_TRAPDOOR = new ItemDimensionalTrapdoorWood();
@SubscribeEvent
@ -61,12 +67,14 @@ public final class ModItems {
HELMET_WOVEN_WORLD_THREAD,
CHESTPLATE_WOVEN_WORLD_THREAD,
LEGGINGS_WOVEN_WORLD_THREAD,
BOOTS_WOVEN_WORLD_THREAD);
// ItemBlocks
event.getRegistry().registerAll(
BOOTS_WOVEN_WORLD_THREAD,
FABRIC,
ANCIENT_FABRIC,
UNRAVELLED_FABRIC,
ETERNAL_FABRIC,
WOOD_DIMENSIONAL_TRAPDOOR,
new ItemBlock(ModBlocks.RIFT).setRegistryName(ModBlocks.RIFT.getRegistryName()));
RIFT);
DimDoors.proxy.afterItemsRegistered();
}
}

View file

@ -146,7 +146,7 @@ import java.util.Set;
riftEntity.teleportTo(entity, thisRift.getYaw(), thisRift.getPitch());
} else {
// Make a new dungeon pocket
Pocket pocket = PocketGenerator.generateDungeonPocket(virtualLocation);
Pocket pocket = PocketGenerator.generateDungeonPocket(virtualLocation); // TODO make the generated dungeon of the same type, but in the overworld
pocket.setup();
// Link the pocket back

View file

@ -6,7 +6,7 @@ import org.dimdev.dimdoors.shared.rifts.RiftDestination;
import org.dimdev.dimdoors.shared.rifts.registry.RiftRegistry;
import org.dimdev.dimdoors.shared.rifts.TileEntityRift;
import org.dimdev.dimdoors.shared.world.ModDimensions;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
import org.dimdev.ddutils.Location;
import org.dimdev.ddutils.TeleportUtils;
import lombok.AllArgsConstructor;

View file

@ -2,7 +2,7 @@ package org.dimdev.dimdoors.shared.rifts.destinations;
import org.dimdev.ddutils.RotatedLocation;
import org.dimdev.dimdoors.shared.rifts.RiftDestination;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
import org.dimdev.ddutils.TeleportUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;

View file

@ -14,7 +14,7 @@ import org.dimdev.dimdoors.shared.rifts.RiftDestination;
import org.dimdev.dimdoors.shared.rifts.TileEntityRift;
import org.dimdev.dimdoors.shared.rifts.registry.RiftRegistry;
import org.dimdev.dimdoors.shared.world.ModDimensions;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.pocketdimension.WorldProviderPersonalPocket;
import java.util.UUID;

View file

@ -9,7 +9,7 @@ import net.minecraftforge.common.DimensionManager;
import org.dimdev.ddutils.Location;
import org.dimdev.ddutils.WorldUtils;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.ddutils.GraphUtils;
import org.dimdev.ddutils.GraphUtils;
import org.dimdev.dimdoors.shared.pockets.Pocket;
import org.dimdev.dimdoors.shared.pockets.PocketRegistry;
import org.dimdev.dimdoors.shared.world.ModDimensions;

View file

@ -1,22 +1,11 @@
package org.dimdev.dimdoors.shared.tools;
import net.minecraft.block.Block;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.server.ServerProxy;
import org.dimdev.dimdoors.shared.blocks.BlockDimensionalDoor;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.rifts.*;
import org.dimdev.dimdoors.shared.rifts.destinations.PocketEntranceDestination;
import org.dimdev.dimdoors.shared.rifts.destinations.PocketExitDestination;
import org.dimdev.dimdoors.shared.rifts.destinations.PrivatePocketExitDestination;
import org.dimdev.dimdoors.shared.rifts.registry.LinkProperties;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
import org.dimdev.ddutils.schem.Schematic;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Bootstrap;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.event.RegistryEvent;
@ -26,12 +15,27 @@ import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.registries.GameData;
import net.minecraftforge.registries.RegistryManager;
import org.dimdev.ddutils.schem.Schematic;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.server.ServerProxy;
import org.dimdev.dimdoors.shared.blocks.BlockDimensionalDoor;
import org.dimdev.dimdoors.shared.blocks.BlockFabricAncient;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.rifts.RiftDestination;
import org.dimdev.dimdoors.shared.rifts.destinations.PocketEntranceDestination;
import org.dimdev.dimdoors.shared.rifts.destinations.PocketExitDestination;
import org.dimdev.dimdoors.shared.rifts.destinations.PrivatePocketExitDestination;
import org.dimdev.dimdoors.shared.rifts.registry.LinkProperties;
import org.dimdev.dimdoors.shared.tileentities.TileEntityEntranceRift;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* @author Robijnvogel
@ -92,16 +96,16 @@ public final class PocketSchematicGenerator {
schematics.add(generatePocketSchematic(
"public_pocket", // base name
pocketSize, // size
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ANCIENT), // outer wall
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.REALITY), // inner wall
ModBlocks.ANCIENT_FABRIC.getDefaultState(), // outer wall
ModBlocks.FABRIC.getDefaultState(), // inner wall
ModBlocks.DIMENSIONAL_DOOR, // door
PocketExitDestination.builder().build(),
1)); // exit rift destination
schematics.add(generatePocketSchematic(
"private_pocket", // base name
pocketSize, // size
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ANCIENT_ALTERED), // outer wall
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ALTERED), // inner wall
ModBlocks.ANCIENT_FABRIC.getDefaultState().withProperty(BlockFabricAncient.COLOR, EnumDyeColor.WHITE), // outer wall
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabricAncient.COLOR, EnumDyeColor.WHITE), // inner wall
ModBlocks.PERSONAL_DIMENSIONAL_DOOR, // door
PrivatePocketExitDestination.builder().build(),
0)); // exit rift destination
@ -150,8 +154,8 @@ public final class PocketSchematicGenerator {
}
}
}
schematic.blockData[(size - 1)/2][5][4] = 3; // door bottom
schematic.blockData[(size - 1)/2][6][4] = 4; // door top
schematic.blockData[(size - 1) / 2][5][4] = 3; // door bottom
schematic.blockData[(size - 1) / 2][6][4] = 4; // door top
// Generate the rift TileEntities
schematic.tileEntities = new ArrayList<>();

View file

@ -15,7 +15,6 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import org.dimdev.ddutils.schem.Schematic;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.entities.EntityMonolith;
import org.dimdev.dimdoors.shared.rifts.destinations.AvailableLinkDestination;
@ -83,7 +82,7 @@ public final class SchematicConverter {
block = ModBlocks.DIMENSIONAL_PORTAL.getDefaultState();
break;
case 220:
block = ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.REALITY);
block = ModBlocks.ANCIENT_FABRIC.getDefaultState();
break;
case 95: // Locked chest's ID was replaced with stained glass in 1.7.2
DimDoors.log.error("Schematic contained a locked chest, which was removed in 1.7.2.");

View file

@ -1,7 +1,7 @@
package org.dimdev.dimdoors.shared.world;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.world.limbodimension.BiomeLimbo;
import org.dimdev.dimdoors.shared.world.limbo.BiomeLimbo;
import org.dimdev.dimdoors.shared.world.pocketdimension.BiomeBlank;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;

View file

@ -5,7 +5,7 @@ import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import org.dimdev.dimdoors.shared.Config;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
import org.dimdev.dimdoors.shared.world.pocketdimension.WorldProviderDungeonPocket;
import org.dimdev.dimdoors.shared.world.pocketdimension.WorldProviderPersonalPocket;
import org.dimdev.dimdoors.shared.world.pocketdimension.WorldProviderPublicPocket;

View file

@ -14,10 +14,9 @@ import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.ArrayList;
import java.util.Random;
public class GatewayGenerator implements IWorldGenerator
{
public static final int MAX_GATEWAY_GENERATION_CHANCE = 10;
public static final int MAX_CLUSTER_GENERATION_CHANCE = 10;
public class GatewayGenerator implements IWorldGenerator {
public static final int MAX_GATEWAY_GENERATION_CHANCE = 10000;
public static final int MAX_CLUSTER_GENERATION_CHANCE = 10000;
private static final int CLUSTER_GROWTH_CHANCE = 80;
private static final int MAX_CLUSTER_GROWTH_CHANCE = 100;
private static final int MIN_RIFT_Y = 4;

View file

@ -1,29 +1,27 @@
package org.dimdev.dimdoors.shared.world.gateways;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.limbodimension.WorldProviderLimbo;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemDoor;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.limbo.WorldProviderLimbo;
public class GatewayLimbo extends BaseGateway {
@Override
public void generate(World world, int x, int y, int z)
{
IBlockState limbo = ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED);
public void generate(World world, int x, int y, int z) {
IBlockState unravelledFabric = ModBlocks.UNRAVELLED_FABRIC.getDefaultState();
// Build the gateway out of Unraveled Fabric. Since nearly all the blocks in Limbo are of
// that type, there is no point replacing the ground.
world.setBlockState(new BlockPos(x, y + 3, z + 1), limbo);
world.setBlockState(new BlockPos(x, y + 3, z - 1), limbo);
world.setBlockState(new BlockPos(x, y + 3, z + 1), unravelledFabric);
world.setBlockState(new BlockPos(x, y + 3, z - 1), unravelledFabric);
// Build the columns around the door
world.setBlockState(new BlockPos(x, y + 2, z - 1), limbo);
world.setBlockState(new BlockPos(x, y + 2, z + 1), limbo);
world.setBlockState(new BlockPos(x, y + 1, z - 1), limbo);
world.setBlockState(new BlockPos(x, y + 1, z + 1), limbo);
world.setBlockState(new BlockPos(x, y + 2, z - 1), unravelledFabric);
world.setBlockState(new BlockPos(x, y + 2, z + 1), unravelledFabric);
world.setBlockState(new BlockPos(x, y + 1, z - 1), unravelledFabric);
world.setBlockState(new BlockPos(x, y + 1, z + 1), unravelledFabric);
ItemDoor.placeDoor(world, new BlockPos(x, y + 1, z), EnumFacing.getHorizontal(0), ModBlocks.DIMENSIONAL_PORTAL, false);
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.shared.world.limbodimension;
package org.dimdev.dimdoors.shared.world.limbo;
import org.dimdev.dimdoors.shared.entities.EntityMonolith;
import net.minecraft.util.math.BlockPos;

View file

@ -1,8 +1,6 @@
package org.dimdev.dimdoors.shared.world.limbodimension;
package org.dimdev.dimdoors.shared.world.limbo;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.ModDimensions;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
@ -11,6 +9,8 @@ import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.ForgeChunkManager;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.ModDimensions;
import java.util.Random;
@ -29,12 +29,12 @@ public final class LimboDecay {
private static IBlockState[] decaySequence = null;
private static final Random random = new Random();
private static IBlockState[] blocksImmuneToDecay = null;
private static Block[] blocksImmuneToDecay = null;
public static IBlockState[] getDecaySequence() {
if (decaySequence == null) {
decaySequence = new IBlockState[]{
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED),
ModBlocks.UNRAVELLED_FABRIC.getDefaultState(),
Blocks.GRAVEL.getDefaultState(),
Blocks.COBBLESTONE.getDefaultState(),
Blocks.STONE.getDefaultState()
@ -44,21 +44,19 @@ public final class LimboDecay {
return decaySequence;
}
public static IBlockState[] getBlocksImmuneToDecay() {
public static Block[] getBlocksImmuneToDecay() {
if (blocksImmuneToDecay == null) {
blocksImmuneToDecay = new IBlockState[]{
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED),
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ETERNAL),
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ANCIENT),
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ANCIENT_ALTERED),
ModBlocks.DIMENSIONAL_PORTAL.getDefaultState(),
ModBlocks.DIMENSIONAL_DOOR.getDefaultState(),
ModBlocks.WARP_DIMENSIONAL_DOOR.getDefaultState(),
ModBlocks.RIFT.getDefaultState(),
ModBlocks.UNSTABLE_DIMENSIONAL_DOOR.getDefaultState(),
ModBlocks.GOLD_DOOR.getDefaultState(),
ModBlocks.QUARTZ_DOOR.getDefaultState(),
ModBlocks.GOLD_DIMENSIONAL_DOOR.getDefaultState()
blocksImmuneToDecay = new Block[]{
ModBlocks.UNRAVELLED_FABRIC,
ModBlocks.ETERNAL_FABRIC,
ModBlocks.DIMENSIONAL_PORTAL,
ModBlocks.DIMENSIONAL_DOOR,
ModBlocks.WARP_DIMENSIONAL_DOOR,
ModBlocks.RIFT,
ModBlocks.UNSTABLE_DIMENSIONAL_DOOR,
ModBlocks.GOLD_DOOR,
ModBlocks.QUARTZ_DOOR,
ModBlocks.GOLD_DIMENSIONAL_DOOR
};
}
@ -121,7 +119,7 @@ public final class LimboDecay {
IBlockState block = world.getBlockState(pos);
if (canDecayBlock(block, world, pos)) {
if (block.isNormalCube()) {
world.setBlockState(pos, ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED));
world.setBlockState(pos, ModBlocks.UNRAVELLED_FABRIC.getDefaultState());
} else {
world.setBlockState(pos, Blocks.AIR.getDefaultState());
}
@ -164,17 +162,17 @@ public final class LimboDecay {
/**
* Checks if a block can decay. We will not decay air, certain DD blocks, or containers.
*/
private static boolean canDecayBlock(IBlockState block, World world, BlockPos pos) {
private static boolean canDecayBlock(IBlockState state, World world, BlockPos pos) {
if (world.isAirBlock(pos)) {
return false;
}
for (int k = 0; k < getBlocksImmuneToDecay().length; k++) {
if (block.equals(getBlocksImmuneToDecay()[k])) {
if (state.getBlock().equals(getBlocksImmuneToDecay()[k])) {
return false;
}
}
return !(block instanceof BlockContainer);
return !(state instanceof BlockContainer);
}
}

View file

@ -1,19 +1,18 @@
package org.dimdev.dimdoors.shared.world.limbodimension;
package org.dimdev.dimdoors.shared.world.limbo;
import net.minecraft.world.WorldEntitySpawner;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.ModBiomes;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Biomes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.WorldEntitySpawner;
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 net.minecraft.world.gen.NoiseGeneratorOctaves;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.ModBiomes;
import javax.annotation.Nullable;
import java.util.List;
@ -43,7 +42,6 @@ public class LimboGenerator implements IChunkGenerator {
private World world;
private double[] heightMap;
private Biome[] biomesForGeneration = {ModBiomes.LIMBO};
double[] depthRegion;
@ -262,11 +260,9 @@ public class LimboGenerator implements IChunkGenerator {
for (int zRel = 0; zRel < xzSectionSize; ++zRel) {
int zCoord = zSectionPart + zRel;
if (vxyz > 0) {
primer.setBlockState(xCoord, yCoord, zCoord,
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED));
primer.setBlockState(xCoord, yCoord, zCoord, ModBlocks.UNRAVELLED_FABRIC.getDefaultState());
} else if (yCoord < 6) {
primer.setBlockState(xCoord, yCoord, zCoord,
ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ETERNAL));
primer.setBlockState(xCoord, yCoord, zCoord, ModBlocks.ETERNAL_FABRIC.getDefaultState());
}
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.shared.world.limbodimension;
package org.dimdev.dimdoors.shared.world.limbo;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.world.CustomSkyProvider;

View file

@ -1,12 +1,5 @@
package org.dimdev.dimdoors.shared.world.limbodimension;
package org.dimdev.dimdoors.shared.world.limbo;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.ddutils.render.CloudRenderBlank;
import org.dimdev.dimdoors.shared.blocks.BlockFabric;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.ddutils.Location;
import org.dimdev.dimdoors.shared.world.ModDimensions;
import org.dimdev.dimdoors.shared.world.ModBiomes;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.math.BlockPos;
@ -18,6 +11,12 @@ import net.minecraft.world.biome.BiomeProviderSingle;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.dimdev.ddutils.Location;
import org.dimdev.ddutils.render.CloudRenderBlank;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.shared.blocks.ModBlocks;
import org.dimdev.dimdoors.shared.world.ModBiomes;
import org.dimdev.dimdoors.shared.world.ModDimensions;
public class WorldProviderLimbo extends WorldProvider {
@ -62,7 +61,7 @@ public class WorldProviderLimbo extends WorldProvider {
@Override
public boolean canCoordinateBeSpawn(int x, int z) {
BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(x, 0, z));
return world.getBlockState(pos).equals(ModBlocks.FABRIC.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED));
return world.getBlockState(pos).equals(ModBlocks.UNRAVELLED_FABRIC.getDefaultState());
}
@Override

View file

@ -0,0 +1,20 @@
{
"variants": {
"color=white": { "model": "dimdoors:ancient_fabric_white" },
"color=orange": { "model": "dimdoors:ancient_fabric_orange" },
"color=magenta": { "model": "dimdoors:ancient_fabric_magenta" },
"color=light_blue": { "model": "dimdoors:ancient_fabric_light_blue" },
"color=yellow": { "model": "dimdoors:ancient_fabric_yellow" },
"color=lime": { "model": "dimdoors:ancient_fabric_lime" },
"color=pink": { "model": "dimdoors:ancient_fabric_pink" },
"color=gray": { "model": "dimdoors:ancient_fabric_gray" },
"color=silver": { "model": "dimdoors:ancient_fabric_silver" },
"color=cyan": { "model": "dimdoors:ancient_fabric_cyan" },
"color=purple": { "model": "dimdoors:ancient_fabric_purple" },
"color=blue": { "model": "dimdoors:ancient_fabric_blue" },
"color=brown": { "model": "dimdoors:ancient_fabric_brown" },
"color=green": { "model": "dimdoors:ancient_fabric_green" },
"color=red": { "model": "dimdoors:ancient_fabric_red" },
"color=black": { "model": "dimdoors:ancient_fabric_black" }
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "dimdoors:eternal_fabric" }
}
}

View file

@ -1,10 +1,20 @@
{
"variants": {
"type=reality": { "model": "dimdoors:fabric_reality" },
"type=altered": { "model": "dimdoors:fabric_altered" },
"type=ancient": { "model": "dimdoors:fabric_ancient" },
"type=ancient_altered": { "model": "dimdoors:fabric_ancient_altered" },
"type=unraveled": { "model": "dimdoors:fabric_unraveled" },
"type=eternal": { "model": "dimdoors:fabric_eternal" }
"color=white": { "model": "dimdoors:fabric_white" },
"color=orange": { "model": "dimdoors:fabric_orange" },
"color=magenta": { "model": "dimdoors:fabric_magenta" },
"color=light_blue": { "model": "dimdoors:fabric_light_blue" },
"color=yellow": { "model": "dimdoors:fabric_yellow" },
"color=lime": { "model": "dimdoors:fabric_lime" },
"color=pink": { "model": "dimdoors:fabric_pink" },
"color=gray": { "model": "dimdoors:fabric_gray" },
"color=silver": { "model": "dimdoors:fabric_silver" },
"color=cyan": { "model": "dimdoors:fabric_cyan" },
"color=purple": { "model": "dimdoors:fabric_purple" },
"color=blue": { "model": "dimdoors:fabric_blue" },
"color=brown": { "model": "dimdoors:fabric_brown" },
"color=green": { "model": "dimdoors:fabric_green" },
"color=red": { "model": "dimdoors:fabric_red" },
"color=black": { "model": "dimdoors:fabric_black" }
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "dimdoors:unravelled_fabric" }
}
}

View file

@ -11,11 +11,11 @@ tile.warp_dimensional_door.name=Warp-Tür
tile.dimensional_trapdoor.name=Transdimensionale Falltür
tile.dimensional_portal.name=Vergängliche Tür
tile.fabric_reality.name=Stoff der Realität
tile.fabric_altered.name=Veränderter Stoff
tile.fabric_ancient.name=Antiker Stoff
tile.fabric_eternal.name=Ewiger Stoff
tile.fabric_unraveled.name=Entwirrter Stoff
tile.fabric.black.name=Stoff der Realität
tile.fabric.white.name=Veränderter Stoff
tile.ancient_fabric.black.name=Antiker Stoff
tile.eternal_fabric.name=Ewiger Stoff
tile.unravelled_fabric.name=Entwirrter Stoff
tile.rift.name=Spalt
item.gold_door.name=Goldtür

View file

@ -11,12 +11,12 @@ tile.warp_dimensional_door.name=Warp Door
tile.dimensional_trapdoor.name=Transdimensional Trapdoor
tile.dimensional_portal.name=Dimensional Portal
tile.fabric_reality.name=Fabric of Reality
tile.fabric_altered.name=Altered Fabric
tile.fabric_ancient.name=Ancient Fabric
tile.fabric_ancient_altered.name=Ancient Altered Fabric
tile.fabric_eternal.name=Eternal Fabric
tile.fabric_unraveled.name=Unraveled Fabric
tile.fabric.black.name=Fabric of Reality
tile.fabric.white.name=Altered Fabric
tile.ancient_fabric.black.name=Ancient Fabric
tile.ancient_fabric.white.name=Ancient Altered Fabric
tile.eternal_fabric.name=Eternal Fabric
tile.unravelled_fabric.name=Unraveled Fabric
tile.rift.name=Rift
item.gold_door.name=Golden Door

View file

@ -11,12 +11,12 @@ tile.warp_dimensional_door.name=Porte-raccourci
tile.dimensional_trapdoor.name=Trappe transdimensionnelle
tile.dimensional_portal.name=Portail dimensionel
tile.fabric_reality.name=Étoffe de la réalité
tile.fabric_altered.name=Étoffe altérée
tile.fabric_ancient.name=Étoffe ancienne
tile.fabric_ancient_altered.name=Étoffe altérée ancienne
tile.fabric_eternal.name=Étoffe éternelle
tile.fabric_unraveled.name=Étoffe effilochée
tile.fabric.black.name=Étoffe de la réalité
tile.fabric.white.name=Étoffe altérée
tile.ancient_fabric.black.name=Étoffe ancienne
tile.ancient_fabric.white.name=Étoffe altérée ancienne
tile.eternal_fabric.name=Étoffe éternelle
tile.unravelled_fabric.name=Étoffe effilochée
tile.rift.name=Fissure
item.gold_door.name=Porte dorée

View file

@ -11,11 +11,11 @@ tile.warp_dimensional_door.name=Porta distorta
tile.dimensional_trapdoor.name=Botola transdimensionale
tile.dimensional_portal.name=Porta transitoria
tile.fabric_reality.name=Tessuto della realtà
tile.fabric_altered.name=Tessuto alterato
tile.fabric_ancient.name=Tessuto antico
tile.fabric_eternal.name=Tessuto eterno
tile.fabric_unraveled.name=Tessuto disfatto
tile.fabric.black.name=Tessuto della realtà
tile.fabric.white.name=Tessuto alterato
tile.ancient_fabric.black.name=Tessuto antico
tile.eternal_fabric.name=Tessuto eterno
tile.unravelled_fabric.name=Tessuto disfatto
tile.rift.name=Frattura
item.gold_door.name=Porta d'oro

View file

@ -11,11 +11,11 @@ tile.warp_dimensional_door.name=Verdraaideur
tile.dimensional_trapdoor.name=Transdimensionale Valdeur
tile.dimensional_portal.name=Vergankelijke Deur
tile.fabric_reality.name=Werkelijkheidsweefsel
tile.fabric_altered.name=Veranderd Weefsel
tile.fabric_ancient.name=Aloud Weefsel
tile.fabric_eternal.name=Oneindig Weefsel
tile.fabric_unraveled.name=Ontraveld Weefsel
tile.fabric.black.name=Werkelijkheidsweefsel
tile.fabric.white.name=Veranderd Weefsel
tile.ancient_fabric.black.name=Aloud Weefsel
tile.eternal_fabric.name=Oneindig Weefsel
tile.unravelled_fabric.name=Ontraveld Weefsel
tile.rift.name=Scheur
item.gold_door.name=Golden Door

View file

@ -11,12 +11,12 @@ tile.warp_dimensional_door.name=Ușă de distorsiune
tile.dimensional_trapdoor.name=Trapă transdimensională
tile.dimensional_portal.name=Portal dimensional
tile.fabric_reality.name=Țesutul realiții
tile.fabric_altered.name=Țesut alterat
tile.fabric_ancient.name=Țesut antic
tile.fabric_ancient_altered.name=Țesut alterat antic
tile.fabric_eternal.name=Țesut etern
tile.fabric_unraveled.name=Țesut destrămat
tile.fabric.black.name=Țesutul realiții
tile.fabric.white.name=Țesut alterat
tile.ancient_fabric.black.name=Țesut antic
tile.ancient_fabric.white.name=Țesut alterat antic
tile.eternal_fabric.name=Țesut etern
tile.unravelled_fabric.name=Țesut destrămat
tile.rift.name=Fisură
item.gold_door.name=Ușă de aur

View file

@ -11,11 +11,11 @@ tile.warp_dimensional_door.name=Дверь искажения
tile.dimensional_trapdoor.name=Межпространственный люк
tile.dimensional_portal.name=Временная дверь
tile.fabric_reality.name=Ткань Мироздания
tile.fabric_altered.name=Изменённая ткань
tile.fabric_ancient.name=Древняя ткань
tile.fabric_eternal.name=Вечная ткань
tile.fabric_unraveled.name=Распутанная ткань
tile.fabric.black.name=Ткань Мироздания
tile.fabric.white.name=Изменённая ткань
tile.ancient_fabric.black.name=Древняя ткань
tile.eternal_fabric.name=Вечная ткань
tile.unravelled_fabric.name=Распутанная ткань
tile.rift.name=Разлом
item.gold_door.name=Золотая дверь

View file

@ -11,11 +11,11 @@ tile.warp_dimensional_door.name=扭曲之门
tile.dimensional_trapdoor.name=空间活板门
tile.dimensional_portal.name=瞬息之门
tile.fabric_reality.name=现实之壁
tile.fabric_altered.name=变化之壁
tile.fabric_ancient.name=远古之壁
tile.fabric_eternal.name=永恒之壁
tile.fabric_unraveled.name=边境之壁
tile.fabric.black.name=现实之壁
tile.fabric.white.name=变化之壁
tile.ancient_fabric.black.name=远古之壁
tile.eternal_fabric.name=永恒之壁
tile.unravelled_fabric.name=边境之壁
tile.rift.name=裂痕
item.gold_door.name=金门

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_black" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_blue" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_brown" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_cyan" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_gray" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_green" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_light_blue" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_lime" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_magenta" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_orange" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_pink" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_purple" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_red" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_silver" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_white" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/ancient_fabric_yellow" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/eternal_fabric" }
}

View file

@ -1,4 +0,0 @@
{
"parent": "dimdoors:block/fullbright",
"textures": { "all": "dimdoors:blocks/fabric_altered" }
}

View file

@ -1,4 +0,0 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_ancient" }
}

View file

@ -1,4 +0,0 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_ancient_altered" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_black" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_blue" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_brown" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_cyan" }
}

View file

@ -1,4 +0,0 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_eternal" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_gray" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_green" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_light_blue" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_lime" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_magenta" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_orange" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_pink" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_purple" }
}

View file

@ -1,4 +0,0 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_reality" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_red" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_silver" }
}

View file

@ -1,4 +0,0 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_unraveled" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_white" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/fabric_yellow" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:blocks/unravelled_fabric" }
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_black"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_blue"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_brown"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_cyan"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_gray"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_green"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_light_blue"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_lime"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_magenta"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_orange"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_pink"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_purple"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_red"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_silver"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/ancient_fabric_white"
}

Some files were not shown because too many files have changed in this diff Show more