server client split world classes

This commit is contained in:
Sen 2025-05-13 17:02:57 +02:00
parent 66e9f68eee
commit 6e77090c5b
247 changed files with 1309 additions and 1187 deletions

View file

@ -66,7 +66,6 @@ import client.renderer.chunk.RenderChunk;
import client.renderer.entity.RenderItem; import client.renderer.entity.RenderItem;
import client.renderer.entity.RenderManager; import client.renderer.entity.RenderManager;
import client.renderer.particle.EffectRenderer; import client.renderer.particle.EffectRenderer;
import client.renderer.particle.EntityFirework;
import client.renderer.texture.ColormapLoader; import client.renderer.texture.ColormapLoader;
import client.renderer.texture.EntityTexManager; import client.renderer.texture.EntityTexManager;
import client.renderer.texture.TextureManager; import client.renderer.texture.TextureManager;
@ -95,7 +94,7 @@ import client.window.Keysym;
import client.window.Wheel; import client.window.Wheel;
import client.window.Window; import client.window.Window;
import client.window.WindowEvent; import client.window.WindowEvent;
import common.IClient; import client.world.WorldClient;
import common.biome.Biome; import common.biome.Biome;
import common.block.Block; import common.block.Block;
import common.collect.Lists; import common.collect.Lists;
@ -106,7 +105,6 @@ import common.entity.animal.EntityHorse;
import common.entity.npc.Energy; import common.entity.npc.Energy;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.entity.types.IEntityFX;
import common.future.Futures; import common.future.Futures;
import common.future.ListenableFuture; import common.future.ListenableFuture;
import common.future.ListenableFutureTask; import common.future.ListenableFutureTask;
@ -127,8 +125,6 @@ import common.log.Log;
import common.log.LogLevel; import common.log.LogLevel;
import common.log.Message; import common.log.Message;
import common.material.Material; import common.material.Material;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.network.IThreadListener; import common.network.IThreadListener;
import common.network.NetConnection; import common.network.NetConnection;
import common.network.PacketDecoder; import common.network.PacketDecoder;
@ -149,7 +145,6 @@ import common.properties.IProperty;
import common.rng.Random; import common.rng.Random;
import common.sound.EventType; import common.sound.EventType;
import common.sound.PositionedSound; import common.sound.PositionedSound;
import common.sound.Sound;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.CharValidator; import common.util.CharValidator;
@ -164,7 +159,6 @@ import common.world.Chunk;
import common.world.LightType; import common.world.LightType;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient;
import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;
@ -196,7 +190,7 @@ import io.netty.handler.timeout.ReadTimeoutHandler;
[[oder einfach einen Toaster mit nem LCD und Maus]] [[oder einfach einen Toaster mit nem LCD und Maus]]
*/ */
public class Client implements IThreadListener, IClient { public class Client implements IThreadListener {
public static class SyncFunction implements IntFunction { public static class SyncFunction implements IntFunction {
public void apply(IntVar cv, int value) { public void apply(IntVar cv, int value) {
Client.CLIENT.sync(value); Client.CLIENT.sync(value);
@ -1271,7 +1265,7 @@ public class Client implements IThreadListener, IClient {
if ((this.pointed.type != ObjectType.BLOCK || this.world.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.player, this.world, ItemControl.PRIMARY, null)) if ((this.pointed.type != ObjectType.BLOCK || this.world.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.player, this.world, ItemControl.PRIMARY, null))
{ {
this.player.swingItem(); this.player.swingItem();
this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.PRIMARY.ordinal())); this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.PRIMARY.ordinal()));
this.leftClickCounter = 10; this.leftClickCounter = 10;
return; return;
} }
@ -1323,7 +1317,7 @@ public class Client implements IThreadListener, IClient {
if ((this.pointed.type != ObjectType.BLOCK || this.world.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.player, this.world, ItemControl.SECONDARY, null)) if ((this.pointed.type != ObjectType.BLOCK || this.world.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.player, this.world, ItemControl.SECONDARY, null))
{ {
this.player.swingItem(); this.player.swingItem();
this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.SECONDARY.ordinal())); this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.SECONDARY.ordinal()));
return; return;
} }
@ -1389,7 +1383,7 @@ public class Client implements IThreadListener, IClient {
if (this.pointed != null) if (this.pointed != null)
{ {
if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem().onAction(this.player.getHeldItem(), this.player, this.world, ItemControl.TERTIARY, null)) { if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem().onAction(this.player.getHeldItem(), this.player, this.world, ItemControl.TERTIARY, null)) {
this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.TERTIARY.ordinal())); this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.TERTIARY.ordinal()));
return; return;
} }
@ -1436,7 +1430,7 @@ public class Client implements IThreadListener, IClient {
inventoryplayer.setCurrentItem(item, meta, flag1); inventoryplayer.setCurrentItem(item, meta, flag1);
if(this.itemCheat) { if(this.itemCheat) {
this.player.sendQueue.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl())); this.player.client.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl()));
} }
} }
} }
@ -1446,7 +1440,7 @@ public class Client implements IThreadListener, IClient {
if (this.pointed != null) if (this.pointed != null)
{ {
if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem().onAction(this.player.getHeldItem(), this.player, this.world, ItemControl.QUARTERNARY, null)) { if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem().onAction(this.player.getHeldItem(), this.player, this.world, ItemControl.QUARTERNARY, null)) {
this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.QUARTERNARY.ordinal())); this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.QUARTERNARY.ordinal()));
return; return;
} }
} }
@ -1522,7 +1516,7 @@ public class Client implements IThreadListener, IClient {
public ClientPlayer getNetHandler() public ClientPlayer getNetHandler()
{ {
return this.player != null ? (ClientPlayer)this.player.sendQueue : null; return this.player != null ? (ClientPlayer)this.player.client : null;
} }
// public void setSkin(BufferedImage skin, String id, ModelType model, boolean slim) // public void setSkin(BufferedImage skin, String id, ModelType model, boolean slim)
@ -1569,7 +1563,7 @@ public class Client implements IThreadListener, IClient {
public void performAction(Action action) { public void performAction(Action action) {
if(this.player != null) if(this.player != null)
this.player.sendQueue.addToSendQueue(new CPacketAction(action)); this.player.client.addToSendQueue(new CPacketAction(action));
} }
public void setBossStatus(EntityLiving entity) { public void setBossStatus(EntityLiving entity) {
@ -1805,7 +1799,7 @@ public class Client implements IThreadListener, IClient {
ticked / 1000L, (ticked / 100L) % 10L ticked / 1000L, (ticked / 100L) % 10L
) + ) +
(this.serverInfo != null ? "\n" + this.serverInfo : "") (this.serverInfo != null ? "\n" + this.serverInfo : "")
// WorldServer world = this.server.getWorld(this.theWorld.dimension.getDimensionId()); // IWorldServer world = this.server.getWorld(this.theWorld.dimension.getDimensionId());
// if(world != null) // if(world != null)
// list.add("Seed: " + world.getSeed()); // list.add("Seed: " + world.getSeed());
; ;
@ -3342,82 +3336,4 @@ public class Client implements IThreadListener, IClient {
} }
}, "File Browser listener").start(); }, "File Browser listener").start();
} }
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
{
this.effectRenderer.addEffect(new EntityFirework.StarterFX(this.world, x, y, z, motionX, motionY, motionZ, this.effectRenderer, compund));
}
public int getRenderDistance() {
return this.renderDistance;
}
public float getGravity() {
return this.gravity;
}
public int getTimeFactor() {
return this.timeFactor;
}
public boolean hasDayCycle() {
return this.dayCycle;
}
public void playSound(Sound sound) {
this.soundManager.playSound(sound);
}
public EntityNPC getPlayer() {
return this.player;
}
public IEntityFX spawnEffectParticle(int particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed,
int[] parameters) {
return this.effectRenderer.spawnEffectParticle(particleId, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters);
}
public void addBlockDestroyEffects(BlockPos pos, State state) {
this.effectRenderer.addBlockDestroyEffects(pos, state);
}
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) {
this.renderGlobal.sendBlockBreakProgress(breakerId, pos, progress);
}
public void markBlocksForUpdate(int x1, int y1, int z1, int x2, int y2, int z2) {
this.renderGlobal.markBlocksForUpdate(x1, y1, z1, x2, y2, z2);
}
public void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes) {
this.effectRenderer.emitParticleAtEntity(entityIn, particleTypes);
}
public boolean isJumping() {
return this.jump;
}
public boolean isSprinting() {
return this.sprint;
}
public boolean isSneaking() {
return this.sneak;
}
public float getMoveForward() {
return this.moveForward;
}
public float getMoveStrafe() {
return this.moveStrafe;
}
public void setMoveForward(float value) {
this.moveForward = value;
}
public void setMoveStrafe(float value) {
this.moveStrafe = value;
}
} }

View file

@ -1,6 +1,7 @@
package client; package client;
import client.network.ClientPlayer; import client.network.ClientPlayer;
import client.world.WorldClient;
import common.block.Block; import common.block.Block;
import common.entity.Entity; import common.entity.Entity;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
@ -20,7 +21,6 @@ import common.util.Facing;
import common.util.Vec3; import common.util.Vec3;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class PlayerController public class PlayerController
{ {
@ -471,7 +471,7 @@ public class PlayerController
public EntityNPC createPlayerEntity(WorldClient worldIn, int type) public EntityNPC createPlayerEntity(WorldClient worldIn, int type)
{ {
EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(type, worldIn); EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(type, worldIn);
player.setClientPlayer(this.gm, this.netClientHandler); player.setClientPlayer(this.netClientHandler);
return player; return player;
} }

View file

@ -215,7 +215,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
s = argv[argv.length - 1]; s = argv[argv.length - 1];
Iterable<String> res = pre.startsWith("#") ? Iterable<String> res = pre.startsWith("#") ?
(argv.length == 1 ? this.gm.getVars() : (argv.length == 2 ? getVarCompletion(argv[0].substring(1)) : Lists.newArrayList())) : (argv.length == 1 ? this.gm.getVars() : (argv.length == 2 ? getVarCompletion(argv[0].substring(1)) : Lists.newArrayList())) :
(this.gm.player == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.player.sendQueue).getPlayerNames()); (this.gm.player == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.player.client).getPlayerNames());
if(argv.length == 1 && pre.startsWith("#")) if(argv.length == 1 && pre.startsWith("#"))
s = s.substring(1); s = s.substring(1);
for(String s1 : res) { for(String s1 : res) {
@ -255,7 +255,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
if(this.gm.player != null) { if(this.gm.player != null) {
currentText = currentText.substring(1); currentText = currentText.substring(1);
this.prefixFirst = currentText.split(" ", -1).length == 1 ? "/" : null; this.prefixFirst = currentText.split(" ", -1).length == 1 ? "/" : null;
this.gm.player.sendQueue.addToSendQueue(new CPacketComplete(currentText, eid, blockpos)); this.gm.player.client.addToSendQueue(new CPacketComplete(currentText, eid, blockpos));
this.waitingOnAutocomplete = true; this.waitingOnAutocomplete = true;
} }
} }

View file

@ -350,7 +350,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
public void use(ActButton elem, Mode action) { public void use(ActButton elem, Mode action) {
if(GuiChar.this.gm.player != null) { if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false; GuiChar.this.waiting = false;
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal())); GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal()));
for(ActButton btn : alignBtns) { for(ActButton btn : alignBtns) {
btn.enabled = btn != elem; btn.enabled = btn != elem;
} }
@ -363,7 +363,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
public void use(Slider elem, int value) { public void use(Slider elem, int value) {
if(GuiChar.this.gm.player != null) { if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false; GuiChar.this.waiting = false;
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value)); GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value));
} }
} }
}, "Spieler-Größe", "cm")).enabled = this.gm.player == null || this.gm.player.getMinSize() != this.gm.player.getMaxSize(); }, "Spieler-Größe", "cm")).enabled = this.gm.player == null || this.gm.player.getMinSize() != this.gm.player.getMaxSize();
@ -378,8 +378,8 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
if(GuiChar.this.gm.player != null) { if(GuiChar.this.gm.player != null) {
GuiChar.this.gm.displayGuiScreen(GuiLoading.makeWaitTask("Lade Welt ...")); GuiChar.this.gm.displayGuiScreen(GuiLoading.makeWaitTask("Lade Welt ..."));
Dimension dim = UniverseRegistry.getBaseDimensions().get(GuiChar.this.dimension); Dimension dim = UniverseRegistry.getBaseDimensions().get(GuiChar.this.dimension);
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText())); GuiChar.this.gm.player.client.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText()));
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId())); GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId()));
} }
} }
}, "Charakter erstellen")); }, "Charakter erstellen"));
@ -391,7 +391,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
elem.setText(GuiChar.this.gm.player == null ? "..." : GuiChar.this.gm.player.getCustomNameTag()); elem.setText(GuiChar.this.gm.player == null ? "..." : GuiChar.this.gm.player.getCustomNameTag());
else if(GuiChar.this.gm.player != null) { else if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false; GuiChar.this.waiting = false;
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.DISPLAY, name)); GuiChar.this.gm.player.client.addToSendQueue(new CPacketMessage(CPacketMessage.Type.DISPLAY, name));
} }
} }
} }

View file

@ -70,7 +70,7 @@ public class GuiClass extends GuiList<GuiClass.ClassEntry> implements ActButton.
public void use(ActButton elem, Mode action) { public void use(ActButton elem, Mode action) {
ClassEntry entry = this.getSelected(); ClassEntry entry = this.getSelected();
if(entry != null && GuiClass.this.gm.player != null) { if(entry != null && GuiClass.this.gm.player != null) {
GuiClass.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal())); GuiClass.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal()));
this.gm.displayGuiScreen(GuiChar.INSTANCE); this.gm.displayGuiScreen(GuiChar.INSTANCE);
} }
} }

View file

@ -74,6 +74,6 @@ public class GuiSpecies extends GuiList<GuiSpecies.SpeciesEntry> implements ActB
public void use(ActButton elem, Mode action) { public void use(ActButton elem, Mode action) {
SpeciesEntry entry = this.getSelected(); SpeciesEntry entry = this.getSelected();
if(entry != null && GuiSpecies.this.gm.player != null) if(entry != null && GuiSpecies.this.gm.player != null)
GuiSpecies.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz))); GuiSpecies.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz)));
} }
} }

View file

@ -644,7 +644,7 @@ public abstract class GuiContainer extends Gui
if(this.cheatStack != null) { if(this.cheatStack != null) {
Slot slot = this.getSlotAtPosition(mouseX, mouseY); Slot slot = this.getSlotAtPosition(mouseX, mouseY);
if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.player != null && slot.inventory == this.gm.player.inventory) if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.player != null && slot.inventory == this.gm.player.inventory)
this.gm.player.sendQueue.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1)); this.gm.player.client.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1));
if(mouseButton != 1 && !this.gm.ctrl()) if(mouseButton != 1 && !this.gm.ctrl())
this.cheatStack = null; this.cheatStack = null;
return; return;
@ -1197,7 +1197,7 @@ public abstract class GuiContainer extends Gui
if(i1 >= 0 && i1 < ITEM_LIST.size()) { if(i1 >= 0 && i1 < ITEM_LIST.size()) {
if(slot >= 0 || instant) { if(slot >= 0 || instant) {
this.gm.player.sendQueue.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full)); this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full));
} }
else { else {
this.cheatStack = ITEM_LIST.get(i1).copy(); this.cheatStack = ITEM_LIST.get(i1).copy();

View file

@ -30,6 +30,7 @@ public class ClientLoginHandler extends NetHandler implements IClientLoginHandle
public void handleLoginSuccess(RPacketLoginSuccess packetIn) public void handleLoginSuccess(RPacketLoginSuccess packetIn)
{ {
this.gm.debugWorld = packetIn.isDebug();
this.networkManager.setConnectionState(PacketRegistry.PLAY); this.networkManager.setConnectionState(PacketRegistry.PLAY);
this.networkManager.setNetHandler(new ClientPlayer(this.gm, this.networkManager)); this.networkManager.setNetHandler(new ClientPlayer(this.gm, this.networkManager));
} }

View file

@ -27,6 +27,7 @@ import client.gui.container.GuiRepair;
import client.gui.ingame.GuiSign; import client.gui.ingame.GuiSign;
import client.renderer.particle.EntityPickupFX; import client.renderer.particle.EntityPickupFX;
import client.renderer.texture.EntityTexManager; import client.renderer.texture.EntityTexManager;
import client.world.WorldClient;
import common.attributes.Attribute; import common.attributes.Attribute;
import common.attributes.AttributeInstance; import common.attributes.AttributeInstance;
import common.attributes.AttributeMap; import common.attributes.AttributeMap;
@ -126,6 +127,7 @@ import common.packet.SPacketUpdateHealth;
import common.packet.SPacketWorld; import common.packet.SPacketWorld;
import common.potion.PotionEffect; import common.potion.PotionEffect;
import common.rng.Random; import common.rng.Random;
import common.sound.Sound;
import common.tileentity.IInteractionObject; import common.tileentity.IInteractionObject;
import common.tileentity.LocalBlockIntercommunication; import common.tileentity.LocalBlockIntercommunication;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
@ -137,7 +139,6 @@ import common.world.Chunk;
import common.world.Explosion; import common.world.Explosion;
import common.world.Weather; import common.world.Weather;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class ClientPlayer extends NetHandler implements IClientPlayer public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
@ -180,6 +181,52 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
this.netManager = p_i46300_3_; this.netManager = p_i46300_3_;
} }
public void playSound(Sound sound) {
this.gameController.getSoundManager().playSound(sound);
}
public void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes) {
this.gameController.effectRenderer.emitParticleAtEntity(entityIn, particleTypes);
}
public boolean isJumping() {
return this.gameController.jump;
}
public boolean isSprinting() {
return this.gameController.sprint;
}
public boolean isSneaking() {
return this.gameController.sneak;
}
public float getMoveForward() {
return this.gameController.moveForward;
}
public float getMoveStrafe() {
return this.gameController.moveStrafe;
}
public void setMoveForward(float value) {
this.gameController.moveForward = value;
}
public void setMoveStrafe(float value) {
this.gameController.moveStrafe = value;
}
public boolean isRenderViewEntity(Entity entity) {
return this.gameController.getRenderViewEntity() == entity;
}
public void updatePlayerMoveState() {
this.gameController.updatePlayerMoveState();
}
/** /**
* Clears the WorldClient instance associated with this NetHandlerPlayClient * Clears the WorldClient instance associated with this NetHandlerPlayClient
*/ */
@ -482,7 +529,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
float yaw = packetIn.getYaw(); float yaw = packetIn.getYaw();
float pitch = packetIn.getPitch(); float pitch = packetIn.getPitch();
EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.world); // new EntityNPC(this.gameController.theWorld); // , /* this.getPlayerInfo( */ packetIn.getUser()); // ).getUser()); EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.world); // new EntityNPC(this.gameController.theWorld); // , /* this.getPlayerInfo( */ packetIn.getUser()); // ).getUser());
player.setOtherPlayer(this.gameController); player.setOtherPlayer();
player.prevX = player.lastTickPosX = (double)(player.serverPosX = packetIn.getX()); player.prevX = player.lastTickPosX = (double)(player.serverPosX = packetIn.getX());
player.prevY = player.lastTickPosY = (double)(player.serverPosY = packetIn.getY()); player.prevY = player.lastTickPosY = (double)(player.serverPosY = packetIn.getY());
player.prevZ = player.lastTickPosZ = (double)(player.serverPosZ = packetIn.getZ()); player.prevZ = player.lastTickPosZ = (double)(player.serverPosZ = packetIn.getZ());

View file

@ -13,6 +13,7 @@ import client.Client;
import client.renderer.particle.EffectRenderer; import client.renderer.particle.EffectRenderer;
import client.renderer.texture.DynamicTexture; import client.renderer.texture.DynamicTexture;
import client.renderer.texture.TextureMap; import client.renderer.texture.TextureMap;
import client.world.WorldClient;
import common.biome.Biome; import common.biome.Biome;
import common.block.Block; import common.block.Block;
import common.entity.Entity; import common.entity.Entity;
@ -32,7 +33,6 @@ import common.util.ExtMath;
import common.util.HitPosition; import common.util.HitPosition;
import common.util.Vec3; import common.util.Vec3;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class EntityRenderer { public class EntityRenderer {
private static final String locationMoltenPng = "textures/world/molten.png"; private static final String locationMoltenPng = "textures/world/molten.png";

View file

@ -25,6 +25,7 @@ import client.renderer.texture.TextureAtlasSprite;
import client.renderer.texture.TextureManager; import client.renderer.texture.TextureManager;
import client.renderer.texture.TextureMap; import client.renderer.texture.TextureMap;
import client.renderer.tileentity.TileEntityRendererDispatcher; import client.renderer.tileentity.TileEntityRendererDispatcher;
import client.world.WorldClient;
import common.block.Block; import common.block.Block;
import common.block.BlockChest; import common.block.BlockChest;
import common.block.BlockSign; import common.block.BlockSign;
@ -52,7 +53,6 @@ import common.util.Vec3;
import common.util.Vector3f; import common.util.Vector3f;
import common.world.Chunk; import common.world.Chunk;
import common.world.State; import common.world.State;
import common.world.WorldClient;
public class RenderGlobal public class RenderGlobal
{ {

View file

@ -5,12 +5,11 @@ import client.renderer.RenderBuffer;
import client.renderer.texture.TextureAtlasSprite; import client.renderer.texture.TextureAtlasSprite;
import common.entity.Entity; import common.entity.Entity;
import common.entity.EntityType; import common.entity.EntityType;
import common.entity.types.IEntityFX;
import common.nbt.NBTTagCompound; import common.nbt.NBTTagCompound;
import common.util.ExtMath; import common.util.ExtMath;
import common.world.World; import common.world.World;
public class EntityFX extends Entity implements IEntityFX public class EntityFX extends Entity
{ {
protected int particleTextureIndexX; protected int particleTextureIndexX;
protected int particleTextureIndexY; protected int particleTextureIndexY;

View file

@ -2,6 +2,7 @@ package client.renderer.particle;
import client.Client; import client.Client;
import client.renderer.RenderBuffer; import client.renderer.RenderBuffer;
import client.world.WorldClient;
import common.entity.Entity; import common.entity.Entity;
import common.init.SoundEvent; import common.init.SoundEvent;
import common.item.ItemDye; import common.item.ItemDye;
@ -10,7 +11,6 @@ import common.nbt.NBTTagList;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.ExtMath; import common.util.ExtMath;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class EntityFirework public class EntityFirework
{ {

View file

@ -1,10 +1,10 @@
package client.renderer.particle; package client.renderer.particle;
import client.renderer.RenderBuffer; import client.renderer.RenderBuffer;
import client.world.WorldClient;
import common.entity.Entity; import common.entity.Entity;
import common.model.ParticleType; import common.model.ParticleType;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class EntityParticleEmitter extends EntityFX public class EntityParticleEmitter extends EntityFX
{ {

View file

@ -1,4 +1,4 @@
package common.world; package client.world;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
@ -9,6 +9,8 @@ import common.init.Blocks;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.world.Chunk;
import common.world.LightType;
public class EmptyChunk extends Chunk { public class EmptyChunk extends Chunk {
public EmptyChunk(WorldClient world) { public EmptyChunk(WorldClient world) {

View file

@ -1,9 +1,11 @@
package common.world; package client.world;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import common.IClient; import client.Client;
import client.renderer.particle.EntityFX;
import client.renderer.particle.EntityFirework;
import common.biome.Biome; import common.biome.Biome;
import common.block.Block; import common.block.Block;
import common.collect.Lists; import common.collect.Lists;
@ -12,7 +14,6 @@ import common.dimension.Dimension;
import common.entity.Entity; import common.entity.Entity;
import common.entity.item.EntityCart; import common.entity.item.EntityCart;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.types.IEntityFX;
import common.init.BlockRegistry; import common.init.BlockRegistry;
import common.init.ItemRegistry; import common.init.ItemRegistry;
import common.init.Items; import common.init.Items;
@ -32,12 +33,15 @@ import common.util.ExtMath;
import common.util.LongHashMap; import common.util.LongHashMap;
import common.util.Vec3; import common.util.Vec3;
import common.util.BlockPos.MutableBlockPos; import common.util.BlockPos.MutableBlockPos;
import common.world.Chunk;
import common.world.AWorldClient;
import common.world.State;
public class WorldClient extends World public class WorldClient extends AWorldClient
{ {
private static final int DISPLAY_RANGE = 16; private static final int DISPLAY_RANGE = 16;
private final IClient gm; private final Client gm;
private final Set<Entity> entityList = Sets.<Entity>newHashSet(); private final Set<Entity> entityList = Sets.<Entity>newHashSet();
private final Set<Entity> spawnQueue = Sets.<Entity>newHashSet(); private final Set<Entity> spawnQueue = Sets.<Entity>newHashSet();
private final Set<ChunkPos> previousActive = Sets.<ChunkPos>newHashSet(); private final Set<ChunkPos> previousActive = Sets.<ChunkPos>newHashSet();
@ -48,14 +52,14 @@ public class WorldClient extends World
protected int lastLightning; protected int lastLightning;
protected Vec3 lightColor = new Vec3(0xffffff); protected Vec3 lightColor = new Vec3(0xffffff);
public WorldClient(IClient gm, boolean debug, Dimension dim) public WorldClient(Client gm, boolean debug, Dimension dim)
{ {
super(dim, true, debug); super(dim, debug);
this.gm = gm; this.gm = gm;
this.calculateInitialSkylight(); this.calculateInitialSkylight();
this.calculateInitialWeather(); this.calculateInitialWeather();
this.setGravity(this.gm.getGravity()); this.setGravity(this.gm.gravity);
this.setTimeFactor(this.gm.getTimeFactor()); this.setTimeFactor(this.gm.timeFactor);
// this.setDifficulty(this.gm.difficulty); // this.setDifficulty(this.gm.difficulty);
} }
@ -63,7 +67,7 @@ public class WorldClient extends World
{ {
// this.info.tick(); // this.info.tick();
if (this.gm.hasDayCycle()) if (this.gm.dayCycle)
{ {
this.daytime += this.timeFactor; this.daytime += this.timeFactor;
} }
@ -92,7 +96,7 @@ public class WorldClient extends World
protected void updateBlocks() protected void updateBlocks()
{ {
this.setActivePlayerChunksAndCheckLight(this.gm.getRenderDistance()); this.setActivePlayerChunksAndCheckLight(this.gm.renderDistance);
this.previousActive.retainAll(this.active); this.previousActive.retainAll(this.active);
if (this.previousActive.size() == this.active.size()) if (this.previousActive.size() == this.active.size())
@ -160,7 +164,7 @@ public class WorldClient extends World
} }
else if (entityIn instanceof EntityCart) else if (entityIn instanceof EntityCart)
{ {
this.gm.playSound(new MovingSoundMinecart((EntityCart)entityIn)); this.gm.getSoundManager().playSound(new MovingSoundMinecart((EntityCart)entityIn));
} }
return flag; return flag;
@ -220,7 +224,7 @@ public class WorldClient extends World
public Entity getEntityByID(int id) public Entity getEntityByID(int id)
{ {
return (Entity)(id == this.gm.getPlayer().getId() ? this.gm.getPlayer() : super.getEntityByID(id)); return (Entity)(id == this.gm.player.getId() ? this.gm.player : super.getEntityByID(id));
} }
public Entity removeEntityFromWorld(int entityID) public Entity removeEntityFromWorld(int entityID)
@ -338,13 +342,13 @@ public class WorldClient extends World
// } // }
// else // else
// { // {
this.gm.playSound(positionedsoundrecord); this.gm.getSoundManager().playSound(positionedsoundrecord);
// } // }
} }
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
{ {
this.gm.makeFireworks(x, y, z, motionX, motionY, motionZ, compund); this.gm.effectRenderer.addEffect(new EntityFirework.StarterFX(this.gm.world, x, y, z, motionX, motionY, motionZ, this.gm.effectRenderer, compund));
} }
public Chunk getChunk(int x, int z) public Chunk getChunk(int x, int z)
@ -373,7 +377,7 @@ public class WorldClient extends World
this.spawnEntityFX(particleType, particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data); this.spawnEntityFX(particleType, particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data);
} }
public IEntityFX spawnEntityFX(ParticleType particle, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] parameters) public EntityFX spawnEntityFX(ParticleType particle, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] parameters)
{ {
if (this.gm.getRenderViewEntity() != null) if (this.gm.getRenderViewEntity() != null)
{ {
@ -391,14 +395,14 @@ public class WorldClient extends World
if (ignoreRange) if (ignoreRange)
{ {
return this.gm.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); return this.gm.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters);
} }
else else
{ {
double d3 = 16.0D; double d3 = 16.0D;
if(d0 * d0 + d1 * d1 + d2 * d2 > 256.0D) if(d0 * d0 + d1 * d1 + d2 * d2 > 256.0D)
return null; return null;
return this.gm.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); return this.gm.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters);
} }
} }
return null; return null;
@ -585,10 +589,10 @@ public class WorldClient extends World
if (block.getMaterial() != Material.air) if (block.getMaterial() != Material.air)
{ {
this.gm.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(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.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255)); this.gm.effectRenderer.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255));
break; break;
case 2002: case 2002:
@ -625,7 +629,7 @@ public class WorldClient extends World
double d24 = Math.cos(d23) * d22; double d24 = Math.cos(d23) * d22;
double d9 = 0.01D + this.rand.doublev() * 0.5D; double d9 = 0.01D + this.rand.doublev() * 0.5D;
double d11 = Math.sin(d23) * d22; double d11 = Math.sin(d23) * d22;
IEntityFX entityfx = this.spawnEntityFX(enumparticletypes, enumparticletypes.getShouldIgnoreRange(), d13 + d24 * 0.1D, d14 + 0.3D, d16 + d11 * 0.1D, d24, d9, d11, new int[0]); EntityFX entityfx = this.spawnEntityFX(enumparticletypes, enumparticletypes.getShouldIgnoreRange(), d13 + d24 * 0.1D, d14 + 0.3D, d16 + d11 * 0.1D, d24, d9, d11, new int[0]);
if (entityfx != null) if (entityfx != null)
{ {
@ -662,7 +666,7 @@ public class WorldClient extends World
int i = pos.getX(); int i = pos.getX();
int j = pos.getY(); int j = pos.getY();
int k = pos.getZ(); int k = pos.getZ();
this.gm.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); this.gm.renderGlobal.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1);
} }
public void notifyLightSet(BlockPos pos) public void notifyLightSet(BlockPos pos)
@ -670,17 +674,17 @@ public class WorldClient extends World
int i = pos.getX(); int i = pos.getX();
int j = pos.getY(); int j = pos.getY();
int k = pos.getZ(); int k = pos.getZ();
this.gm.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); this.gm.renderGlobal.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1);
} }
public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)
{ {
this.gm.markBlocksForUpdate(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1); this.gm.renderGlobal.markBlocksForUpdate(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1);
} }
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
{ {
this.gm.sendBlockBreakProgress(breakerId, pos, progress); this.gm.renderGlobal.sendBlockBreakProgress(breakerId, pos, progress);
} }
public float getSunBrightness(float p_72971_1_) { public float getSunBrightness(float p_72971_1_) {

View file

@ -1,34 +0,0 @@
package common;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.entity.types.IEntityFX;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.sound.Sound;
import common.util.BlockPos;
import common.world.State;
public interface IClient {
int getRenderDistance();
float getGravity();
int getTimeFactor();
boolean hasDayCycle();
void playSound(Sound sound);
EntityNPC getPlayer();
Entity getRenderViewEntity();
void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund);
IEntityFX spawnEffectParticle(int particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int[] parameters);
void addBlockDestroyEffects(BlockPos pos, State state);
void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress);
void markBlocksForUpdate(int x1, int y1, int z1, int x2, int y2, int z2);
void updatePlayerMoveState();
void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes);
boolean isJumping();
boolean isSprinting();
boolean isSneaking();
float getMoveForward();
float getMoveStrafe();
void setMoveForward(float value);
void setMoveStrafe(float value);
}

View file

@ -1,25 +0,0 @@
package common;
import java.util.List;
import java.util.Map;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.network.IPlayer;
import common.network.Packet;
import common.util.BlockPos;
import common.util.PortalType;
import common.util.Position;
import common.world.WorldServer;
public interface IServer {
List<IPlayer> getIPlayers();
void sendPacket(Packet packet);
void sendPacket(Packet packet, int dimension);
void sendNear(double x, double y, double z, double radius, int dimension, Packet packet);
void sendNearExcept(EntityNPC except, double x, double y, double z, double radius, int dimension, Packet packet);
Map<String, Position> getWarps();
List<WorldServer> getWorlds();
WorldServer getWorld(int dimension);
void placeInDimension(Entity entity, WorldServer oldWorld, WorldServer world, BlockPos pos, PortalType portal);
}

View file

@ -5,7 +5,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Vec3; import common.util.Vec3;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAIFleeSun extends EntityAIBase public class EntityAIFleeSun extends EntityAIBase
{ {
@ -29,7 +29,7 @@ public class EntityAIFleeSun extends EntityAIBase
*/ */
public boolean shouldExecute() public boolean shouldExecute()
{ {
if (!((WorldServer)this.theWorld).isDaytime()) if (!((AWorldServer)this.theWorld).isDaytime())
{ {
return false; return false;
} }

View file

@ -5,7 +5,7 @@ import common.util.BlockPos;
import common.util.Vec3; import common.util.Vec3;
import common.village.Village; import common.village.Village;
import common.village.VillageDoorInfo; import common.village.VillageDoorInfo;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAIMoveIndoors extends EntityAIBase public class EntityAIMoveIndoors extends EntityAIBase
{ {
@ -27,7 +27,7 @@ public class EntityAIMoveIndoors extends EntityAIBase
{ {
BlockPos blockpos = new BlockPos(this.entityObj); BlockPos blockpos = new BlockPos(this.entityObj);
if ((!((WorldServer)this.entityObj.worldObj).isDaytime() /* || this.entityObj.worldObj.isRaining() && !this.entityObj.worldObj.getBiomeGenForCoords(blockpos).canRain() */) && !this.entityObj.worldObj.dimension.hasNoLight()) if ((!((AWorldServer)this.entityObj.worldObj).isDaytime() /* || this.entityObj.worldObj.isRaining() && !this.entityObj.worldObj.getBiomeGenForCoords(blockpos).canRain() */) && !this.entityObj.worldObj.dimension.hasNoLight())
{ {
if (this.entityObj.getRNG().zrange(50) != 0) if (this.entityObj.getRNG().zrange(50) != 0)
{ {
@ -39,7 +39,7 @@ public class EntityAIMoveIndoors extends EntityAIBase
} }
else else
{ {
Village village = ((WorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 14); Village village = ((AWorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 14);
if (village == null) if (village == null)
{ {

View file

@ -11,7 +11,7 @@ import common.util.ExtMath;
import common.util.Vec3; import common.util.Vec3;
import common.village.Village; import common.village.Village;
import common.village.VillageDoorInfo; import common.village.VillageDoorInfo;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAIMoveThroughVillage extends EntityAIBase public class EntityAIMoveThroughVillage extends EntityAIBase
{ {
@ -44,13 +44,13 @@ public class EntityAIMoveThroughVillage extends EntityAIBase
{ {
this.resizeDoorList(); this.resizeDoorList();
if (this.isNocturnal && ((WorldServer)this.theEntity.worldObj).isDaytime()) if (this.isNocturnal && ((AWorldServer)this.theEntity.worldObj).isDaytime())
{ {
return false; return false;
} }
else else
{ {
Village village = ((WorldServer)this.theEntity.worldObj).getNearestVillage(new BlockPos(this.theEntity), 0); Village village = ((AWorldServer)this.theEntity.worldObj).getNearestVillage(new BlockPos(this.theEntity), 0);
if (village == null) if (village == null)
{ {

View file

@ -3,7 +3,7 @@ package common.ai;
import common.entity.Entity; import common.entity.Entity;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAINpcMate extends EntityAIBase public class EntityAINpcMate extends EntityAIBase
{ {
@ -33,7 +33,7 @@ public class EntityAINpcMate extends EntityAIBase
{ {
if (this.npc.getIsWillingToMate(true)) if (this.npc.getIsWillingToMate(true))
{ {
Entity entity = ((WorldServer)this.worldObj).findNearestEntityWithinAABB(EntityNPC.class, this.npc.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.npc); Entity entity = ((AWorldServer)this.worldObj).findNearestEntityWithinAABB(EntityNPC.class, this.npc.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.npc);
if (entity == null) if (entity == null)
{ {

View file

@ -5,7 +5,7 @@ import common.pathfinding.PathNavigateGround;
import common.util.BlockPos; import common.util.BlockPos;
import common.village.Village; import common.village.Village;
import common.village.VillageDoorInfo; import common.village.VillageDoorInfo;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAIRestrictOpenDoor extends EntityAIBase public class EntityAIRestrictOpenDoor extends EntityAIBase
{ {
@ -27,14 +27,14 @@ public class EntityAIRestrictOpenDoor extends EntityAIBase
*/ */
public boolean shouldExecute() public boolean shouldExecute()
{ {
if (((WorldServer)this.entityObj.worldObj).isDaytime()) if (((AWorldServer)this.entityObj.worldObj).isDaytime())
{ {
return false; return false;
} }
else else
{ {
BlockPos blockpos = new BlockPos(this.entityObj); BlockPos blockpos = new BlockPos(this.entityObj);
Village village = ((WorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 16); Village village = ((AWorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 16);
if (village == null) if (village == null)
{ {
@ -53,7 +53,7 @@ public class EntityAIRestrictOpenDoor extends EntityAIBase
*/ */
public boolean continueExecuting() public boolean continueExecuting()
{ {
return ((WorldServer)this.entityObj.worldObj).isDaytime() ? false : !this.frontDoor.getIsDetachedFromVillageFlag() && this.frontDoor.isIndoorSide(new BlockPos(this.entityObj)); return ((AWorldServer)this.entityObj.worldObj).isDaytime() ? false : !this.frontDoor.getIsDetachedFromVillageFlag() && this.frontDoor.isIndoorSide(new BlockPos(this.entityObj));
} }
/** /**

View file

@ -2,7 +2,7 @@ package common.ai;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.pathfinding.PathNavigateGround; import common.pathfinding.PathNavigateGround;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAIRestrictSun extends EntityAIBase public class EntityAIRestrictSun extends EntityAIBase
{ {
@ -18,7 +18,7 @@ public class EntityAIRestrictSun extends EntityAIBase
*/ */
public boolean shouldExecute() public boolean shouldExecute()
{ {
return ((WorldServer)this.theEntity.worldObj).isDaytime(); return ((AWorldServer)this.theEntity.worldObj).isDaytime();
} }
/** /**

View file

@ -2,7 +2,7 @@ package common.ai;
import common.entity.Entity; import common.entity.Entity;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.world.WorldServer; import common.world.AWorldServer;
public class EntityAIWatchClosest extends EntityAIBase public class EntityAIWatchClosest extends EntityAIBase
{ {
@ -57,7 +57,7 @@ public class EntityAIWatchClosest extends EntityAIBase
} }
else else
{ {
this.closestEntity = ((WorldServer)this.theWatcher.worldObj).findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.getEntityBoundingBox().expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); this.closestEntity = ((AWorldServer)this.theWatcher.worldObj).findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.getEntityBoundingBox().expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher);
} }
return this.closestEntity != null; return this.closestEntity != null;

View file

@ -36,7 +36,7 @@ import common.util.BlockPos;
import common.util.ExtMath; import common.util.ExtMath;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenClay; import common.worldgen.feature.WorldGenClay;
@ -315,7 +315,7 @@ public abstract class Biome {
} }
} }
public void decorate(WorldServer world, Random rand, BlockPos pos) public void decorate(AWorldServer world, Random rand, BlockPos pos)
{ {
for (int i = 0; i < this.sandPerChunk2; ++i) for (int i = 0; i < this.sandPerChunk2; ++i)
{ {
@ -564,7 +564,7 @@ public abstract class Biome {
return Colorizer.getFoliageColor(d0, d1); return Colorizer.getFoliageColor(d0, d1);
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
} }
@ -579,7 +579,7 @@ public abstract class Biome {
* *
* If this.fillerBlock is red sand, we replace some of that with red sandstone. * If this.fillerBlock is red sand, we replace some of that with red sandstone.
*/ */
public final void generateBiomeTerrain(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public final void generateBiomeTerrain(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
int i = worldIn.getSeaLevel(); int i = worldIn.getSeaLevel();
State worldState = worldIn.dimension.getFiller(); State worldState = worldIn.dimension.getFiller();

View file

@ -7,7 +7,7 @@ import common.init.EntityRegistry;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.foliage.WorldGenMushroom; import common.worldgen.foliage.WorldGenMushroom;
@ -29,7 +29,7 @@ public class BiomeChaos extends Biome
} }
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.feature.WorldGenDesertWells; import common.worldgen.feature.WorldGenDesertWells;
public class BiomeDesert extends Biome public class BiomeDesert extends Biome
@ -24,7 +24,7 @@ public class BiomeDesert extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
public class BiomeExterminated extends Biome { public class BiomeExterminated extends Biome {
public BiomeExterminated(int id) { public BiomeExterminated(int id) {
@ -16,7 +16,7 @@ public class BiomeExterminated extends Biome {
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) {
} }
public int getSkyColor() { public int getSkyColor() {

View file

@ -10,7 +10,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.ExtMath; import common.util.ExtMath;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.foliage.WorldGenBigMushroom; import common.worldgen.foliage.WorldGenBigMushroom;
import common.worldgen.tree.WorldGenBaseTree; import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenBigTree; import common.worldgen.tree.WorldGenBigTree;
@ -120,7 +120,7 @@ public class BiomeForest extends Biome
} }
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
// if(worldIn.getLeavesGen() != this.leavesType) { // if(worldIn.getLeavesGen() != this.leavesType) {
// this.leavesType = worldIn.getLeavesGen(); // this.leavesType = worldIn.getLeavesGen();
@ -229,7 +229,7 @@ public class BiomeForest extends Biome
{ {
return this.id != Biome.birchForest.id && this.id != Biome.birchForestHills.id ? new BiomeMutated(id, this) return this.id != Biome.birchForest.id && this.id != Biome.birchForestHills.id ? new BiomeMutated(id, this)
{ {
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
this.baseBiome.decorate(worldIn, rand, pos); this.baseBiome.decorate(worldIn, rand, pos);
} }

View file

@ -10,7 +10,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureOres; import common.worldgen.FeatureOres;
import common.worldgen.feature.WorldGenFire; import common.worldgen.feature.WorldGenFire;
import common.worldgen.feature.WorldGenGlowStone; import common.worldgen.feature.WorldGenGlowStone;
@ -73,7 +73,7 @@ public class BiomeHell extends Biome
mobs.add(new RngSpawn(EntityMagma.class, 1, 4, 4)); mobs.add(new RngSpawn(EntityMagma.class, 1, 4, 4));
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
if(this.subtype == 0) { if(this.subtype == 0) {
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)

View file

@ -3,7 +3,7 @@ package common.biome;
import common.init.Blocks; import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureOres; import common.worldgen.FeatureOres;
import common.worldgen.tree.WorldGenTaiga2; import common.worldgen.tree.WorldGenTaiga2;
@ -36,7 +36,7 @@ public class BiomeHills extends Biome
return (WorldGenTree)(rand.rarity(3) ? this.field_150634_aD : super.genBigTreeChance(rand)); return (WorldGenTree)(rand.rarity(3) ? this.field_150634_aD : super.genBigTreeChance(rand));
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);
// int i = 3 + rand.nextInt(6); // int i = 3 + rand.nextInt(6);
@ -64,7 +64,7 @@ public class BiomeHills extends Biome
// } // }
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
this.topBlock = Blocks.grass.getState(); this.topBlock = Blocks.grass.getState();
this.fillerBlock = Blocks.dirt.getState(); this.fillerBlock = Blocks.dirt.getState();

View file

@ -7,7 +7,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.foliage.WorldGenMelon; import common.worldgen.foliage.WorldGenMelon;
import common.worldgen.foliage.WorldGenShrub; import common.worldgen.foliage.WorldGenShrub;
@ -63,7 +63,7 @@ public class BiomeJungle extends Biome
return rand.chance(4) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); return rand.chance(4) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);
int i = rand.chOffset(); int i = rand.chOffset();

View file

@ -14,7 +14,7 @@ import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenTree; import common.worldgen.tree.WorldGenTree;
@ -71,12 +71,12 @@ public class BiomeMesa extends Biome
return 9470285; return 9470285;
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
if (this.layers == null || this.layerSeed != worldIn.getSeed()) if (this.layers == null || this.layerSeed != worldIn.getSeed())
{ {

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureOres; import common.worldgen.FeatureOres;
public class BiomeMoon extends Biome { public class BiomeMoon extends Biome {
@ -19,7 +19,7 @@ public class BiomeMoon extends Biome {
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) {
this.cheeseGenerator.generate(worldIn, rand, pos); this.cheeseGenerator.generate(worldIn, rand, pos);
} }
} }

View file

@ -3,7 +3,7 @@ package common.biome;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenTree; import common.worldgen.tree.WorldGenTree;
@ -43,17 +43,17 @@ public class BiomeMutated extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
this.baseBiome.decorate(worldIn, rand, pos); // TODO: check this.baseBiome.decorate(worldIn, rand, pos); // TODO: check
} }
public void decorateNormal(WorldServer worldIn, Random rand, BlockPos pos) public void decorateNormal(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal); this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
} }

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
public class BiomeNone extends Biome { public class BiomeNone extends Biome {
@ -17,10 +17,10 @@ public class BiomeNone extends Biome {
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) {
} }
public Temperature getTempCategory() { public Temperature getTempCategory() {

View file

@ -5,7 +5,7 @@ import common.block.BlockFlower;
import common.entity.animal.EntityHorse; import common.entity.animal.EntityHorse;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
public class BiomePlains extends Biome public class BiomePlains extends Biome
{ {
@ -68,7 +68,7 @@ public class BiomePlains extends Biome
} }
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
double d0 = GRASS_NOISE.generate((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D); double d0 = GRASS_NOISE.generate((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);

View file

@ -6,7 +6,7 @@ import common.entity.animal.EntityHorse;
import common.init.Blocks; import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenSavanna; import common.worldgen.tree.WorldGenSavanna;
import common.worldgen.tree.WorldGenTree; import common.worldgen.tree.WorldGenTree;
@ -38,7 +38,7 @@ public class BiomeSavanna extends Biome
return biomegenbase; return biomegenbase;
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
@ -63,7 +63,7 @@ public class BiomeSavanna extends Biome
this.grassPerChunk = 5; this.grassPerChunk = 5;
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
this.topBlock = Blocks.grass.getState(); this.topBlock = Blocks.grass.getState();
this.fillerBlock = Blocks.dirt.getState(); this.fillerBlock = Blocks.dirt.getState();
@ -81,7 +81,7 @@ public class BiomeSavanna extends Biome
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
this.decorateNormal(worldIn, rand, pos); this.decorateNormal(worldIn, rand, pos);
} }

View file

@ -4,7 +4,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.feature.WorldGenIcePath; import common.worldgen.feature.WorldGenIcePath;
import common.worldgen.feature.WorldGenIceSpike; import common.worldgen.feature.WorldGenIceSpike;
import common.worldgen.tree.WorldGenTaiga2; import common.worldgen.tree.WorldGenTaiga2;
@ -27,7 +27,7 @@ public class BiomeSnow extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
if (this.spiky) if (this.spiky)
{ {

View file

@ -5,7 +5,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenAsteroid; import common.worldgen.feature.WorldGenAsteroid;
@ -26,7 +26,7 @@ public class BiomeSpace extends Biome
protected void addMobs(WeightedList<RngSpawn> mobs) { protected void addMobs(WeightedList<RngSpawn> mobs) {
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
if(rand.chance(5)) { if(rand.chance(5)) {
int x = rand.chOffset(); int x = rand.chOffset();

View file

@ -8,7 +8,7 @@ import common.material.Material;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.tree.WorldGenTree; import common.worldgen.tree.WorldGenTree;
@ -53,7 +53,7 @@ public class BiomeSwamp extends Biome
return BlockFlower.EnumFlowerType.BLUE_ORCHID; return BlockFlower.EnumFlowerType.BLUE_ORCHID;
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
double d0 = GRASS_NOISE.generate((double)x * 0.25D, (double)z * 0.25D); double d0 = GRASS_NOISE.generate((double)x * 0.25D, (double)z * 0.25D);

View file

@ -7,7 +7,7 @@ import common.entity.animal.EntityWolf;
import common.init.Blocks; import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.ChunkPrimer; import common.worldgen.ChunkPrimer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenBlockBlob; import common.worldgen.feature.WorldGenBlockBlob;
@ -59,7 +59,7 @@ public class BiomeTaiga extends Biome
return rand.rarity(5) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); return rand.rarity(5) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
if (this.field_150644_aH == 1 || this.field_150644_aH == 2) if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{ {
@ -87,7 +87,7 @@ public class BiomeTaiga extends Biome
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);
} }
public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{ {
if (this.field_150644_aH == 1 || this.field_150644_aH == 2) if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{ {

View file

@ -9,7 +9,7 @@ import common.init.Blocks;
import common.rng.Random; import common.rng.Random;
import common.rng.WeightedList; import common.rng.WeightedList;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.feature.WorldGenSpikes; import common.worldgen.feature.WorldGenSpikes;
import common.worldgen.foliage.WorldGenMushroom; import common.worldgen.foliage.WorldGenMushroom;
@ -57,7 +57,7 @@ public class BiomeTian extends Biome
return rand.pick(rand.chance(this.treeGen2, this.treeGen1, 4), rand.chance(this.treeGen3, this.treeGen4, 15)); return rand.pick(rand.chance(this.treeGen2, this.treeGen1, 4), rand.chance(this.treeGen3, this.treeGen4, 15));
} }
public void decorate(WorldServer worldIn, Random rand, BlockPos pos) public void decorate(AWorldServer worldIn, Random rand, BlockPos pos)
{ {
super.decorate(worldIn, rand, pos); super.decorate(worldIn, rand, pos);

View file

@ -46,10 +46,10 @@ import common.util.HitPosition.ObjectType;
import common.world.Explosion; import common.world.Explosion;
import common.world.IBlockAccess; import common.world.IBlockAccess;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class Block public class Block
{ {
@ -698,14 +698,14 @@ public class Block
/** /**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/ */
public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{ {
this.updateTick(worldIn, pos, state, random); this.updateTick(worldIn, pos, state, random);
if(this.radiation > 0.0f && /* worldIn.getTime() % 5L == 0L && */ random.chance(Config.randomTick / 3)) if(this.radiation > 0.0f && /* worldIn.getTime() % 5L == 0L && */ random.chance(Config.randomTick / 3))
this.affectEntities(worldIn, pos, state, this.radiation * 8.0f * 0.25f); this.affectEntities(worldIn, pos, state, this.radiation * 8.0f * 0.25f);
} }
private void affectEntities(WorldServer worldIn, BlockPos pos, State state, float rad) private void affectEntities(AWorldServer worldIn, BlockPos pos, State state, float rad)
{ {
float r = ExtMath.clampf(rad * 2.0f, 0.0f, 25.0f); float r = ExtMath.clampf(rad * 2.0f, 0.0f, 25.0f);
BoundingBox box = this.getCollisionBoundingBox(worldIn, pos, state); BoundingBox box = this.getCollisionBoundingBox(worldIn, pos, state);
@ -719,11 +719,11 @@ public class Block
} }
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
} }
@ -749,11 +749,11 @@ public class Block
return 10; return 10;
} }
public void onBlockAdded(WorldServer world, BlockPos pos, State state) public void onBlockAdded(AWorldServer world, BlockPos pos, State state)
{ {
} }
public void onBlockRemoved(WorldServer world, BlockPos pos, State state) public void onBlockRemoved(AWorldServer world, BlockPos pos, State state)
{ {
} }

View file

@ -14,7 +14,7 @@ import common.world.IBlockAccess;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public abstract class BlockBasePressurePlate extends Block public abstract class BlockBasePressurePlate extends Block
{ {
@ -109,11 +109,11 @@ public abstract class BlockBasePressurePlate extends Block
/** /**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/ */
public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{ {
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {
@ -183,7 +183,7 @@ public abstract class BlockBasePressurePlate extends Block
return new BoundingBox((double)((float)pos.getX() + 0.125F), (double)pos.getY(), (double)((float)pos.getZ() + 0.125F), (double)((float)(pos.getX() + 1) - 0.125F), (double)pos.getY() + 0.25D, (double)((float)(pos.getZ() + 1) - 0.125F)); return new BoundingBox((double)((float)pos.getX() + 0.125F), (double)pos.getY(), (double)((float)pos.getZ() + 0.125F), (double)((float)(pos.getX() + 1) - 0.125F), (double)pos.getY() + 0.25D, (double)((float)(pos.getZ() + 1) - 0.125F));
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (this.getRedstoneStrength(state) > 0) if (this.getRedstoneStrength(state) > 0)
{ {

View file

@ -4,15 +4,15 @@ import common.material.Material;
import common.model.ParticleType; import common.model.ParticleType;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.WorldClient;
public class BlockBedrock extends Block { public class BlockBedrock extends Block {
public BlockBedrock() { public BlockBedrock() {
super(Material.rock); super(Material.rock);
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if(/* worldIn.canShowVoidParticles() && */ pos.getY() <= 5 && rand.chance(8)) { if(/* worldIn.canShowVoidParticles() && */ pos.getY() <= 5 && rand.chance(8)) {
worldIn.spawnParticle(ParticleType.SUSPENDED_DEPTH, (double)pos.getX() + rand.floatv(), (double)(pos.getY()+1) + (rand.floatv() * 0.5f), worldIn.spawnParticle(ParticleType.SUSPENDED_DEPTH, (double)pos.getX() + rand.floatv(), (double)(pos.getY()+1) + (rand.floatv() * 0.5f),

View file

@ -7,7 +7,7 @@ import common.material.Material;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockBlackenedDirt extends Block public class BlockBlackenedDirt extends Block
{ {
@ -18,7 +18,7 @@ public class BlockBlackenedDirt extends Block
this.setTab(CheatTab.tabNature); this.setTab(CheatTab.tabNature);
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (Config.darkDirtSpread) if (Config.darkDirtSpread)
{ {

View file

@ -10,7 +10,7 @@ import common.model.ModelProvider;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockBlackenedSoil extends Block public class BlockBlackenedSoil extends Block
{ {
@ -21,7 +21,7 @@ public class BlockBlackenedSoil extends Block
this.setTab(CheatTab.tabNature); this.setTab(CheatTab.tabNature);
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (worldIn.getLightFromNeighbors(pos.up()) < 2 && worldIn.getState(pos.up()).getBlock().getLightOpacity() > 6) if (worldIn.getLightFromNeighbors(pos.up()) < 2 && worldIn.getState(pos.up()).getBlock().getLightOpacity() > 6)
{ {

View file

@ -8,7 +8,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockBlueShroom extends BlockBush public class BlockBlueShroom extends BlockBush
{ {
@ -19,7 +19,7 @@ public class BlockBlueShroom extends BlockBush
this.setTickRandomly(); this.setTickRandomly();
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (Config.blueShroomGrowth > 0 && rand.chance(Config.blueShroomGrowth)) if (Config.blueShroomGrowth > 0 && rand.chance(Config.blueShroomGrowth))
{ {

View file

@ -23,10 +23,10 @@ import common.tileentity.TileEntityBrewingStand;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockBrewingStand extends BlockContainer public class BlockBrewingStand extends BlockContainer
{ {
@ -447,7 +447,7 @@ public class BlockBrewingStand extends BlockContainer
} }
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
double d0 = (double)((float)pos.getX() + 0.4F + rand.floatv() * 0.2F); double d0 = (double)((float)pos.getX() + 0.4F + rand.floatv() * 0.2F);
double d1 = (double)((float)pos.getY() + 0.7F + rand.floatv() * 0.3F); double d1 = (double)((float)pos.getY() + 0.7F + rand.floatv() * 0.3F);
@ -455,7 +455,7 @@ public class BlockBrewingStand extends BlockContainer
worldIn.spawnParticle(ParticleType.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D);
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);

View file

@ -9,7 +9,7 @@ import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockBush extends Block public class BlockBush extends Block
{ {
@ -49,7 +49,7 @@ public class BlockBush extends Block
this.checkAndDropBlock(worldIn, pos, state); this.checkAndDropBlock(worldIn, pos, state);
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
this.checkAndDropBlock(worldIn, pos, state); this.checkAndDropBlock(worldIn, pos, state);
} }

View file

@ -24,7 +24,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockButton extends Block public class BlockButton extends Block
{ {
@ -195,7 +195,7 @@ public class BlockButton extends Block
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (((Boolean)state.getValue(POWERED)).booleanValue()) if (((Boolean)state.getValue(POWERED)).booleanValue())
{ {
@ -226,11 +226,11 @@ public class BlockButton extends Block
/** /**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/ */
public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{ {
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {

View file

@ -17,7 +17,7 @@ import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockCactus extends Block public class BlockCactus extends Block
{ {
@ -43,7 +43,7 @@ public class BlockCactus extends Block
this.setTab(CheatTab.tabPlants); this.setTab(CheatTab.tabPlants);
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
BlockPos blockpos = pos.up(); BlockPos blockpos = pos.up();

View file

@ -29,7 +29,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockChest extends BlockContainer public class BlockChest extends BlockContainer
{ {
@ -92,7 +92,7 @@ public class BlockChest extends BlockContainer
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
this.checkForSurroundingChests(worldIn, pos, state); this.checkForSurroundingChests(worldIn, pos, state);
@ -416,7 +416,7 @@ public class BlockChest extends BlockContainer
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);

View file

@ -21,7 +21,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockCocoa extends BlockDirectional implements IGrowable public class BlockCocoa extends BlockDirectional implements IGrowable
{ {
@ -34,7 +34,7 @@ public class BlockCocoa extends BlockDirectional implements IGrowable
this.setTickRandomly(); this.setTickRandomly();
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (!this.canBlockStay(worldIn, pos, state)) if (!this.canBlockStay(worldIn, pos, state))
{ {
@ -197,7 +197,7 @@ public class BlockCocoa extends BlockDirectional implements IGrowable
return true; return true;
} }
public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{ {
worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(((Integer)state.getValue(AGE)).intValue() + 1)), 2); worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(((Integer)state.getValue(AGE)).intValue() + 1)), 2);
} }

View file

@ -6,7 +6,7 @@ import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public abstract class BlockContainer extends Block implements ITileEntityProvider public abstract class BlockContainer extends Block implements ITileEntityProvider
{ {
@ -34,7 +34,7 @@ public abstract class BlockContainer extends Block implements ITileEntityProvide
return -1; return -1;
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
worldIn.removeTileEntity(pos); worldIn.removeTileEntity(pos);

View file

@ -5,7 +5,7 @@ import common.item.CheatTab;
import common.material.Material; import common.material.Material;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockCore extends Block { public class BlockCore extends Block {
public BlockCore() { public BlockCore() {
@ -13,13 +13,13 @@ public class BlockCore extends Block {
this.setTab(CheatTab.tabTech); this.setTab(CheatTab.tabTech);
} }
public void onBlockRemoved(WorldServer world, BlockPos pos, State state) public void onBlockRemoved(AWorldServer world, BlockPos pos, State state)
{ {
if(Config.loaders) if(Config.loaders)
world.removeLoader(pos); world.removeLoader(pos);
} }
public void onBlockAdded(WorldServer world, BlockPos pos, State state) public void onBlockAdded(AWorldServer world, BlockPos pos, State state)
{ {
if(Config.loaders) if(Config.loaders)
world.addLoader(pos); world.addLoader(pos);

View file

@ -14,7 +14,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockCrops extends BlockBush implements IGrowable public class BlockCrops extends BlockBush implements IGrowable
{ {
@ -40,7 +40,7 @@ public class BlockCrops extends BlockBush implements IGrowable
return ground == Blocks.farmland; return ground == Blocks.farmland;
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
super.updateTick(worldIn, pos, state, rand); super.updateTick(worldIn, pos, state, rand);
@ -194,7 +194,7 @@ public class BlockCrops extends BlockBush implements IGrowable
return true; return true;
} }
public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{ {
this.grow(worldIn, pos, state); this.grow(worldIn, pos, state);
} }

View file

@ -24,7 +24,7 @@ import common.world.IWorldAccess;
import common.world.LightType; import common.world.LightType;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockDaylightDetector extends BlockContainer public class BlockDaylightDetector extends BlockContainer
{ {
@ -53,7 +53,7 @@ public class BlockDaylightDetector extends BlockContainer
return ((Integer)state.getValue(POWER)).intValue(); return ((Integer)state.getValue(POWER)).intValue();
} }
public void updatePower(WorldServer worldIn, BlockPos pos) public void updatePower(AWorldServer worldIn, BlockPos pos)
{ {
if (!worldIn.dimension.hasNoLight()) if (!worldIn.dimension.hasNoLight())
{ {
@ -90,12 +90,12 @@ public class BlockDaylightDetector extends BlockContainer
if (this.inverted) if (this.inverted)
{ {
worldIn.setState(pos, Blocks.daylight_detector.getState().withProperty(POWER, state.getValue(POWER)), 4); worldIn.setState(pos, Blocks.daylight_detector.getState().withProperty(POWER, state.getValue(POWER)), 4);
Blocks.daylight_detector.updatePower((WorldServer)worldIn, pos); Blocks.daylight_detector.updatePower((AWorldServer)worldIn, pos);
} }
else else
{ {
worldIn.setState(pos, Blocks.daylight_detector_inverted.getState().withProperty(POWER, state.getValue(POWER)), 4); worldIn.setState(pos, Blocks.daylight_detector_inverted.getState().withProperty(POWER, state.getValue(POWER)), 4);
Blocks.daylight_detector_inverted.updatePower((WorldServer)worldIn, pos); Blocks.daylight_detector_inverted.updatePower((AWorldServer)worldIn, pos);
} }
return true; return true;

View file

@ -28,7 +28,7 @@ import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockDispenser extends BlockContainer public class BlockDispenser extends BlockContainer
{ {
@ -52,7 +52,7 @@ public class BlockDispenser extends BlockContainer
return 4; return 4;
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockAdded(worldIn, pos, state); super.onBlockAdded(worldIn, pos, state);
this.setDefaultDirection(worldIn, pos, state); this.setDefaultDirection(worldIn, pos, state);
@ -172,7 +172,7 @@ public class BlockDispenser extends BlockContainer
} }
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {
@ -215,7 +215,7 @@ public class BlockDispenser extends BlockContainer
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);

View file

@ -27,7 +27,7 @@ import common.util.Facing.Axis;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockDoublePlant extends BlockBush implements IGrowable public class BlockDoublePlant extends BlockBush implements IGrowable
{ {
@ -45,7 +45,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
// this.setTickRandomly(); // this.setTickRandomly();
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(Config.plantDry && worldIn.getTemperatureC(pos) >= 50.0f) if(Config.plantDry && worldIn.getTemperatureC(pos) >= 50.0f)
{ {
@ -295,7 +295,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
return true; return true;
} }
public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{ {
spawnAsEntity(worldIn, pos, new ItemStack(this, 1, this.getVariant(worldIn, pos).getMeta())); spawnAsEntity(worldIn, pos, new ItemStack(this, 1, this.getVariant(worldIn, pos).getMeta()));
} }

View file

@ -13,7 +13,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockDragonEgg extends Block public class BlockDragonEgg extends Block
{ {
@ -82,7 +82,7 @@ public class BlockDragonEgg extends Block
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
} }
@ -95,7 +95,7 @@ public class BlockDragonEgg extends Block
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(Config.blockGravity) if(Config.blockGravity)
this.checkFall(worldIn, pos); this.checkFall(worldIn, pos);

View file

@ -11,7 +11,7 @@ import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockDynamicLiquid extends BlockLiquid public class BlockDynamicLiquid extends BlockLiquid
{ {
@ -29,7 +29,7 @@ public class BlockDynamicLiquid extends BlockLiquid
worldIn.setState(pos, getStaticBlock(this).getState().withProperty(LEVEL, currentState.getValue(LEVEL)), 2); worldIn.setState(pos, getStaticBlock(this).getState().withProperty(LEVEL, currentState.getValue(LEVEL)), 2);
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(!Config.liquidPhysics) if(!Config.liquidPhysics)
return; return;
@ -293,7 +293,7 @@ public class BlockDynamicLiquid extends BlockLiquid
return material != this.material && material != Material.lava && !this.isBlocked(worldIn, pos, state); return material != this.material && material != Material.lava && !this.isBlocked(worldIn, pos, state);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (!this.checkForMixing(worldIn, pos, state)) if (!this.checkForMixing(worldIn, pos, state))
{ {

View file

@ -14,9 +14,9 @@ import common.tileentity.TileEntity;
import common.tileentity.TileEntityEnchantmentTable; import common.tileentity.TileEntityEnchantmentTable;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class BlockEnchantmentTable extends BlockContainer public class BlockEnchantmentTable extends BlockContainer
{ {
@ -43,7 +43,7 @@ public class BlockEnchantmentTable extends BlockContainer
return false; return false;
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
super.randomDisplayTick(worldIn, pos, state, rand); super.randomDisplayTick(worldIn, pos, state, rand);

View file

@ -9,7 +9,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockFalling extends Block public class BlockFalling extends Block
{ {
@ -26,7 +26,7 @@ public class BlockFalling extends Block
super(materialIn); super(materialIn);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
} }
@ -39,7 +39,7 @@ public class BlockFalling extends Block
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(/* !worldIn.client && */ Config.blockGravity) if(/* !worldIn.client && */ Config.blockGravity)
this.checkFallable(worldIn, pos); this.checkFallable(worldIn, pos);

View file

@ -18,7 +18,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockFarmland extends Block public class BlockFarmland extends Block
{ {
@ -51,7 +51,7 @@ public class BlockFarmland extends Block
return false; return false;
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
int i = ((Integer)state.getValue(MOISTURE)).intValue(); int i = ((Integer)state.getValue(MOISTURE)).intValue();

View file

@ -21,10 +21,10 @@ import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.world.IBlockAccess; import common.world.IBlockAccess;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockFire extends Block public class BlockFire extends Block
{ {
@ -115,7 +115,7 @@ public class BlockFire extends Block
return 30; return 30;
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (Config.fire) if (Config.fire)
{ {
@ -350,7 +350,7 @@ public class BlockFire extends Block
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if ( // (worldIn.dimension.getDimensionId() < -1 || worldIn.dimension.getDimensionId() > 0) || if ( // (worldIn.dimension.getDimensionId() < -1 || worldIn.dimension.getDimensionId() > 0) ||
!Blocks.portal.tryIgnitePortal(worldIn, pos, worldIn.rand.zrange(8))) !Blocks.portal.tryIgnitePortal(worldIn, pos, worldIn.rand.zrange(8)))
@ -366,7 +366,7 @@ public class BlockFire extends Block
} }
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if (rand.chance(24)) if (rand.chance(24))
{ {

View file

@ -16,9 +16,9 @@ import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class BlockFloorPortal extends Block public class BlockFloorPortal extends Block
{ {
@ -90,7 +90,7 @@ public class BlockFloorPortal extends Block
entityIn.setFlatPortal(); entityIn.setFlatPortal();
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
double d0 = (double)((float)pos.getX() + rand.floatv()); double d0 = (double)((float)pos.getX() + rand.floatv());
double d1 = (double)((float)pos.getY() + 0.8F); double d1 = (double)((float)pos.getY() + 0.8F);

View file

@ -19,7 +19,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Identifyable; import common.util.Identifyable;
import common.world.State; import common.world.State;
import common.world.WorldServer; import common.world.AWorldServer;
public abstract class BlockFlower extends BlockBush public abstract class BlockFlower extends BlockBush
{ {
@ -31,7 +31,7 @@ public abstract class BlockFlower extends BlockBush
// this.setTickRandomly(); // this.setTickRandomly();
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(Config.flowerDry && worldIn.getTemperatureC(pos) >= 50.0f) if(Config.flowerDry && worldIn.getTemperatureC(pos) >= 50.0f)
{ {

View file

@ -18,7 +18,7 @@ import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockFlowerPot extends Block // Container public class BlockFlowerPot extends Block // Container
{ {
@ -242,7 +242,7 @@ public class BlockFlowerPot extends Block // Container
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
int type = state.getValue(CONTENTS); int type = state.getValue(CONTENTS);
if(type > 0) if(type > 0)

View file

@ -20,10 +20,10 @@ import common.tileentity.TileEntity;
import common.tileentity.TileEntityFurnace; import common.tileentity.TileEntityFurnace;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockFurnace extends BlockContainer public class BlockFurnace extends BlockContainer
{ {
@ -46,7 +46,7 @@ public class BlockFurnace extends BlockContainer
return ItemRegistry.getItemFromBlock(Blocks.furnace); return ItemRegistry.getItemFromBlock(Blocks.furnace);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
this.setDefaultFacing(worldIn, pos, state); this.setDefaultFacing(worldIn, pos, state);
} }
@ -83,7 +83,7 @@ public class BlockFurnace extends BlockContainer
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if (this.isBurning) if (this.isBurning)
{ {
@ -199,7 +199,7 @@ public class BlockFurnace extends BlockContainer
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (!keepInventory) if (!keepInventory)
{ {

View file

@ -16,7 +16,7 @@ import common.util.BlockPos;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockGrass extends Block implements IGrowable public class BlockGrass extends Block implements IGrowable
{ {
@ -56,7 +56,7 @@ public class BlockGrass extends Block implements IGrowable
return Colorizer.getGrassColor(worldIn, pos); return Colorizer.getGrassColor(worldIn, pos);
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {
@ -111,7 +111,7 @@ public class BlockGrass extends Block implements IGrowable
return true; return true;
} }
public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{ {
BlockPos blockpos = pos.up(); BlockPos blockpos = pos.up();

View file

@ -26,7 +26,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockHopper extends BlockContainer public class BlockHopper extends BlockContainer
{ {
@ -165,7 +165,7 @@ public class BlockHopper extends BlockContainer
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
this.updateState(worldIn, pos, state); this.updateState(worldIn, pos, state);
} }
@ -208,7 +208,7 @@ public class BlockHopper extends BlockContainer
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);

View file

@ -14,7 +14,7 @@ import common.util.BlockPos;
import common.world.LightType; import common.world.LightType;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockIce extends BlockBreakable public class BlockIce extends BlockBreakable
{ {
@ -71,7 +71,7 @@ public class BlockIce extends BlockBreakable
return 0; return 0;
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (Config.iceMelt && ((worldIn.getLightFor(LightType.BLOCK, pos) > 11 - this.getLightOpacity()) || !worldIn.canFreezeAt(pos))) if (Config.iceMelt && ((worldIn.getLightFor(LightType.BLOCK, pos) > 11 - this.getLightOpacity()) || !worldIn.canFreezeAt(pos)))
{ {

View file

@ -24,10 +24,10 @@ import common.rng.Random;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockLeaves extends BlockLeavesBase public class BlockLeaves extends BlockLeavesBase
{ {
@ -67,7 +67,7 @@ public class BlockLeaves extends BlockLeavesBase
// return BiomeColorHelper.getFoliageColorAtPos(worldIn, pos); // return BiomeColorHelper.getFoliageColorAtPos(worldIn, pos);
// } // }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
int i = 1; int i = 1;
int j = i + 1; int j = i + 1;
@ -96,7 +96,7 @@ public class BlockLeaves extends BlockLeavesBase
} }
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(Config.seasonLeaves && state.getValue(TYPE) != worldIn.getLeavesGen(pos)) { if(Config.seasonLeaves && state.getValue(TYPE) != worldIn.getLeavesGen(pos)) {
worldIn.setState(pos, state.withProperty(TYPE, worldIn.getLeavesGen(pos)), 2); worldIn.setState(pos, state.withProperty(TYPE, worldIn.getLeavesGen(pos)), 2);
@ -213,7 +213,7 @@ public class BlockLeaves extends BlockLeavesBase
// } // }
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if (worldIn.isRainingAt(pos.up(), true) && !worldIn.isBlockSolid(pos.down()) && rand.chance(15)) // == 1 if (worldIn.isRainingAt(pos.up(), true) && !worldIn.isBlockSolid(pos.down()) && rand.chance(15)) // == 1
{ {

View file

@ -18,7 +18,7 @@ import common.util.Identifyable;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockLever extends Block public class BlockLever extends Block
{ {
@ -215,7 +215,7 @@ public class BlockLever extends Block
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (((Boolean)state.getValue(POWERED)).booleanValue()) if (((Boolean)state.getValue(POWERED)).booleanValue())
{ {

View file

@ -20,10 +20,10 @@ import common.util.Facing;
import common.util.Vec3; import common.util.Vec3;
import common.world.IBlockAccess; import common.world.IBlockAccess;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public abstract class BlockLiquid extends Block public abstract class BlockLiquid extends Block
{ {
@ -234,7 +234,7 @@ public abstract class BlockLiquid extends Block
return this.opaque ? BlockLayer.SOLID : BlockLayer.TRANSLUCENT; return this.opaque ? BlockLayer.SOLID : BlockLayer.TRANSLUCENT;
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
double d0 = (double)pos.getX(); double d0 = (double)pos.getX();
double d1 = (double)pos.getY(); double d1 = (double)pos.getY();
@ -302,7 +302,7 @@ public abstract class BlockLiquid extends Block
return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D : ExtMath.atan2(vec3.zCoord, vec3.xCoord) - (Math.PI / 2D); return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D : ExtMath.atan2(vec3.zCoord, vec3.xCoord) - (Math.PI / 2D);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
this.checkForMixing(worldIn, pos, state); this.checkForMixing(worldIn, pos, state);
} }

View file

@ -13,7 +13,7 @@ import common.util.Facing;
import common.util.Identifyable; import common.util.Identifyable;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockLog extends BlockRotatedPillar public class BlockLog extends BlockRotatedPillar
{ {
@ -28,7 +28,7 @@ public class BlockLog extends BlockRotatedPillar
this.setStepSound(SoundType.WOOD); this.setStepSound(SoundType.WOOD);
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
int i = 4; int i = 4;
int j = i + 1; int j = i + 1;

View file

@ -13,7 +13,7 @@ import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public abstract class BlockMachine extends BlockDirectional implements ITileEntityProvider { public abstract class BlockMachine extends BlockDirectional implements ITileEntityProvider {
public BlockMachine() { public BlockMachine() {
@ -25,7 +25,7 @@ public abstract class BlockMachine extends BlockDirectional implements ITileEnti
public abstract TileEntity createNewTileEntity(World worldIn, int meta); public abstract TileEntity createNewTileEntity(World worldIn, int meta);
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) { public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) {
this.updateState(worldIn, pos, state); this.updateState(worldIn, pos, state);
} }
@ -54,7 +54,7 @@ public abstract class BlockMachine extends BlockDirectional implements ITileEnti
// } // }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) { public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);
if(tileentity instanceof TileEntityMachine) { if(tileentity instanceof TileEntityMachine) {
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMachine)tileentity); InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMachine)tileentity);

View file

@ -8,7 +8,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.foliage.WorldGenBigMushroom; import common.worldgen.foliage.WorldGenBigMushroom;
@ -21,7 +21,7 @@ public class BlockMushroom extends BlockBush implements IGrowable
this.setTickRandomly(); this.setTickRandomly();
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (Config.shroomGrowth > 0 && rand.chance(Config.shroomGrowth)) if (Config.shroomGrowth > 0 && rand.chance(Config.shroomGrowth))
{ {
@ -86,7 +86,7 @@ public class BlockMushroom extends BlockBush implements IGrowable
} }
} }
public boolean generateBigMushroom(WorldServer worldIn, BlockPos pos, State state, Random rand) public boolean generateBigMushroom(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
worldIn.setBlockToAir(pos); worldIn.setBlockToAir(pos);
FeatureGenerator worldgenerator = null; FeatureGenerator worldgenerator = null;
@ -124,7 +124,7 @@ public class BlockMushroom extends BlockBush implements IGrowable
return (double)rand.floatv() < 0.4D; return (double)rand.floatv() < 0.4D;
} }
public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{ {
this.generateBigMushroom(worldIn, pos, state, rand); this.generateBigMushroom(worldIn, pos, state, rand);
} }

View file

@ -13,9 +13,9 @@ import common.properties.PropertyBool;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockMycelium extends Block public class BlockMycelium extends Block
{ {
@ -39,7 +39,7 @@ public class BlockMycelium extends Block
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {
@ -68,7 +68,7 @@ public class BlockMycelium extends Block
// } // }
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
super.randomDisplayTick(worldIn, pos, state, rand); super.randomDisplayTick(worldIn, pos, state, rand);

View file

@ -11,7 +11,7 @@ import common.util.BlockPos;
import common.world.Explosion; import common.world.Explosion;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockNuke extends Block public class BlockNuke extends Block
{ {
@ -21,7 +21,7 @@ public class BlockNuke extends Block
this.setTab(CheatTab.tabTech); this.setTab(CheatTab.tabTech);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockAdded(worldIn, pos, state); super.onBlockAdded(worldIn, pos, state);

View file

@ -26,7 +26,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockPistonBase extends Block public class BlockPistonBase extends Block
{ {
@ -291,7 +291,7 @@ public class BlockPistonBase extends Block
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (!worldIn.client && worldIn.getTileEntity(pos) == null) if (!worldIn.client && worldIn.getTileEntity(pos) == null)
{ {

View file

@ -22,7 +22,7 @@ import common.util.Identifyable;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockPistonHead extends Block public class BlockPistonHead extends Block
{ {
@ -59,7 +59,7 @@ public class BlockPistonHead extends Block
// super.onBlockHarvested(worldIn, pos, state, player); // super.onBlockHarvested(worldIn, pos, state, player);
// } // }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite(); Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite();

View file

@ -18,7 +18,7 @@ import common.util.Vec3;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockPistonMoving extends BlockContainer public class BlockPistonMoving extends BlockContainer
{ {
@ -45,7 +45,7 @@ public class BlockPistonMoving extends BlockContainer
return new TileEntityPiston(state, facing, extending, renderHead); return new TileEntityPiston(state, facing, extending, renderHead);
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);

View file

@ -19,9 +19,9 @@ import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.util.Facing.Axis; import common.util.Facing.Axis;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient;
public class BlockPortal extends BlockBreakable public class BlockPortal extends BlockBreakable
{ {
@ -37,7 +37,7 @@ public class BlockPortal extends BlockBreakable
// this.setTickRandomly(); // this.setTickRandomly();
} }
// public void updateTick(WorldServer worldIn, BlockPos pos, IBlockState state, Random rand) // public void updateTick(IWorldServer worldIn, BlockPos pos, IBlockState state, Random rand)
// { // {
//// super.updateTick(worldIn, pos, state, rand); //// super.updateTick(worldIn, pos, state, rand);
// //
@ -208,7 +208,7 @@ public class BlockPortal extends BlockBreakable
} }
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
// if (rand.chance(100)) // if (rand.chance(100))
// { // {

View file

@ -34,7 +34,7 @@ public class BlockPumpkin extends BlockDirectional
this.setTab(CheatTab.tabPlants); this.setTab(CheatTab.tabPlants);
} }
// public void onBlockAdded(WorldServer worldIn, BlockPos pos, IBlockState state) // public void onBlockAdded(IWorldServer worldIn, BlockPos pos, IBlockState state)
// { // {
// super.onBlockAdded(worldIn, pos, state); // super.onBlockAdded(worldIn, pos, state);
// this.trySpawnGolem(worldIn, pos); // this.trySpawnGolem(worldIn, pos);

View file

@ -20,7 +20,7 @@ import common.util.Vec3;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public abstract class BlockRailBase extends Block public abstract class BlockRailBase extends Block
{ {
@ -92,7 +92,7 @@ public abstract class BlockRailBase extends Block
return worldIn.isBlockSolid(pos.down()); return worldIn.isBlockSolid(pos.down());
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (!worldIn.client) if (!worldIn.client)
{ {
@ -168,7 +168,7 @@ public abstract class BlockRailBase extends Block
return BlockLayer.CUTOUT; return BlockLayer.CUTOUT;
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);

View file

@ -19,7 +19,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockRailDetector extends BlockRailBase public class BlockRailDetector extends BlockRailBase
{ {
@ -72,11 +72,11 @@ public class BlockRailDetector extends BlockRailBase
/** /**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/ */
public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{ {
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (/* !worldIn.client && */ ((Boolean)state.getValue(POWERED)).booleanValue()) if (/* !worldIn.client && */ ((Boolean)state.getValue(POWERED)).booleanValue())
{ {
@ -129,7 +129,7 @@ public class BlockRailDetector extends BlockRailBase
worldIn.updateComparatorOutputLevel(pos, this); worldIn.updateComparatorOutputLevel(pos, this);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockAdded(worldIn, pos, state); super.onBlockAdded(worldIn, pos, state);
this.updatePoweredState(worldIn, pos, state); this.updatePoweredState(worldIn, pos, state);

View file

@ -21,7 +21,7 @@ import common.util.Identifyable;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider
{ {
@ -176,7 +176,7 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile
protected void updateState(World worldIn, BlockPos pos, State state) protected void updateState(World worldIn, BlockPos pos, State state)
{ {
if (worldIn.client || !((WorldServer)worldIn).isBlockTickPending(pos, this)) if (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this))
{ {
int i = this.calculateOutput(worldIn, pos, state); int i = this.calculateOutput(worldIn, pos, state);
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);
@ -187,12 +187,12 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile
if (this.isFacingTowardsRepeater(worldIn, pos, state)) if (this.isFacingTowardsRepeater(worldIn, pos, state))
{ {
if(!worldIn.client) if(!worldIn.client)
((WorldServer)worldIn).updateBlockTick(pos, this, 2, -1); ((AWorldServer)worldIn).updateBlockTick(pos, this, 2, -1);
} }
else else
{ {
if(!worldIn.client) if(!worldIn.client)
((WorldServer)worldIn).updateBlockTick(pos, this, 2, 0); ((AWorldServer)worldIn).updateBlockTick(pos, this, 2, 0);
} }
} }
} }
@ -229,7 +229,7 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile
} }
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (this.isRepeaterPowered) if (this.isRepeaterPowered)
{ {
@ -239,13 +239,13 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile
this.onStateChange(worldIn, pos, state); this.onStateChange(worldIn, pos, state);
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockAdded(worldIn, pos, state); super.onBlockAdded(worldIn, pos, state);
worldIn.setTileEntity(pos, this.createNewTileEntity(worldIn, 0)); worldIn.setTileEntity(pos, this.createNewTileEntity(worldIn, 0));
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
worldIn.removeTileEntity(pos); worldIn.removeTileEntity(pos);

View file

@ -11,7 +11,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public abstract class BlockRedstoneDiode extends BlockDirectional public abstract class BlockRedstoneDiode extends BlockDirectional
{ {
@ -43,11 +43,11 @@ public abstract class BlockRedstoneDiode extends BlockDirectional
/** /**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/ */
public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{ {
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (!this.isLocked(worldIn, pos, state)) if (!this.isLocked(worldIn, pos, state))
{ {
@ -116,7 +116,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional
{ {
boolean flag = this.shouldBePowered(worldIn, pos, state); boolean flag = this.shouldBePowered(worldIn, pos, state);
if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && (worldIn.client || !((WorldServer)worldIn).isBlockTickPending(pos, this))) if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this)))
{ {
int i = -1; int i = -1;
@ -130,7 +130,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional
} }
if(!worldIn.client) if(!worldIn.client)
((WorldServer)worldIn).updateBlockTick(pos, this, this.getDelay(state), i); ((AWorldServer)worldIn).updateBlockTick(pos, this, this.getDelay(state), i);
} }
} }
} }
@ -205,7 +205,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
this.notifyNeighbors(worldIn, pos, state); this.notifyNeighbors(worldIn, pos, state);
} }

View file

@ -9,7 +9,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockRedstoneLight extends Block public class BlockRedstoneLight extends Block
{ {
@ -26,7 +26,7 @@ public class BlockRedstoneLight extends Block
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (!worldIn.client) if (!worldIn.client)
{ {
@ -59,7 +59,7 @@ public class BlockRedstoneLight extends Block
} }
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {

View file

@ -14,10 +14,10 @@ import common.model.ParticleType;
import common.rng.Random; import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockRedstoneOre extends Block public class BlockRedstoneOre extends Block
{ {
@ -74,7 +74,7 @@ public class BlockRedstoneOre extends Block
} }
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (this == Blocks.lit_redstone_ore) if (this == Blocks.lit_redstone_ore)
{ {
@ -120,7 +120,7 @@ public class BlockRedstoneOre extends Block
} }
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if (this.isOn) if (this.isOn)
{ {

View file

@ -15,10 +15,10 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockRedstoneRepeater extends BlockRedstoneDiode public class BlockRedstoneRepeater extends BlockRedstoneDiode
{ {
@ -105,7 +105,7 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode
return isRedstoneRepeaterBlockID(blockIn); return isRedstoneRepeaterBlockID(blockIn);
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if (this.isRepeaterPowered) if (this.isRepeaterPowered)
{ {
@ -127,7 +127,7 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
this.notifyNeighbors(worldIn, pos, state); this.notifyNeighbors(worldIn, pos, state);

View file

@ -15,17 +15,17 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockRedstoneTorch extends BlockTorch public class BlockRedstoneTorch extends BlockTorch
{ {
private static Map<World, List<BlockRedstoneTorch.Toggle>> toggles = Maps.<World, List<BlockRedstoneTorch.Toggle>>newHashMap(); private static Map<World, List<BlockRedstoneTorch.Toggle>> toggles = Maps.<World, List<BlockRedstoneTorch.Toggle>>newHashMap();
private final boolean isOn; private final boolean isOn;
private boolean isBurnedOut(WorldServer worldIn, BlockPos pos, boolean turnOff) private boolean isBurnedOut(AWorldServer worldIn, BlockPos pos, boolean turnOff)
{ {
if (!toggles.containsKey(worldIn)) if (!toggles.containsKey(worldIn))
{ {
@ -74,7 +74,7 @@ public class BlockRedstoneTorch extends BlockTorch
return 2; return 2;
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (this.isOn) if (this.isOn)
{ {
@ -85,7 +85,7 @@ public class BlockRedstoneTorch extends BlockTorch
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (this.isOn) if (this.isOn)
{ {
@ -110,11 +110,11 @@ public class BlockRedstoneTorch extends BlockTorch
/** /**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/ */
public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{ {
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
boolean flag = this.shouldBeOff(worldIn, pos, state); boolean flag = this.shouldBeOff(worldIn, pos, state);
List<BlockRedstoneTorch.Toggle> list = (List)toggles.get(worldIn); List<BlockRedstoneTorch.Toggle> list = (List)toggles.get(worldIn);
@ -187,7 +187,7 @@ public class BlockRedstoneTorch extends BlockTorch
return true; return true;
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
if (this.isOn) if (this.isOn)
{ {

View file

@ -26,10 +26,10 @@ import common.util.Facing;
import common.util.Identifyable; import common.util.Identifyable;
import common.world.IBlockAccess; import common.world.IBlockAccess;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldClient; import common.world.AWorldServer;
import common.world.WorldServer;
public class BlockRedstoneWire extends Block public class BlockRedstoneWire extends Block
{ {
@ -540,7 +540,7 @@ public class BlockRedstoneWire extends Block
} }
} }
public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (!worldIn.client) if (!worldIn.client)
{ {
@ -572,7 +572,7 @@ public class BlockRedstoneWire extends Block
} }
} }
public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
@ -773,7 +773,7 @@ public class BlockRedstoneWire extends Block
return -16777216 | i << 16 | j << 8 | k; return -16777216 | i << 16 | j << 8 | k;
} }
public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{ {
int i = ((Integer)state.getValue(POWER)).intValue(); int i = ((Integer)state.getValue(POWER)).intValue();

View file

@ -17,7 +17,7 @@ import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
public class BlockReed extends Block public class BlockReed extends Block
{ {
@ -32,7 +32,7 @@ public class BlockReed extends Block
this.setTickRandomly(); this.setTickRandomly();
} }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(Config.reedDry && worldIn.getTemperatureC(pos) >= 50.0f) if(Config.reedDry && worldIn.getTemperatureC(pos) >= 50.0f)
{ {

View file

@ -15,7 +15,7 @@ import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.WorldServer; import common.world.AWorldServer;
import common.worldgen.FeatureGenerator; import common.worldgen.FeatureGenerator;
import common.worldgen.tree.WorldGenBaseTree; import common.worldgen.tree.WorldGenBaseTree;
import common.worldgen.tree.WorldGenBigTree; import common.worldgen.tree.WorldGenBigTree;
@ -52,7 +52,7 @@ public class BlockSapling extends BlockBush implements IGrowable
// return I18n.translate(this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name"); // return I18n.translate(this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name");
// } // }
public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if(Config.saplingDry && worldIn.getTemperatureC(pos) >= 50.0f) if(Config.saplingDry && worldIn.getTemperatureC(pos) >= 50.0f)
{ {
@ -71,7 +71,7 @@ public class BlockSapling extends BlockBush implements IGrowable
// } // }
} }
public void grow(WorldServer worldIn, BlockPos pos, State state, Random rand) public void grow(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
if (((Integer)state.getValue(STAGE)).intValue() == 0) if (((Integer)state.getValue(STAGE)).intValue() == 0)
{ {
@ -83,7 +83,7 @@ public class BlockSapling extends BlockBush implements IGrowable
} }
} }
public void generateTree(WorldServer worldIn, BlockPos pos, State state, Random rand) public void generateTree(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{ {
WoodType type = state.getBlock() instanceof BlockSapling ? ((BlockSapling)state.getBlock()).type : WoodType.OAK; WoodType type = state.getBlock() instanceof BlockSapling ? ((BlockSapling)state.getBlock()).type : WoodType.OAK;
State log = type == WoodType.CHERRY ? Blocks.cherry_log.getState() : // .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.CHERRY) : State log = type == WoodType.CHERRY ? Blocks.cherry_log.getState() : // .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.CHERRY) :
@ -264,7 +264,7 @@ public class BlockSapling extends BlockBush implements IGrowable
return (double)worldIn.rand.floatv() < 0.45D; return (double)worldIn.rand.floatv() < 0.45D;
} }
public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
{ {
this.grow(worldIn, pos, state, rand); this.grow(worldIn, pos, state, rand);
} }

View file

@ -94,7 +94,7 @@ public class BlockSign extends BlockContainer
// return true; // return true;
// } // }
// public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) // public void onBlockRemoved(IWorldServer worldIn, BlockPos pos, State state)
// { // {
// if(!worldIn.client) { // if(!worldIn.client) {
// TileEntity tileentity = worldIn.getTileEntity(pos); // TileEntity tileentity = worldIn.getTileEntity(pos);

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