remove block metadata TEMP
This commit is contained in:
parent
1e104d5db8
commit
30a78ad279
83 changed files with 1088 additions and 1177 deletions
|
@ -1926,7 +1926,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
|
||||
StringBuilder str = new StringBuilder(
|
||||
"Schaue auf: " + BlockRegistry.getNameFromBlock(block.getBlock()) + "\n" +
|
||||
"Schaue auf: " + BlockRegistry.getName(block.getBlock()) + "\n" +
|
||||
String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ())
|
||||
);
|
||||
for(Entry<Property, Comparable> entry : block.getProperties().entrySet()) {
|
||||
|
@ -1954,7 +1954,7 @@ public class Client implements IThreadListener {
|
|||
(((EntityLiving)entity).deathTime != 0 ? "Tod: " + ((EntityLiving)entity).deathTime + "t, " : "") + "Rüstung: " + ((EntityLiving)entity).getTotalArmorValue() + ", Pfeile: " + ((EntityLiving)entity).getArrowCountInEntity()
|
||||
: "Rüstung: n/a, Pfeile: n/a") + "\n" +
|
||||
(held != null ?
|
||||
"Gegens.: " + ItemRegistry.getNameFromItem(held.getItem()) + " x" + held.size : "Gegens.: n/a") + "\n" +
|
||||
"Gegens.: " + ItemRegistry.getName(held.getItem()) + " x" + held.size : "Gegens.: n/a") + "\n" +
|
||||
"Eigens.: " + (entity.dead ? "D" : "") + (entity.noClip ? "N" : "") + (entity.onGround ? "G" : "")
|
||||
+ (entity.canBeCollidedWith() ? "C" : "") + (entity.canBePushed() ? "P" : "")
|
||||
+ (entity.isBurning() ? "B" : "") + (entity.isPlayer() ? "S" : "")
|
||||
|
|
|
@ -517,7 +517,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
}
|
||||
else
|
||||
{
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = new ItemStack(ItemRegistry.getItemById(i));
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = new ItemStack(ItemRegistry.byId(i));
|
||||
}
|
||||
|
||||
player.setPositionAndRotation(x, y, z, yaw, pitch);
|
||||
|
@ -1165,7 +1165,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
}
|
||||
else
|
||||
{
|
||||
Block block = BlockRegistry.getRegisteredBlock(id);
|
||||
Block block = BlockRegistry.byName(id);
|
||||
if(block instanceof BlockWorkbench bench) {
|
||||
this.gm.displayGuiScreen(new GuiCrafting(player.inventory, player.worldObj, bench));
|
||||
}
|
||||
|
@ -1377,7 +1377,8 @@ public class ClientPlayer implements IClientPlayer
|
|||
public void handleBlockAction(SPacketBlockAction packetIn)
|
||||
{
|
||||
NetHandler.checkThread(packetIn, this, this.gm, this.world);
|
||||
this.gm.world.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
|
||||
if(packetIn.getBlockType() != null)
|
||||
this.gm.world.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -409,7 +409,7 @@ public class BlockRenderer
|
|||
{
|
||||
TextureMap texturemap = Client.CLIENT.getTextureMapBlocks();
|
||||
for(Pair<BlockStaticLiquid, BlockDynamicLiquid> liquid : BlockLiquid.LIQUIDS) {
|
||||
String name = BlockRegistry.getNameFromBlock(liquid.first());
|
||||
String name = BlockRegistry.getName(liquid.first());
|
||||
TextureAtlasSprite[] sprites = new TextureAtlasSprite[] {texturemap.getAtlasSprite("blocks/" + name + "_still"), texturemap.getAtlasSprite("blocks/" + name + "_flow")};
|
||||
this.fluids.put(liquid.second(), sprites);
|
||||
this.fluids.put(liquid.first(), sprites);
|
||||
|
|
|
@ -24,7 +24,7 @@ public class ItemModelMesher {
|
|||
|
||||
public IBakedModel getItemModel(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
IBakedModel model = this.models.get(ItemRegistry.getIdFromItem(item));
|
||||
IBakedModel model = this.models.get(ItemRegistry.getId(item));
|
||||
if(model == null)
|
||||
model = this.manager.getMissingModel();
|
||||
return model;
|
||||
|
@ -36,8 +36,8 @@ public class ItemModelMesher {
|
|||
|
||||
public void rebuildCache() {
|
||||
this.models.clear();
|
||||
for(Item item : ItemRegistry.REGISTRY) {
|
||||
this.models.put(ItemRegistry.getIdFromItem(item), this.manager.getModel("item/" + ItemRegistry.getNameFromItem(item).toString()));
|
||||
for(Item item : ItemRegistry.items()) {
|
||||
this.models.put(ItemRegistry.getId(item), this.manager.getModel("item/" + ItemRegistry.getName(item).toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public abstract class ModelBakery
|
|||
|
||||
static {
|
||||
for(Pair<BlockStaticLiquid, BlockDynamicLiquid> liquid : BlockLiquid.LIQUIDS) {
|
||||
String name = BlockRegistry.getNameFromBlock(liquid.first());
|
||||
String name = BlockRegistry.getName(liquid.first());
|
||||
BUILTINS.add("blocks/" + name + "_flow");
|
||||
BUILTINS.add("blocks/" + name + "_still");
|
||||
}
|
||||
|
@ -57,15 +57,15 @@ public abstract class ModelBakery
|
|||
models.put(MISSING, (ModelBlock)new ModelBlock(null).add().all());
|
||||
variants.add(MISSING);
|
||||
for(Entry<State, String> entry : map.entrySet()) {
|
||||
ModelBlock model = (ModelBlock)entry.getKey().getBlock().getModel(ModelBlock.PROVIDER, BlockRegistry.getNameFromBlock(entry.getKey().getBlock())
|
||||
ModelBlock model = (ModelBlock)entry.getKey().getBlock().getModel(ModelBlock.PROVIDER, BlockRegistry.getName(entry.getKey().getBlock())
|
||||
.toString(), entry.getKey());
|
||||
models.put(entry.getValue(), model);
|
||||
variants.add(entry.getValue());
|
||||
}
|
||||
for (Item item : ItemRegistry.REGISTRY)
|
||||
for (Item item : ItemRegistry.items())
|
||||
{
|
||||
String loc = "item/" + ItemRegistry.getNameFromItem(item);
|
||||
models.put(loc, (ModelBlock)item.getModel(ModelBlock.PROVIDER, ItemRegistry.getNameFromItem(item)));
|
||||
String loc = "item/" + ItemRegistry.getName(item);
|
||||
models.put(loc, (ModelBlock)item.getModel(ModelBlock.PROVIDER, ItemRegistry.getName(item)));
|
||||
itemLocations.add(loc);
|
||||
String[] extra = item.getSprites();
|
||||
if(extra != null) {
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ModelManager
|
|||
public ModelManager(TextureMap textures)
|
||||
{
|
||||
this.texMap = textures;
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
if(block.getRenderType() != 3) {
|
||||
this.builtin.add(block);
|
||||
// Log.info("Builtin: " + BlockRegistry.getNameFromBlock(block));
|
||||
|
@ -113,7 +113,7 @@ public class ModelManager
|
|||
|
||||
public Map<State, String> getMap() {
|
||||
Map<State, String> map = Maps.<State, String>newIdentityHashMap();
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
if(!this.builtin.contains(block)) {
|
||||
StateMap mapper = this.mappers.get(block);
|
||||
if(mapper == null)
|
||||
|
|
|
@ -30,7 +30,7 @@ public class MultiStateMap extends StateMap
|
|||
|
||||
if (this.name == null)
|
||||
{
|
||||
s = BlockRegistry.getNameFromBlock(state.getBlock());
|
||||
s = BlockRegistry.getName(state.getBlock());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -8,6 +8,6 @@ public class SingleStateMap extends StateMap
|
|||
{
|
||||
protected String getResourceLocation(State state)
|
||||
{
|
||||
return BlockRegistry.getNameFromBlock(state.getBlock()).toString() + '#' + this.getPropertyString(state.getProperties());
|
||||
return BlockRegistry.getName(state.getBlock()).toString() + '#' + this.getPropertyString(state.getProperties());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@ public class RenderDynamite extends RenderItemEntity<EntityDynamite> {
|
|||
|
||||
public ItemStack getStack(EntityDynamite entityIn)
|
||||
{
|
||||
return new ItemStack(ItemRegistry.getRegisteredItem("dynamite" + (entityIn.explosionSize <= 0 || entityIn.explosionSize >= 8 ? "" : "_" + entityIn.explosionSize)));
|
||||
return new ItemStack(ItemRegistry.byName("dynamite" + (entityIn.explosionSize <= 0 || entityIn.explosionSize >= 8 ? "" : "_" + entityIn.explosionSize)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RenderTntPrimed extends Render<EntityTnt>
|
|||
float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F;
|
||||
this.bindEntityTexture(entity);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, 0.5F);
|
||||
Block tnt = BlockRegistry.getRegisteredBlock("tnt" + (entity.explosionSize <= 0 || entity.explosionSize >= 8 ? "" : "_" + entity.explosionSize));
|
||||
Block tnt = BlockRegistry.byName("tnt" + (entity.explosionSize <= 0 || entity.explosionSize >= 8 ? "" : "_" + entity.explosionSize));
|
||||
blockrendererdispatcher.renderBlockBrightness(tnt.getState(), entity.getBrightness(partialTicks));
|
||||
GL11.glTranslatef(0.0F, 0.0F, 1.0F);
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ public class EntityBlockDustFX extends EntityDiggingFX
|
|||
{
|
||||
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
||||
{
|
||||
State iblockstate = BlockRegistry.getStateById(p_178902_15_[0]);
|
||||
return iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).calculateColor();
|
||||
State iblockstate = BlockRegistry.byId(p_178902_15_[0]);
|
||||
return iblockstate == null || iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).calculateColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class EntityBreakingFX extends EntityFX
|
|||
{
|
||||
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
||||
{
|
||||
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.getItemById(p_178902_15_[0]));
|
||||
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.byId(p_178902_15_[0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,8 @@ public class EntityDiggingFX extends EntityFX
|
|||
{
|
||||
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
||||
{
|
||||
return (new EntityDiggingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, BlockRegistry.getStateById(p_178902_15_[0]))).calculateColor();
|
||||
State state = BlockRegistry.byId(p_178902_15_[0]);
|
||||
return state == null ? null : (new EntityDiggingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, state)).calculateColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class TextureMap extends Texture
|
|||
Map<String, Object> map = Maps.newHashMap();
|
||||
Map<TextureAnimation, Class<? extends TextureTicked>> anim = Maps.newHashMap();
|
||||
RenderRegistry.registerAnimations(anim);
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
block.getAnimatedTextures(map);
|
||||
}
|
||||
for(Entry<String, Object> entry : map.entrySet()) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import client.Client;
|
|||
import client.renderer.GlState;
|
||||
import client.renderer.model.ModelBanner;
|
||||
import client.renderer.texture.LayeredColorMaskTexture;
|
||||
import common.block.tile.BlockBannerStanding;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.DyeColor;
|
||||
|
@ -17,6 +18,7 @@ import common.init.Blocks;
|
|||
import common.tileentity.TileEntityBanner;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.world.State;
|
||||
|
||||
public class TileEntityBannerRenderer extends TileEntitySpecialRenderer<TileEntityBanner>
|
||||
{
|
||||
|
@ -28,7 +30,12 @@ public class TileEntityBannerRenderer extends TileEntitySpecialRenderer<TileEnti
|
|||
{
|
||||
boolean flag = te.getWorld() != null;
|
||||
boolean flag1 = !flag || te.getBlockType() == Blocks.banner;
|
||||
int i = flag ? te.getBlockMetadata() : 0;
|
||||
int i = 0;
|
||||
if(flag) {
|
||||
State state = te.getBlockState();
|
||||
if(state.getBlock() == Blocks.banner)
|
||||
i = state.getValue(BlockBannerStanding.ROTATION);
|
||||
}
|
||||
// long j = flag ? te.getWorld().getTime() : 0L;
|
||||
double j = flag ? (double)(System.nanoTime() / 1000L) / 50000.0 /* te.getWorld().getTime() */ : (double)partialTicks;
|
||||
GL11.glPushMatrix();
|
||||
|
|
|
@ -5,9 +5,9 @@ import org.lwjgl.opengl.GL11;
|
|||
import client.renderer.GlState;
|
||||
import client.renderer.model.ModelChest;
|
||||
import client.renderer.model.ModelLargeChest;
|
||||
import common.block.Block;
|
||||
import common.block.tech.BlockChest;
|
||||
import common.tileentity.TileEntityChest;
|
||||
import common.world.State;
|
||||
|
||||
|
||||
public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntityChest>
|
||||
|
@ -44,21 +44,19 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntit
|
|||
GlState.enableDepth();
|
||||
GlState.depthFunc(GL11.GL_LEQUAL);
|
||||
GlState.depthMask(true);
|
||||
int i;
|
||||
int i = 0;
|
||||
|
||||
if (!te.hasWorldObj())
|
||||
if (te.hasWorldObj())
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Block block = te.getBlockType();
|
||||
i = te.getBlockMetadata();
|
||||
|
||||
if (block instanceof BlockChest && i == 0)
|
||||
{
|
||||
((BlockChest)block).checkForSurroundingChests(te.getWorld(), te.getPos(), te.getWorld().getState(te.getPos()));
|
||||
i = te.getBlockMetadata();
|
||||
State state = te.getBlockState();
|
||||
if(state.getBlock() instanceof BlockChest) {
|
||||
i = state.getValue(BlockChest.FACING).getIndex();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
((BlockChest)state.getBlock()).checkForSurroundingChests(te.getWorld(), te.getPos(), te.getWorld().getState(te.getPos()));
|
||||
i = state.getValue(BlockChest.FACING).getIndex();
|
||||
}
|
||||
}
|
||||
|
||||
te.checkForAdjacentChests();
|
||||
|
|
|
@ -6,8 +6,11 @@ import client.renderer.Drawing;
|
|||
import client.renderer.GlState;
|
||||
import client.renderer.model.ModelSign;
|
||||
import common.block.Block;
|
||||
import common.block.tile.BlockStandingSign;
|
||||
import common.block.tile.BlockWallSign;
|
||||
import common.init.Blocks;
|
||||
import common.tileentity.TileEntitySign;
|
||||
import common.world.State;
|
||||
|
||||
|
||||
public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntitySign>
|
||||
|
@ -23,16 +26,17 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
|
|||
GL11.glPushMatrix();
|
||||
float f = 0.6666667F;
|
||||
|
||||
State state = te.getBlockState();
|
||||
if (block == Blocks.sign)
|
||||
{
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
|
||||
float f1 = (float)(te.getBlockMetadata() * 360) / 16.0F;
|
||||
float f1 = state.getBlock() == Blocks.sign ? (float)(state.getValue(BlockStandingSign.ROTATION) * 360) / 16.0F : 0.0F;
|
||||
GL11.glRotatef(-f1, 0.0F, 1.0F, 0.0F);
|
||||
this.model.signStick.showModel = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
int k = te.getBlockMetadata();
|
||||
int k = state.getBlock() == Blocks.wall_sign ? state.getValue(BlockWallSign.FACING).getIndex() : 0;
|
||||
float f2 = 0.0F;
|
||||
|
||||
if (k == 2)
|
||||
|
|
|
@ -50,7 +50,7 @@ public class PlayerController {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
world.playAuxSFX(2001, pos, BlockRegistry.getStateId(state));
|
||||
world.playAuxSFX(2001, pos, BlockRegistry.getId(state));
|
||||
boolean flag = world.setBlockToAir(pos);
|
||||
|
||||
if(flag) {
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ChunkEmpty extends ChunkClient {
|
|||
private final Block dummyBlock;
|
||||
|
||||
static {
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
STATES.addAll(block.getValidStates());
|
||||
}
|
||||
XSTRETCH = ExtMath.ceilf(ExtMath.sqrtf((float)STATES.size()));
|
||||
|
|
|
@ -7,7 +7,6 @@ import client.Client;
|
|||
import client.renderer.particle.EntityFX;
|
||||
import client.renderer.particle.EntityFirework;
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Sets;
|
||||
import common.dimension.Dimension;
|
||||
|
@ -637,14 +636,14 @@ public class WorldClient extends AWorldClient
|
|||
return;
|
||||
|
||||
case 2001:
|
||||
Block block = BlockRegistry.getBlockById(data & 4095);
|
||||
State state = BlockRegistry.byId(data);
|
||||
|
||||
if (block != Blocks.air)
|
||||
if (state != null && state.getBlock() != Blocks.air)
|
||||
{
|
||||
this.gm.getSoundManager().playSound(new PositionedSound(block.sound.getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F));
|
||||
this.gm.getSoundManager().playSound(new PositionedSound(state.getBlock().sound.getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F));
|
||||
}
|
||||
|
||||
this.gm.effectRenderer.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255));
|
||||
if(state != null)
|
||||
this.gm.effectRenderer.addBlockDestroyEffects(blockPosIn, state);
|
||||
break;
|
||||
|
||||
case 2002:
|
||||
|
@ -654,7 +653,7 @@ public class WorldClient extends AWorldClient
|
|||
|
||||
for (int i1 = 0; i1 < 8; ++i1)
|
||||
{
|
||||
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getIdFromItem(Items.potion)});
|
||||
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getId(Items.potion)});
|
||||
}
|
||||
|
||||
ParticleType enumparticletypes = ParticleType.WATER_SPLASH;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue