Refractored DimWall to Fabric

Refractored
-BlockDimWall to BlockFabric
-ItemBlockDimWall to ItemBlockFabric
This commit is contained in:
Mathijs Riezebos 2017-04-12 13:01:46 +02:00
parent 18a185603d
commit 5d5240e81c
8 changed files with 26 additions and 26 deletions

View file

@ -35,15 +35,15 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
@SuppressWarnings("deprecation")
public class BlockDimWall extends Block {
public class BlockFabric extends Block {
public static final String ID = "blockFabric";
public static final PropertyEnum<BlockDimWall.EnumType> TYPE = PropertyEnum.<BlockDimWall.EnumType>create("type", BlockDimWall.EnumType.class);
public static final PropertyEnum<BlockFabric.EnumType> TYPE = PropertyEnum.<BlockFabric.EnumType>create("type", BlockFabric.EnumType.class);
private static final float SUPER_HIGH_HARDNESS = 10000000000000F;
private static final float SUPER_EXPLOSION_RESISTANCE = 18000000F;
public BlockDimWall() {
public BlockFabric() {
super(Material.IRON);
this.setCreativeTab(DimDoors.dimDoorsCreativeTab);
setLightLevel(1.0F);

View file

@ -13,7 +13,7 @@ public class ModBlocks {
public static BlockDimDoorChaos blockDimDoorChaos;
public static BlockDimDoor blockDimDoor;
public static BlockTransTrapdoor blockDimHatch;
public static BlockDimWall blockFabric;
public static BlockFabric blockFabric;
public static BlockRift blockRift;
public static void registerBlocks() {
@ -25,7 +25,7 @@ public class ModBlocks {
GameRegistry.register(blockDimDoorWarp = new BlockDimDoorWarp());
GameRegistry.register(blockDimDoor = new BlockDimDoor());
GameRegistry.register(blockDimHatch = new BlockTransTrapdoor());
GameRegistry.register(blockFabric = new BlockDimWall());
GameRegistry.register(blockFabric = new BlockFabric());
GameRegistry.register(blockDimDoorTransient = new BlockDimDoorTransient());
GameRegistry.register(blockRift = new BlockRift());
}

View file

@ -1,21 +1,21 @@
package com.zixiken.dimdoors.shared.items;
import com.zixiken.dimdoors.DimDoors;
import com.zixiken.dimdoors.shared.blocks.BlockDimWall;
import com.zixiken.dimdoors.shared.blocks.BlockFabric;
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockDimWall extends ItemBlock {
public class ItemBlockFabric extends ItemBlock {
private final static String[] subNames = {"Reality", "Ancient", "Altered", "Unraveled", "Eternal"};
public ItemBlockDimWall() {
public ItemBlockFabric() {
super(ModBlocks.blockFabric);
setCreativeTab(DimDoors.dimDoorsCreativeTab);
setMaxDamage(0);
setHasSubtypes(true);
setRegistryName(BlockDimWall.ID);
setRegistryName(BlockFabric.ID);
}
@Override

View file

@ -15,7 +15,7 @@ public class ModItems {
public static ItemDimDoorUnstable itemDimDoorChaos;
public static ItemDoorQuartz itemDoorQuartz;
public static ItemDimDoorPersonal itemDimDoorPersonal;
public static ItemBlockDimWall itemBlockDimWall;
public static ItemBlockFabric itemBlockFabric;
public static ItemRiftConnectionTool itemRiftConnectionTool;
public static ItemRiftBlade itemRiftBlade;
@ -33,7 +33,7 @@ public class ModItems {
GameRegistry.register(itemRiftBlade = new ItemRiftBlade());
//ItemBlocks
GameRegistry.register(itemBlockDimWall = new ItemBlockDimWall());
GameRegistry.register(itemBlockFabric = new ItemBlockFabric());
GameRegistry.register(new ItemBlock(ModBlocks.blockDimHatch)
.setRegistryName(ModBlocks.blockDimHatch.getRegistryName()));
GameRegistry.register(new ItemBlock(ModBlocks.blockRift)

View file

@ -35,7 +35,7 @@ public class Schematic {
private static final String[] NEWDIMDOORBLOCKNAMES = new String[]{
"blockDimDoor",
"blockDimWall", //[type=fabric] is the default blockstate
"blockFabric", //[type=fabric] is the default blockstate
"blockDimDoorTransient",
"blockDimDoorWarp"};
@ -341,7 +341,7 @@ public class Schematic {
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockString));
blockstate = block.getDefaultState();
} else {
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation("dimdoors:blockDimWall"));
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation("dimdoors:blockFabric"));
blockstate = getBlockStateWithProperties(block, new String[]{"type=ancient"});
}
schematic.pallette.add(blockstate);
@ -407,8 +407,8 @@ public class Schematic {
/*
public static void TempGenerateDefaultSchematics() {
for (int pocketSize = 0; pocketSize < 8; pocketSize++) {
generateDefaultSchematic("defaultPublic", pocketSize, ModBlocks.blockDimWall.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.REALITY), ModBlocks.blockDimDoor);
generateDefaultSchematic("defaultPrivate", pocketSize, ModBlocks.blockDimWall.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.ALTERED), ModBlocks.blockDimDoorPersonal);
generateDefaultSchematic("defaultPublic", pocketSize, ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.REALITY), ModBlocks.blockDimDoor);
generateDefaultSchematic("defaultPrivate", pocketSize, ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ALTERED), ModBlocks.blockDimDoorPersonal);
}
}
@ -430,7 +430,7 @@ public class Schematic {
schematic.paletteMax = 4;
schematic.pallette = new ArrayList();
schematic.pallette.add(Blocks.AIR.getDefaultState());
schematic.pallette.add(ModBlocks.blockDimWall.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.ANCIENT));
schematic.pallette.add(ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ANCIENT));
schematic.pallette.add(innerWallBlockState);
schematic.pallette.add(doorBlock.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER)); //bottom
schematic.pallette.add(doorBlock.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER)); //top

View file

@ -1,6 +1,6 @@
package com.zixiken.dimdoors.shared.world.limbodimension;
import com.zixiken.dimdoors.shared.blocks.BlockDimWall;
import com.zixiken.dimdoors.shared.blocks.BlockFabric;
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
import net.minecraft.block.BlockContainer;
@ -34,7 +34,7 @@ public class LimboDecay {
public static IBlockState[] getDecaySequence() {
if (decaySequence == null) {
decaySequence = new IBlockState[] {
ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.UNRAVELED),
ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED),
Blocks.GRAVEL.getDefaultState(),
Blocks.COBBLESTONE.getDefaultState(),
Blocks.STONE.getDefaultState()
@ -47,8 +47,8 @@ public class LimboDecay {
public static IBlockState[] getBlocksImmuneToDecay() {
if (blocksImmuneToDecay == null) {
blocksImmuneToDecay = new IBlockState[] {
ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.UNRAVELED),
ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.ETERNAL),
ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED),
ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ETERNAL),
ModBlocks.blockDimDoorTransient.getDefaultState(),
ModBlocks.blockDimDoor.getDefaultState(),
ModBlocks.blockDimDoorWarp.getDefaultState(),
@ -120,7 +120,7 @@ public class LimboDecay {
private static boolean decayBlockFast(World world, BlockPos pos) {
IBlockState block = world.getBlockState(pos);
if (canDecayBlock(block, world, pos)) {
world.setBlockState(pos, ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.UNRAVELED));
world.setBlockState(pos, ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED));
return true;
}
return false;

View file

@ -1,6 +1,6 @@
package com.zixiken.dimdoors.shared.world.limbodimension;
import com.zixiken.dimdoors.shared.blocks.BlockDimWall;
import com.zixiken.dimdoors.shared.blocks.BlockFabric;
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Biomes;
@ -307,10 +307,10 @@ public class LimboGenerator implements IChunkGenerator
int zCoord = zSectionPart + zRel;
if(vxyz > 0) {
primer.setBlockState(xCoord, yCoord, zCoord,
ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.UNRAVELED));
ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED));
} else if(yCoord < 6) {
primer.setBlockState(xCoord, yCoord, zCoord,
ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.ETERNAL));
ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.ETERNAL));
}
}

View file

@ -1,7 +1,7 @@
package com.zixiken.dimdoors.shared.world.limbodimension;
import com.zixiken.dimdoors.client.CloudRenderBlank;
import com.zixiken.dimdoors.shared.blocks.BlockDimWall;
import com.zixiken.dimdoors.shared.blocks.BlockFabric;
import com.zixiken.dimdoors.shared.blocks.ModBlocks;
import com.zixiken.dimdoors.shared.util.Location;
import com.zixiken.dimdoors.shared.world.DimDoorDimensions;
@ -92,7 +92,7 @@ public class WorldProviderLimbo extends WorldProvider {
@Override
public boolean canCoordinateBeSpawn(int x, int z) {
BlockPos pos = this.world.getTopSolidOrLiquidBlock(new BlockPos(x, 0, z));
return world.getBlockState(pos).equals(ModBlocks.blockFabric.getDefaultState().withProperty(BlockDimWall.TYPE, BlockDimWall.EnumType.UNRAVELED));
return world.getBlockState(pos).equals(ModBlocks.blockFabric.getDefaultState().withProperty(BlockFabric.TYPE, BlockFabric.EnumType.UNRAVELED));
}
@Override