general Block* code cleanup
This commit is contained in:
parent
8bd9370bab
commit
7fd8879c73
294 changed files with 2229 additions and 2650 deletions
|
@ -1,7 +1,7 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.entity.npc.EntityMetalhead;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockDoublePlant;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.entity.animal.EntityWolf;
|
||||
import common.entity.npc.EntityElf;
|
||||
import common.entity.npc.EntityWoodElf;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockTallGrass;
|
||||
import common.block.foliage.BlockTallGrass;
|
||||
import common.entity.animal.EntityChicken;
|
||||
import common.entity.animal.EntityOcelot;
|
||||
import common.init.Blocks;
|
||||
|
|
|
@ -5,11 +5,10 @@ import java.util.Arrays;
|
|||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.block.BlockColored;
|
||||
import common.block.BlockDirt;
|
||||
import common.block.BlockSand;
|
||||
import common.block.natural.BlockDirt;
|
||||
import common.block.natural.BlockSand;
|
||||
import common.color.DyeColor;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.PerlinGen;
|
||||
import common.rng.Random;
|
||||
import common.rng.WeightedList;
|
||||
|
@ -122,7 +121,7 @@ public class BiomeMesa extends GenBiome
|
|||
|
||||
for (int i1 = chunkPrimerIn.height - 1; i1 >= 0; --i1)
|
||||
{
|
||||
if (chunkPrimerIn.get(k1, i1, j1).getBlock().getMaterial() == Material.air && i1 < (int)d4)
|
||||
if (chunkPrimerIn.get(k1, i1, j1).getBlock() == Blocks.air && i1 < (int)d4)
|
||||
{
|
||||
chunkPrimerIn.set(k1, i1, j1, worldState);
|
||||
}
|
||||
|
@ -135,7 +134,7 @@ public class BiomeMesa extends GenBiome
|
|||
// {
|
||||
State iblockstate1 = chunkPrimerIn.get(k1, i1, j1);
|
||||
|
||||
if (iblockstate1.getBlock().getMaterial() == Material.air)
|
||||
if (iblockstate1.getBlock() == Blocks.air)
|
||||
{
|
||||
l = -1;
|
||||
}
|
||||
|
@ -156,7 +155,7 @@ public class BiomeMesa extends GenBiome
|
|||
iblockstate3 = this.fillerBlock;
|
||||
}
|
||||
|
||||
if (i1 < l1 && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
|
||||
if (i1 < l1 && (iblockstate == null || iblockstate.getBlock() == Blocks.air))
|
||||
{
|
||||
iblockstate = liquid;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockDoublePlant;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.entity.animal.EntityHorse;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockDirt;
|
||||
import common.block.BlockDoublePlant;
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
import common.block.natural.BlockDirt;
|
||||
import common.entity.animal.EntityHorse;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockDirt;
|
||||
import common.block.natural.BlockDirt;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
import common.rng.WeightedList;
|
||||
|
|
|
@ -2,10 +2,9 @@ package server.biome;
|
|||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockDirectional;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.entity.npc.EntitySlime;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
|
@ -53,7 +52,7 @@ public class BiomeSwamp extends GenBiome
|
|||
|
||||
for (int k = chunkPrimerIn.height - 1; k >= 0; --k)
|
||||
{
|
||||
if (chunkPrimerIn.get(j, k, i).getBlock().getMaterial() != Material.air)
|
||||
if (chunkPrimerIn.get(j, k, i).getBlock() != Blocks.air)
|
||||
{
|
||||
if (k == 62 && chunkPrimerIn.get(j, k, i).getBlock() != Blocks.water)
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockDirt;
|
||||
import common.block.BlockDoublePlant;
|
||||
import common.block.BlockTallGrass;
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
import common.block.foliage.BlockTallGrass;
|
||||
import common.block.natural.BlockDirt;
|
||||
import common.entity.animal.EntityWolf;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.biome;
|
||||
|
||||
import common.biome.Biome;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.entity.animal.EntityBat;
|
||||
import common.entity.animal.EntityMouse;
|
||||
import common.entity.animal.EntityRabbit;
|
||||
|
|
|
@ -4,10 +4,10 @@ import common.biome.Biome;
|
|||
import common.biome.IBiome;
|
||||
import common.block.Block;
|
||||
import common.block.BlockColored;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.BlockSand;
|
||||
import common.block.BlockSapling;
|
||||
import common.block.BlockTallGrass;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.block.foliage.BlockSapling;
|
||||
import common.block.foliage.BlockTallGrass;
|
||||
import common.block.natural.BlockSand;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.animal.EntityBat;
|
||||
import common.entity.animal.EntityChicken;
|
||||
|
@ -368,7 +368,7 @@ public abstract class GenBiome implements IBiome {
|
|||
BlockFlower.EnumFlowerType blockflower$enumflowertype = this.pickRandomFlower(rand, blockpos1);
|
||||
BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock();
|
||||
|
||||
if (blockflower.getMaterial() != Material.air)
|
||||
if (blockflower != Blocks.air)
|
||||
{
|
||||
this.yellowFlowerGen.setGeneratedBlock(blockflower, blockflower$enumflowertype);
|
||||
this.yellowFlowerGen.generate(world, rand, blockpos1);
|
||||
|
@ -567,7 +567,7 @@ public abstract class GenBiome implements IBiome {
|
|||
{
|
||||
State iblockstate2 = chunkPrimerIn.get(i1, j1, l);
|
||||
|
||||
if (iblockstate2.getBlock().getMaterial() == Material.air)
|
||||
if (iblockstate2.getBlock() == Blocks.air)
|
||||
{
|
||||
j = -1;
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ public abstract class GenBiome implements IBiome {
|
|||
iblockstate1 = this.fillerBlock;
|
||||
}
|
||||
|
||||
if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
|
||||
if (j1 < i && (iblockstate == null || iblockstate.getBlock() == Blocks.air))
|
||||
{
|
||||
if (freeze && World.ABSOLUTE_ZERO + worldIn.getTempOffset() + this.base.getTemperature(blockpos$mutableblockpos.set(x, j1, z)) <= 0.0F)
|
||||
{
|
||||
|
@ -813,7 +813,7 @@ public abstract class GenBiome implements IBiome {
|
|||
{
|
||||
if (j >= i / 16)
|
||||
{
|
||||
if (worldIn.getState(blockpos1).getBlock().getMaterial() == Material.air)
|
||||
if (worldIn.getState(blockpos1).getBlock() == Blocks.air)
|
||||
{
|
||||
if (rand.chance(8))
|
||||
{
|
||||
|
|
|
@ -9,9 +9,9 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockDoor;
|
||||
import common.block.BlockRailBase;
|
||||
import common.block.ITileEntityProvider;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.block.tech.BlockRailBase;
|
||||
import common.collect.Lists;
|
||||
import common.init.Blocks;
|
||||
import common.inventory.IInventory;
|
||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockBed;
|
||||
import common.block.BlockDoor;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.color.DyeColor;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
|
|
|
@ -6,16 +6,16 @@ import java.util.Map;
|
|||
import java.util.function.Predicate;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockDoor;
|
||||
import common.block.BlockLever;
|
||||
import common.block.BlockLog;
|
||||
import common.block.BlockPortal;
|
||||
import common.block.BlockQuartz;
|
||||
import common.block.BlockRail;
|
||||
import common.block.BlockRailBase;
|
||||
import common.block.BlockRailDetector;
|
||||
import common.block.BlockRailPowered;
|
||||
import common.block.BlockRotatedPillar;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.block.artificial.BlockPortal;
|
||||
import common.block.artificial.BlockQuartz;
|
||||
import common.block.foliage.BlockLog;
|
||||
import common.block.tech.BlockLever;
|
||||
import common.block.tech.BlockRail;
|
||||
import common.block.tech.BlockRailBase;
|
||||
import common.block.tech.BlockRailDetector;
|
||||
import common.block.tech.BlockRailPowered;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.properties.IProperty;
|
||||
|
|
|
@ -8,9 +8,9 @@ import java.util.Set;
|
|||
import java.util.function.Predicate;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockFence;
|
||||
import common.block.BlockFenceGate;
|
||||
import common.block.BlockWall;
|
||||
import common.block.artificial.BlockFence;
|
||||
import common.block.artificial.BlockFenceGate;
|
||||
import common.block.artificial.BlockWall;
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
|
@ -26,6 +26,7 @@ import common.entity.projectile.EntityArrow;
|
|||
import common.entity.types.EntityLiving;
|
||||
import common.future.Futures;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.Config;
|
||||
import common.init.EntityRegistry;
|
||||
import common.init.Items;
|
||||
|
@ -45,7 +46,6 @@ import common.item.ItemArmor;
|
|||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.log.Log;
|
||||
import common.material.Material;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagList;
|
||||
import common.network.IPlayer;
|
||||
|
@ -395,7 +395,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
BlockPos blockpos = new BlockPos(i, j, k);
|
||||
Block block = this.entity.worldObj.getState(blockpos).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air)
|
||||
if (block == Blocks.air)
|
||||
{
|
||||
Block block1 = this.entity.worldObj.getState(blockpos.down()).getBlock();
|
||||
|
||||
|
@ -1106,7 +1106,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
int i = this.curblockDamage - this.initialBlockDamage;
|
||||
Block block = this.entity.worldObj.getState(this.removingPos).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air)
|
||||
if (block == Blocks.air)
|
||||
{
|
||||
this.receivedFinishDiggingPacket = false;
|
||||
}
|
||||
|
@ -1132,7 +1132,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
{
|
||||
Block block1 = this.entity.worldObj.getState(this.startPos).getBlock();
|
||||
|
||||
if (block1.getMaterial() == Material.air)
|
||||
if (block1 == Blocks.air)
|
||||
{
|
||||
this.entity.worldObj.sendBlockBreakProgress(this.entity.getId(), this.startPos, -1);
|
||||
this.durabilityRemainingOnBlock = -1;
|
||||
|
@ -1175,13 +1175,13 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
this.initialDamage = this.curblockDamage;
|
||||
float f = 1.0F;
|
||||
|
||||
if (block.getMaterial() != Material.air)
|
||||
if (block != Blocks.air)
|
||||
{
|
||||
block.onBlockClicked(this.entity.worldObj, pos, this.entity);
|
||||
f = block.getPlayerRelativeBlockHardness(this.entity, this.entity.worldObj, pos);
|
||||
}
|
||||
|
||||
if (block.getMaterial() != Material.air && f >= 1.0F)
|
||||
if (block != Blocks.air && f >= 1.0F)
|
||||
{
|
||||
this.tryHarvestBlock(pos);
|
||||
}
|
||||
|
@ -1203,7 +1203,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
int i = this.curblockDamage - this.initialDamage;
|
||||
Block block = this.entity.worldObj.getState(pos).getBlock();
|
||||
|
||||
if (block.getMaterial() != Material.air)
|
||||
if (block != Blocks.air)
|
||||
{
|
||||
float f = block.getPlayerRelativeBlockHardness(this.entity, this.entity.worldObj, pos) * (float)(i + 1);
|
||||
|
||||
|
@ -2399,7 +2399,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
this.cancelDestroyingBlock();
|
||||
}
|
||||
|
||||
if (worldserver.getState(blockpos).getBlock().getMaterial() != Material.air)
|
||||
if (worldserver.getState(blockpos).getBlock() != Blocks.air)
|
||||
{
|
||||
this.sendPacket(new SPacketBlockChange(worldserver, blockpos));
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockDoor;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.collect.Lists;
|
||||
import common.material.Material;
|
||||
import common.nbt.NBTTagCompound;
|
||||
|
|
63
server/src/server/world/BlockEventData.java
Executable file
63
server/src/server/world/BlockEventData.java
Executable file
|
@ -0,0 +1,63 @@
|
|||
package server.world;
|
||||
|
||||
import common.block.Block;
|
||||
import common.util.BlockPos;
|
||||
|
||||
public class BlockEventData
|
||||
{
|
||||
private BlockPos position;
|
||||
private Block blockType;
|
||||
|
||||
/** Different for each blockID */
|
||||
private int eventID;
|
||||
private int eventParameter;
|
||||
|
||||
public BlockEventData(BlockPos pos, Block blockType, int eventId, int p_i45756_4_)
|
||||
{
|
||||
this.position = pos;
|
||||
this.eventID = eventId;
|
||||
this.eventParameter = p_i45756_4_;
|
||||
this.blockType = blockType;
|
||||
}
|
||||
|
||||
public BlockPos getPosition()
|
||||
{
|
||||
return this.position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Event ID (different for each BlockID)
|
||||
*/
|
||||
public int getEventID()
|
||||
{
|
||||
return this.eventID;
|
||||
}
|
||||
|
||||
public int getEventParameter()
|
||||
{
|
||||
return this.eventParameter;
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.blockType;
|
||||
}
|
||||
|
||||
public boolean equals(Object p_equals_1_)
|
||||
{
|
||||
if (!(p_equals_1_ instanceof BlockEventData))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
BlockEventData blockeventdata = (BlockEventData)p_equals_1_;
|
||||
return this.position.equals(blockeventdata.position) && this.eventID == blockeventdata.eventID && this.eventParameter == blockeventdata.eventParameter && this.blockType == blockeventdata.blockType;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "TE(" + this.position + ")," + this.eventID + "," + this.eventParameter + "," + this.blockType;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import common.entity.Entity;
|
|||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.log.Log;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
|
@ -33,7 +32,7 @@ public class ChunkServer extends Chunk {
|
|||
for(int bz = 0; bz < 16; ++bz) {
|
||||
for(int by = 0; by < height; ++by) {
|
||||
State state = BlockRegistry.STATEMAP.getByValue(data[bx << 4 | bz | by << 8]);
|
||||
if(state != null && state.getBlock().getMaterial() != Material.air) {
|
||||
if(state != null && state.getBlock() != Blocks.air) {
|
||||
int y = by >> 4;
|
||||
BlockArray arr = this.getArray(y);
|
||||
if(arr == null) {
|
||||
|
|
|
@ -17,30 +17,30 @@ import java.util.zip.InflaterInputStream;
|
|||
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.block.BlockCactus;
|
||||
import common.block.BlockCarpet;
|
||||
import common.block.BlockColored;
|
||||
import common.block.BlockDirt;
|
||||
import common.block.BlockFire;
|
||||
import common.block.BlockFlower;
|
||||
import common.block.BlockFlowerPot;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.BlockLiquid;
|
||||
import common.block.BlockLog;
|
||||
import common.block.BlockPistonBase;
|
||||
import common.block.BlockPistonHead;
|
||||
import common.block.BlockQuartz;
|
||||
import common.block.BlockRock;
|
||||
import common.block.BlockSand;
|
||||
import common.block.BlockSandStone;
|
||||
import common.block.BlockSlab;
|
||||
import common.block.BlockStainedGlass;
|
||||
import common.block.BlockStainedGlassPane;
|
||||
import common.block.BlockStoneBrick;
|
||||
import common.block.BlockTNT;
|
||||
import common.block.BlockTallGrass;
|
||||
import common.block.BlockWall;
|
||||
import common.block.LeavesType;
|
||||
import common.block.artificial.BlockCarpet;
|
||||
import common.block.artificial.BlockFlowerPot;
|
||||
import common.block.artificial.BlockQuartz;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.block.artificial.BlockStainedGlass;
|
||||
import common.block.artificial.BlockStainedGlassPane;
|
||||
import common.block.artificial.BlockStoneBrick;
|
||||
import common.block.artificial.BlockWall;
|
||||
import common.block.foliage.BlockCactus;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.block.foliage.BlockLog;
|
||||
import common.block.foliage.BlockTallGrass;
|
||||
import common.block.foliage.LeavesType;
|
||||
import common.block.liquid.BlockLiquid;
|
||||
import common.block.natural.BlockDirt;
|
||||
import common.block.natural.BlockFire;
|
||||
import common.block.natural.BlockRock;
|
||||
import common.block.natural.BlockSand;
|
||||
import common.block.natural.BlockSandStone;
|
||||
import common.block.tech.BlockPistonBase;
|
||||
import common.block.tech.BlockPistonHead;
|
||||
import common.block.tech.BlockTNT;
|
||||
import common.collect.Maps;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.Entity;
|
||||
|
|
|
@ -15,11 +15,10 @@ import java.util.function.Predicate;
|
|||
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.block.BlockDoor;
|
||||
import common.block.BlockEventData;
|
||||
import common.block.BlockFalling;
|
||||
import common.block.BlockLiquid;
|
||||
import common.block.BlockSnow;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.block.liquid.BlockLiquid;
|
||||
import common.block.natural.BlockSnow;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.collect.Sets;
|
||||
|
@ -764,14 +763,14 @@ public final class WorldServer extends AWorldServer {
|
|||
NextTickListEntry nextticklistentry = new NextTickListEntry(pos, blockIn);
|
||||
int i = 0;
|
||||
|
||||
if(this.updateForced && blockIn.getMaterial() != Material.air) {
|
||||
if(this.updateForced && blockIn != Blocks.air) {
|
||||
if(blockIn.requiresUpdates()) {
|
||||
i = 8;
|
||||
|
||||
if(this.isAreaLoaded(nextticklistentry.position.add(-i, -i, -i), nextticklistentry.position.add(i, i, i))) {
|
||||
State iblockstate = this.getState(nextticklistentry.position);
|
||||
|
||||
if(iblockstate.getBlock().getMaterial() != Material.air && iblockstate.getBlock() == nextticklistentry.getBlock()) {
|
||||
if(iblockstate.getBlock() != Blocks.air && iblockstate.getBlock() == nextticklistentry.getBlock()) {
|
||||
iblockstate.getBlock().updateTick(this, nextticklistentry.position, iblockstate, this.rand);
|
||||
}
|
||||
}
|
||||
|
@ -783,7 +782,7 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
|
||||
if(this.isAreaLoaded(pos.add(-i, -i, -i), pos.add(i, i, i))) {
|
||||
if(blockIn.getMaterial() != Material.air) {
|
||||
if(blockIn != Blocks.air) {
|
||||
nextticklistentry.setScheduledTime((long)delay + this.time);
|
||||
nextticklistentry.setPriority(priority);
|
||||
}
|
||||
|
@ -799,7 +798,7 @@ public final class WorldServer extends AWorldServer {
|
|||
NextTickListEntry nextticklistentry = new NextTickListEntry(pos, blockIn);
|
||||
nextticklistentry.setPriority(priority);
|
||||
|
||||
if(blockIn.getMaterial() != Material.air) {
|
||||
if(blockIn != Blocks.air) {
|
||||
nextticklistentry.setScheduledTime((long)delay + this.time);
|
||||
}
|
||||
|
||||
|
@ -871,7 +870,7 @@ public final class WorldServer extends AWorldServer {
|
|||
if(this.isAreaLoaded(nextticklistentry1.position.add(-k, -k, -k), nextticklistentry1.position.add(k, k, k))) {
|
||||
State iblockstate = this.getState(nextticklistentry1.position);
|
||||
|
||||
if(iblockstate.getBlock().getMaterial() != Material.air
|
||||
if(iblockstate.getBlock() != Blocks.air
|
||||
&& Block.isEqualTo(iblockstate.getBlock(), nextticklistentry1.getBlock())) {
|
||||
iblockstate.getBlock().updateTick(this, nextticklistentry1.position, iblockstate, this.rand);
|
||||
}
|
||||
|
@ -1140,11 +1139,11 @@ public final class WorldServer extends AWorldServer {
|
|||
if(fire && Config.fire) {
|
||||
BlockPos pos = new BlockPos(entity);
|
||||
if(this.isAreaLoaded(pos, 10)) {
|
||||
if(this.getState(pos).getBlock().getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(this, pos))
|
||||
if(this.getState(pos).getBlock() == Blocks.air && Blocks.fire.canPlaceBlockAt(this, pos))
|
||||
this.setState(pos, Blocks.fire.getState());
|
||||
for(int n = 0; n < 4; n++) {
|
||||
BlockPos extra = pos.add(this.rand.range(-1, 1), this.rand.range(-1, 1), this.rand.range(-1, 1));
|
||||
if(this.getState(extra).getBlock().getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(this, extra))
|
||||
if(this.getState(extra).getBlock() == Blocks.air && Blocks.fire.canPlaceBlockAt(this, extra))
|
||||
this.setState(extra, Blocks.fire.getState());
|
||||
}
|
||||
}
|
||||
|
@ -2360,7 +2359,7 @@ public final class WorldServer extends AWorldServer {
|
|||
if(pos.getY() >= -World.MAX_SIZE_Y && pos.getY() < World.MAX_SIZE_Y) {
|
||||
Block block = this.getState(pos).getBlock();
|
||||
|
||||
if(block.getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(this, pos)) {
|
||||
if(block == Blocks.air && Blocks.fire.canPlaceBlockAt(this, pos)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -2411,7 +2410,7 @@ public final class WorldServer extends AWorldServer {
|
|||
for(int i2 = i1; i2 <= j1; ++i2) {
|
||||
Block block = this.getState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock();
|
||||
|
||||
if(block.getMaterial() != Material.air) {
|
||||
if(block != Blocks.air) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen;
|
||||
|
||||
import common.block.Block;
|
||||
import common.material.Material;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.world.State;
|
||||
|
@ -66,7 +66,7 @@ public class FeatureLiquids
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if (worldIn.getState(position).getBlock().getMaterial() != Material.air && worldIn.getState(position).getBlock() != replace)
|
||||
else if (worldIn.getState(position).getBlock() != Blocks.air && worldIn.getState(position).getBlock() != replace)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package server.worldgen;
|
|||
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.material.Material;
|
||||
import common.init.Blocks;
|
||||
import common.rng.OctaveGen;
|
||||
import common.rng.Random;
|
||||
import common.world.State;
|
||||
|
@ -63,7 +63,7 @@ public class ReplacerAltSurface implements BlockReplacer
|
|||
// {
|
||||
State iblockstate2 = primer.get(k, j1, j);
|
||||
|
||||
if (iblockstate2.getBlock() != null && iblockstate2.getBlock().getMaterial() != Material.air)
|
||||
if (iblockstate2.getBlock() != Blocks.air)
|
||||
{
|
||||
if (iblockstate2.getBlock() == this.fillerBlock)
|
||||
{
|
||||
|
@ -92,7 +92,7 @@ public class ReplacerAltSurface implements BlockReplacer
|
|||
}
|
||||
}
|
||||
|
||||
if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air))
|
||||
if (j1 < i && (iblockstate == null || iblockstate.getBlock() == Blocks.air))
|
||||
{
|
||||
iblockstate = this.liquid;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package server.worldgen;
|
|||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
import common.world.State;
|
||||
import server.world.WorldServer;
|
||||
|
@ -37,7 +36,7 @@ public class ReplacerTopLayer implements BlockReplacer
|
|||
{
|
||||
State iblockstate2 = primer.get(i, i1, j);
|
||||
|
||||
if (iblockstate2.getBlock().getMaterial() == Material.air)
|
||||
if (iblockstate2.getBlock() == Blocks.air)
|
||||
{
|
||||
l = -1;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package server.worldgen.caves;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.BlockColored;
|
||||
import common.block.BlockSand;
|
||||
import common.block.natural.BlockSand;
|
||||
import common.color.DyeColor;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class WorldGenAbandonedChest extends FeatureGenerator
|
|||
public boolean generate(WorldServer worldIn, Random rand, BlockPos position)
|
||||
{
|
||||
Block block;
|
||||
while (((block = worldIn.getState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 1)
|
||||
while (((block = worldIn.getState(position).getBlock()) == Blocks.air || block.getMaterial() == Material.leaves) && position.getY() > 1)
|
||||
{
|
||||
position = position.down();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.feature;
|
||||
|
||||
import common.block.BlockSand;
|
||||
import common.block.BlockSlab;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.block.natural.BlockSand;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package server.worldgen.feature;
|
||||
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
|
@ -28,7 +27,7 @@ public class WorldGenGlowStone extends FeatureGenerator
|
|||
{
|
||||
BlockPos blockpos = position.add(rand.zrange(8) - rand.zrange(8), -rand.zrange(12), rand.zrange(8) - rand.zrange(8));
|
||||
|
||||
if (worldIn.getState(blockpos).getBlock().getMaterial() == Material.air)
|
||||
if (worldIn.getState(blockpos).getBlock() == Blocks.air)
|
||||
{
|
||||
int j = 0;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package server.worldgen.feature;
|
|||
|
||||
import common.block.Block;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import server.world.WorldServer;
|
||||
|
@ -25,7 +24,7 @@ public class WorldGenHellLava extends FeatureGenerator
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if (worldIn.getState(position).getBlock().getMaterial() != Material.air && worldIn.getState(position).getBlock() != Blocks.hellrock)
|
||||
else if (worldIn.getState(position).getBlock() != Blocks.air && worldIn.getState(position).getBlock() != Blocks.hellrock)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package server.worldgen.feature;
|
|||
|
||||
import common.block.Block;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
|
@ -50,7 +49,7 @@ public class WorldGenIceSpike extends FeatureGenerator
|
|||
{
|
||||
Block block = worldIn.getState(position.add(i1, k, j1)).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice)
|
||||
if (block == Blocks.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.add(i1, k, j1), Blocks.packed_ice.getState());
|
||||
}
|
||||
|
@ -59,7 +58,7 @@ public class WorldGenIceSpike extends FeatureGenerator
|
|||
{
|
||||
block = worldIn.getState(position.add(i1, -k, j1)).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice)
|
||||
if (block == Blocks.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.add(i1, -k, j1), Blocks.packed_ice.getState());
|
||||
}
|
||||
|
@ -96,7 +95,7 @@ public class WorldGenIceSpike extends FeatureGenerator
|
|||
{
|
||||
Block block1 = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (block1.getMaterial() != Material.air && block1 != Blocks.dirt && block1 != Blocks.snow && block1 != Blocks.ice && block1 != Blocks.packed_ice)
|
||||
if (block1 != Blocks.air && block1 != Blocks.dirt && block1 != Blocks.snow && block1 != Blocks.ice && block1 != Blocks.packed_ice)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.BlockDoublePlant;
|
||||
import common.block.foliage.BlockDoublePlant;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockHugeMushroom;
|
||||
import common.block.foliage.BlockHugeMushroom;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -56,7 +56,7 @@ public class WorldGenBigMushroom extends FeatureGenerator
|
|||
{
|
||||
Block block = worldIn.getState(blockpos$mutableblockpos.set(l, j, i1)).getBlock();
|
||||
|
||||
if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
|
||||
if (block != Blocks.air && block.getMaterial() != Material.leaves)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ public class WorldGenDeadBush extends FeatureGenerator
|
|||
{
|
||||
Block block;
|
||||
|
||||
while (((block = worldIn.getState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
|
||||
while (((block = worldIn.getState(position).getBlock()) == Blocks.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
|
||||
{
|
||||
position = position.down();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.BlockFlower;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.world.State;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.BlockBush;
|
||||
import common.block.foliage.BlockBush;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import server.world.WorldServer;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.BlockPumpkin;
|
||||
import common.block.foliage.BlockPumpkin;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -26,7 +26,7 @@ public class WorldGenShrub extends WorldGenBaseTree
|
|||
{
|
||||
Block block;
|
||||
|
||||
while (((block = worldIn.getState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
|
||||
while (((block = worldIn.getState(position).getBlock()) == Blocks.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
|
||||
{
|
||||
position = position.down();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockTallGrass;
|
||||
import common.block.foliage.BlockTallGrass;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -23,7 +23,7 @@ public class WorldGenTallGrass extends FeatureGenerator
|
|||
{
|
||||
Block block;
|
||||
|
||||
while (((block = worldIn.getState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
|
||||
while (((block = worldIn.getState(position).getBlock()) == Blocks.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
|
||||
{
|
||||
position = position.down();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server.worldgen.foliage;
|
||||
|
||||
import common.block.BlockVine;
|
||||
import common.block.foliage.BlockVine;
|
||||
import common.init.Blocks;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
|
|
|
@ -4,11 +4,10 @@ import java.util.List;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.BlockDirectional;
|
||||
import common.block.BlockDoor;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.init.Blocks;
|
||||
import common.item.ItemDoor;
|
||||
import common.item.RngLoot;
|
||||
import common.material.Material;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.rng.Random;
|
||||
import common.rng.WeightedList;
|
||||
|
@ -638,7 +637,7 @@ public abstract class StructureComponent
|
|||
{
|
||||
for (int k = zMin; k <= zMax; ++k)
|
||||
{
|
||||
if (!existingOnly || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air)
|
||||
if (!existingOnly || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
if (i != yMin && i != yMax && j != xMin && j != xMax && k != zMin && k != zMax)
|
||||
{
|
||||
|
@ -666,7 +665,7 @@ public abstract class StructureComponent
|
|||
{
|
||||
for (int k = minZ; k <= maxZ; ++k)
|
||||
{
|
||||
if (!alwaysReplace || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air)
|
||||
if (!alwaysReplace || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
blockselector.selectBlocks(rand, j, i, k, i == minY || i == maxY || j == minX || j == maxX || k == minZ || k == maxZ);
|
||||
this.setBlockState(worldIn, blockselector.getBlockState(), j, i, k, boundingboxIn);
|
||||
|
@ -684,7 +683,7 @@ public abstract class StructureComponent
|
|||
{
|
||||
for (int k = minZ; k <= maxZ; ++k)
|
||||
{
|
||||
if (rand.floatv() <= chance && (!p_175805_13_ || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air))
|
||||
if (rand.floatv() <= chance && (!p_175805_13_ || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() != Blocks.air))
|
||||
{
|
||||
if (i != minY && i != maxY && j != minX && j != maxX && k != minZ && k != maxZ)
|
||||
{
|
||||
|
@ -728,7 +727,7 @@ public abstract class StructureComponent
|
|||
{
|
||||
float f7 = ((float)k - f4) / (f2 * 0.5F);
|
||||
|
||||
if (!p_180777_10_ || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air)
|
||||
if (!p_180777_10_ || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
float f8 = f6 * f6 + f5 * f5 + f7 * f7;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import common.entity.item.EntityChestCart;
|
|||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.RngLoot;
|
||||
import common.material.Material;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagList;
|
||||
import common.rng.Random;
|
||||
|
@ -289,7 +288,7 @@ public class StructureMineshaft
|
|||
{
|
||||
BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));
|
||||
|
||||
if (boundingBoxIn.isVecInside(blockpos) && worldIn.getState(blockpos).getBlock().getMaterial() == Material.air)
|
||||
if (boundingBoxIn.isVecInside(blockpos) && worldIn.getState(blockpos).getBlock() == Blocks.air)
|
||||
{
|
||||
int i = rand.chance() ? 1 : 0;
|
||||
worldIn.setState(blockpos, Blocks.rail.getStateFromMeta(this.getMetadataWithOffset(Blocks.rail, i)), 2);
|
||||
|
@ -391,7 +390,7 @@ public class StructureMineshaft
|
|||
int j3 = -1;
|
||||
State iblockstate1 = this.getBlockStateFromPos(worldIn, k2, j3, i3, structureBoundingBoxIn);
|
||||
|
||||
if (iblockstate1.getBlock().getMaterial() == Material.air)
|
||||
if (iblockstate1.getBlock() == Blocks.air)
|
||||
{
|
||||
int k3 = -1;
|
||||
this.setBlockState(worldIn, Blocks.oak_planks.getState(), k2, k3, i3, structureBoundingBoxIn);
|
||||
|
@ -405,7 +404,7 @@ public class StructureMineshaft
|
|||
{
|
||||
State iblockstate = this.getBlockStateFromPos(worldIn, 1, -1, l2, structureBoundingBoxIn);
|
||||
|
||||
if (iblockstate.getBlock().getMaterial() != Material.air && iblockstate.getBlock().isFullBlock())
|
||||
if (iblockstate.getBlock() != Blocks.air && iblockstate.getBlock().isFullBlock())
|
||||
{
|
||||
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l2, Blocks.rail.getStateFromMeta(this.getMetadataWithOffset(Blocks.rail, 0)));
|
||||
}
|
||||
|
@ -569,7 +568,7 @@ public class StructureMineshaft
|
|||
{
|
||||
for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j)
|
||||
{
|
||||
if (this.getBlockStateFromPos(worldIn, i, this.boundingBox.minY - 1, j, structureBoundingBoxIn).getBlock().getMaterial() == Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, i, this.boundingBox.minY - 1, j, structureBoundingBoxIn).getBlock() == Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.oak_planks.getState(), i, this.boundingBox.minY - 1, j, structureBoundingBoxIn);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package server.worldgen.structure;
|
||||
|
||||
import common.block.BlockFlower;
|
||||
import common.block.BlockFlowerPot;
|
||||
import common.block.BlockLever;
|
||||
import common.block.BlockSandStone;
|
||||
import common.block.BlockStoneBrick;
|
||||
import common.block.BlockTripWire;
|
||||
import common.block.BlockTripWireHook;
|
||||
import common.block.artificial.BlockFlowerPot;
|
||||
import common.block.artificial.BlockStoneBrick;
|
||||
import common.block.foliage.BlockFlower;
|
||||
import common.block.natural.BlockSandStone;
|
||||
import common.block.tech.BlockLever;
|
||||
import common.block.tech.BlockTripWire;
|
||||
import common.block.tech.BlockTripWireHook;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.npc.EntityMage;
|
||||
import common.init.Blocks;
|
||||
|
|
|
@ -3,8 +3,8 @@ package server.worldgen.structure;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import common.block.BlockSlab;
|
||||
import common.block.BlockStoneBrick;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.block.artificial.BlockStoneBrick;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.init.Blocks;
|
||||
|
|
|
@ -5,18 +5,17 @@ import java.util.List;
|
|||
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.block.BlockLog;
|
||||
import common.block.BlockSandStone;
|
||||
import common.block.BlockSlab;
|
||||
import common.block.BlockStairs;
|
||||
import common.block.BlockTorch;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.block.artificial.BlockStairs;
|
||||
import common.block.foliage.BlockLog;
|
||||
import common.block.natural.BlockSandStone;
|
||||
import common.block.tech.BlockTorch;
|
||||
import common.collect.Lists;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.npc.EntityHuman;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.Config;
|
||||
import common.material.Material;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
|
@ -358,7 +357,7 @@ public class StructureVillage
|
|||
this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn);
|
||||
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, Facing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1)));
|
||||
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
@ -683,7 +682,7 @@ public class StructureVillage
|
|||
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn);
|
||||
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, Facing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1)));
|
||||
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
@ -811,7 +810,7 @@ public class StructureVillage
|
|||
this.setBlockState(worldIn, Blocks.air.getState(), 1, 2, 0, structureBoundingBoxIn);
|
||||
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 1, 1, 0, Facing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1)));
|
||||
|
||||
if (this.getBlockStateFromPos(worldIn, 1, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 1, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, 1, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 1, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), 1, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
@ -926,7 +925,7 @@ public class StructureVillage
|
|||
|
||||
for (int i = 6; i <= 8; ++i)
|
||||
{
|
||||
if (this.getBlockStateFromPos(worldIn, i, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, i, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, i, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, i, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), i, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
@ -1080,7 +1079,7 @@ public class StructureVillage
|
|||
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, Facing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1)));
|
||||
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, -1, 3, 2, -1, Blocks.air.getState(), Blocks.air.getState(), false);
|
||||
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
@ -1185,7 +1184,7 @@ public class StructureVillage
|
|||
this.setBlockState(worldIn, Blocks.oak_planks.getState(), 3, 2, 0, structureBoundingBoxIn);
|
||||
this.setBlockState(worldIn, Blocks.oak_planks.getState(), 3, 1, 0, structureBoundingBoxIn);
|
||||
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
@ -1868,7 +1867,7 @@ public class StructureVillage
|
|||
this.setBlockState(worldIn, Blocks.air.getState(), 1, 2, 0, structureBoundingBoxIn);
|
||||
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 1, 1, 0, Facing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1)));
|
||||
|
||||
if (this.getBlockStateFromPos(worldIn, 1, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 1, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air)
|
||||
if (this.getBlockStateFromPos(worldIn, 1, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 1, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
|
||||
{
|
||||
this.setBlockState(worldIn, Blocks.cobblestone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.cobblestone_stairs, 3)), 1, 0, -1, structureBoundingBoxIn);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockCocoa;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.BlockVine;
|
||||
import common.block.foliage.BlockCocoa;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.block.foliage.BlockVine;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.properties.PropertyBool;
|
||||
|
@ -116,7 +116,7 @@ public class WorldGenBaseTree extends WorldGenTree
|
|||
BlockPos blockpos = new BlockPos(k1, i3, i2);
|
||||
Block block = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen(blockpos)));
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class WorldGenBaseTree extends WorldGenTree
|
|||
{
|
||||
Block block2 = worldIn.getState(position.up(j3)).getBlock();
|
||||
|
||||
if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine)
|
||||
if (block2 == Blocks.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
|
||||
|
||||
|
@ -179,22 +179,22 @@ public class WorldGenBaseTree extends WorldGenTree
|
|||
BlockPos blockpos4 = blockpos$mutableblockpos1.north();
|
||||
BlockPos blockpos1 = blockpos$mutableblockpos1.south();
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos2).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos2).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181650_b(worldIn, blockpos2, BlockVine.EAST);
|
||||
}
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos3).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos3).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181650_b(worldIn, blockpos3, BlockVine.WEST);
|
||||
}
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos4).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos4).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181650_b(worldIn, blockpos4, BlockVine.SOUTH);
|
||||
}
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos1).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos1).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181650_b(worldIn, blockpos1, BlockVine.NORTH);
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ public class WorldGenBaseTree extends WorldGenTree
|
|||
this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_);
|
||||
int i = 4;
|
||||
|
||||
for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getState(p_181650_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
|
||||
for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getState(p_181650_2_).getBlock() == Blocks.air && i > 0; --i)
|
||||
{
|
||||
this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_);
|
||||
p_181650_2_ = p_181650_2_.down();
|
||||
|
|
|
@ -3,8 +3,8 @@ package server.worldgen.tree;
|
|||
import java.util.List;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.BlockLog;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.block.foliage.BlockLog;
|
||||
import common.collect.Lists;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
|
@ -125,9 +125,9 @@ public class WorldGenBigTree extends WorldGenTree
|
|||
if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_))
|
||||
{
|
||||
BlockPos blockpos = p_181631_1_.add(j, 0, k);
|
||||
Material material = this.world.getState(blockpos).getBlock().getMaterial();
|
||||
Block block = this.world.getState(blockpos).getBlock();
|
||||
|
||||
if (material == Material.air || material == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -101,7 +101,7 @@ public class WorldGenBirch extends WorldGenTree
|
|||
BlockPos blockpos = new BlockPos(i3, i2, k1);
|
||||
Block block = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, blockpos, leavesBlock.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen(blockpos)));
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class WorldGenBirch extends WorldGenTree
|
|||
{
|
||||
Block block2 = worldIn.getState(position.up(j2)).getBlock();
|
||||
|
||||
if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves)
|
||||
if (block2 == Blocks.air || block2.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.up(j2), logBlock);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -66,9 +66,9 @@ public class WorldGenDarkOak extends WorldGenTree
|
|||
|
||||
int k2 = k + j2;
|
||||
BlockPos blockpos1 = new BlockPos(k1, k2, l1);
|
||||
Material material = worldIn.getState(blockpos1).getBlock().getMaterial();
|
||||
Block block1 = worldIn.getState(blockpos1).getBlock();
|
||||
|
||||
if (material == Material.air || material == Material.leaves)
|
||||
if (block1 == Blocks.air || block1.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.func_181639_b(worldIn, blockpos1);
|
||||
this.func_181639_b(worldIn, blockpos1.east());
|
||||
|
@ -210,7 +210,7 @@ public class WorldGenDarkOak extends WorldGenTree
|
|||
BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_);
|
||||
Block block = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air)
|
||||
if (block == Blocks.air)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, blockpos, leavesBlock.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen(blockpos)));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -119,9 +119,9 @@ public abstract class WorldGenHugeTree extends WorldGenTree
|
|||
if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i)
|
||||
{
|
||||
BlockPos blockpos = p_175925_2_.add(j, 0, k);
|
||||
Material material = worldIn.getState(blockpos).getBlock().getMaterial();
|
||||
Block block = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (material == Material.air || material == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen(blockpos)));
|
||||
}
|
||||
|
@ -141,9 +141,9 @@ public abstract class WorldGenHugeTree extends WorldGenTree
|
|||
if (j * j + k * k <= i)
|
||||
{
|
||||
BlockPos blockpos = p_175928_2_.add(j, 0, k);
|
||||
Material material = worldIn.getState(blockpos).getBlock().getMaterial();
|
||||
Block block = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (material == Material.air || material == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen(blockpos)));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.BlockVine;
|
||||
import common.block.foliage.BlockVine;
|
||||
import common.init.Blocks;
|
||||
import common.properties.PropertyBool;
|
||||
import common.rng.Random;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockDirt;
|
||||
import common.block.natural.BlockDirt;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -39,7 +39,7 @@ public class WorldGenPine extends WorldGenHugeTree
|
|||
{
|
||||
Block block = worldIn.getState(position.up(j)).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.up(j), this.woodMetadata);
|
||||
}
|
||||
|
@ -48,21 +48,21 @@ public class WorldGenPine extends WorldGenHugeTree
|
|||
{
|
||||
block = worldIn.getState(position.add(1, j, 0)).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 0), this.woodMetadata);
|
||||
}
|
||||
|
||||
block = worldIn.getState(position.add(1, j, 1)).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 1), this.woodMetadata);
|
||||
}
|
||||
|
||||
block = worldIn.getState(position.add(0, j, 1)).getBlock();
|
||||
|
||||
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.add(0, j, 1), this.woodMetadata);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class WorldGenPine extends WorldGenHugeTree
|
|||
break;
|
||||
}
|
||||
|
||||
if (block.getMaterial() != Material.air && i < 0)
|
||||
if (block != Blocks.air && i < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -95,9 +95,9 @@ public class WorldGenSavanna extends WorldGenTree
|
|||
}
|
||||
|
||||
BlockPos blockpos = new BlockPos(i3, i2, j1);
|
||||
Material material = worldIn.getState(blockpos).getBlock().getMaterial();
|
||||
Block block1 = worldIn.getState(blockpos).getBlock();
|
||||
|
||||
if (material == Material.air || material == Material.leaves)
|
||||
if (block1 == Blocks.air || block1.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.func_181642_b(worldIn, blockpos);
|
||||
k1 = i2;
|
||||
|
@ -149,9 +149,9 @@ public class WorldGenSavanna extends WorldGenTree
|
|||
i3 += enumfacing1.getFrontOffsetX();
|
||||
j1 += enumfacing1.getFrontOffsetZ();
|
||||
BlockPos blockpos1 = new BlockPos(i3, j2, j1);
|
||||
Material material1 = worldIn.getState(blockpos1).getBlock().getMaterial();
|
||||
Block block1 = worldIn.getState(blockpos1).getBlock();
|
||||
|
||||
if (material1 == Material.air || material1 == Material.leaves)
|
||||
if (block1 == Blocks.air || block1.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.func_181642_b(worldIn, blockpos1);
|
||||
k1 = j2;
|
||||
|
@ -209,9 +209,9 @@ public class WorldGenSavanna extends WorldGenTree
|
|||
|
||||
private void func_175924_b(WorldServer worldIn, BlockPos p_175924_2_)
|
||||
{
|
||||
Material material = worldIn.getState(p_175924_2_).getBlock().getMaterial();
|
||||
Block block = worldIn.getState(p_175924_2_).getBlock();
|
||||
|
||||
if (material == Material.air || material == Material.leaves)
|
||||
if (block == Blocks.air || block.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, p_175924_2_, field_181644_b.withProperty(BlockLeaves.TYPE, worldIn.getLeavesGen(p_175924_2_)));
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.BlockVine;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.block.foliage.BlockVine;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.properties.PropertyBool;
|
||||
|
@ -61,7 +61,7 @@ public class WorldGenSwamp extends WorldGenTree
|
|||
{
|
||||
Block block = worldIn.getState(blockpos$mutableblockpos.set(l, j, i1)).getBlock();
|
||||
|
||||
if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
|
||||
if (block != Blocks.air && block.getMaterial() != Material.leaves)
|
||||
{
|
||||
if (block != Blocks.water && block != Blocks.flowing_water)
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ public class WorldGenSwamp extends WorldGenTree
|
|||
{
|
||||
Block block2 = worldIn.getState(position.up(i2)).getBlock();
|
||||
|
||||
if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water)
|
||||
if (block2 == Blocks.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.up(i2), field_181648_a);
|
||||
}
|
||||
|
@ -148,22 +148,22 @@ public class WorldGenSwamp extends WorldGenTree
|
|||
BlockPos blockpos1 = blockpos$mutableblockpos1.north();
|
||||
BlockPos blockpos2 = blockpos$mutableblockpos1.south();
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos3).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos3).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181647_a(worldIn, blockpos3, BlockVine.EAST);
|
||||
}
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos4).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos4).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181647_a(worldIn, blockpos4, BlockVine.WEST);
|
||||
}
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos1).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos1).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181647_a(worldIn, blockpos1, BlockVine.SOUTH);
|
||||
}
|
||||
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos2).getBlock().getMaterial() == Material.air)
|
||||
if (rand.zrange(4) == 0 && worldIn.getState(blockpos2).getBlock() == Blocks.air)
|
||||
{
|
||||
this.func_181647_a(worldIn, blockpos2, BlockVine.NORTH);
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class WorldGenSwamp extends WorldGenTree
|
|||
this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
|
||||
int i = 4;
|
||||
|
||||
for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
|
||||
for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getState(p_181647_2_).getBlock() == Blocks.air && i > 0; --i)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
|
||||
p_181647_2_ = p_181647_2_.down();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -115,7 +115,7 @@ public class WorldGenTaiga1 extends WorldGenTree
|
|||
{
|
||||
Block block1 = worldIn.getState(position.up(i3)).getBlock();
|
||||
|
||||
if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves)
|
||||
if (block1 == Blocks.air || block1.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.up(i3), field_181636_a);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLeaves;
|
||||
import common.block.foliage.BlockLeaves;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -55,7 +55,7 @@ public class WorldGenTaiga2 extends WorldGenTree
|
|||
{
|
||||
Block block = worldIn.getState(blockpos$mutableblockpos.set(k1, i1, l1)).getBlock();
|
||||
|
||||
if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves)
|
||||
if (block != Blocks.air && block.getMaterial() != Material.leaves)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class WorldGenTaiga2 extends WorldGenTree
|
|||
{
|
||||
Block block2 = worldIn.getState(position.up(k4)).getBlock();
|
||||
|
||||
if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves)
|
||||
if (block2 == Blocks.air || block2.getMaterial() == Material.leaves)
|
||||
{
|
||||
this.setBlockAndNotifyAdequately(worldIn, position.up(k4), field_181645_a);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server.worldgen.tree;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.BlockLog;
|
||||
import common.block.BlockSapling;
|
||||
import common.block.foliage.BlockLog;
|
||||
import common.block.foliage.BlockSapling;
|
||||
import common.init.Blocks;
|
||||
import common.material.Material;
|
||||
import common.rng.Random;
|
||||
|
@ -19,8 +19,7 @@ public abstract class WorldGenTree extends FeatureGenerator
|
|||
|
||||
protected boolean canBeReplaced(Block block)
|
||||
{
|
||||
Material material = block.getMaterial();
|
||||
return material == Material.air || material == Material.leaves || block == Blocks.grass || block == Blocks.dirt || block instanceof BlockLog || block instanceof BlockSapling || block == Blocks.vine;
|
||||
return block == Blocks.air || block.getMaterial() == Material.leaves || block == Blocks.grass || block == Blocks.dirt || block instanceof BlockLog || block instanceof BlockSapling || block == Blocks.vine;
|
||||
}
|
||||
|
||||
public void prepare()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue