Revert "Revert "add windows support (untested)""

This reverts commit 2158a700f4.
This commit is contained in:
Sen 2025-05-12 18:47:43 +02:00
parent 2158a700f4
commit 541b9cc461
28 changed files with 379 additions and 351 deletions

View file

@ -30,6 +30,7 @@ import java.util.concurrent.FutureTask;
import java.util.function.Function;
import javax.imageio.ImageIO;
import javax.swing.JFileChooser;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
@ -341,8 +342,8 @@ public class Client implements IThreadListener, IClient {
private BufferedImage skin;
private Object popupTarget;
public PlayerController controller;
public WorldClient theWorld;
public EntityNPC thePlayer;
public WorldClient world;
public EntityNPC player;
public HitPosition pointed;
@Variable(name = "chunk_view_distance", category = CVarCategory.RENDER, min = 2, max = 16 /* 128 */, callback = DistanceFunction.class, display = "Sichtweite", unit = "Chunks")
@ -519,8 +520,8 @@ public class Client implements IThreadListener, IClient {
this.charEditor = false;
this.viewEntity = null;
this.connection = null;
this.theWorld = null;
this.thePlayer = null;
this.world = null;
this.player = null;
this.serverInfo = null;
this.lastTickTime = -1;
this.soundManager.stopSounds();
@ -573,7 +574,7 @@ public class Client implements IThreadListener, IClient {
this.renderGlobal = new RenderGlobal(this);
this.renderGlobal.onReload();
EntityTexManager.loadNpcTextures();
this.effectRenderer = new EffectRenderer(this.theWorld, this.textureManager);
this.effectRenderer = new EffectRenderer(this.world, this.textureManager);
}
public void start()
@ -643,7 +644,7 @@ public class Client implements IThreadListener, IClient {
if (this.keyBindsHotbar[l].isPressed())
{
// if(!this.showDebugProfilerChart) {
this.thePlayer.inventory.currentItem = l;
this.player.inventory.currentItem = l;
// }
}
}
@ -654,7 +655,7 @@ public class Client implements IThreadListener, IClient {
if (Bind.THROW.isPressed())
{
this.thePlayer.dropOneItem(this.ctrl());
this.player.dropOneItem(this.ctrl());
}
this.primary |= Bind.PRIMARY.isPressed();
@ -671,7 +672,7 @@ public class Client implements IThreadListener, IClient {
}
// this.ingameGui.updateTick();
this.entityRenderer.getMouseOver(1.0F);
if (/* !this.paused && */ this.theWorld != null)
if (/* !this.paused && */ this.world != null)
{
this.controller.updateController();
}
@ -681,9 +682,9 @@ public class Client implements IThreadListener, IClient {
this.open.updateScreen();
}
if (this.open == null && this.thePlayer != null)
if (this.open == null && this.player != null)
{
if (this.thePlayer.getHealth() <= 0)
if (this.player.getHealth() <= 0)
{
this.displayGuiScreen(null);
}
@ -698,12 +699,12 @@ public class Client implements IThreadListener, IClient {
--this.leftClickCounter;
}
if (this.open == null && this.thePlayer != null) {
if (this.thePlayer.isUsingItem())
if (this.open == null && this.player != null) {
if (this.player.isUsingItem())
{
if (!Bind.SECONDARY.isDown())
{
this.controller.onStoppedUsingItem(this.thePlayer);
this.controller.onStoppedUsingItem(this.player);
}
}
else
@ -729,7 +730,7 @@ public class Client implements IThreadListener, IClient {
}
}
if (Bind.SECONDARY.isDown() && this.rightClickTimer == 0 && !this.thePlayer.isUsingItem())
if (Bind.SECONDARY.isDown() && this.rightClickTimer == 0 && !this.player.isUsingItem())
{
this.secondary();
}
@ -739,30 +740,30 @@ public class Client implements IThreadListener, IClient {
this.primary = this.secondary = this.tertiary = this.quarternary = false;
if (this.theWorld != null)
if (this.world != null)
{
if (this.thePlayer != null)
if (this.player != null)
{
++this.chunkLoadTimer;
if (this.chunkLoadTimer == 30)
{
this.chunkLoadTimer = 0;
this.theWorld.ensureAreaLoaded(this.thePlayer);
this.world.ensureAreaLoaded(this.player);
}
}
this.entityRenderer.updateRenderer();
this.renderGlobal.updateClouds();
this.theWorld.decrLightning();
this.theWorld.updateEntities();
this.world.decrLightning();
this.world.updateEntities();
}
this.soundManager.update();
if (this.theWorld != null)
if (this.world != null)
{
this.theWorld.tick();
if (/* !this.paused && */ this.theWorld != null)
this.world.tick();
if (/* !this.paused && */ this.world != null)
{
this.theWorld.displayTick(ExtMath.floord(this.thePlayer.posX), ExtMath.floord(this.thePlayer.posY), ExtMath.floord(this.thePlayer.posZ));
this.world.displayTick(ExtMath.floord(this.player.posX), ExtMath.floord(this.player.posY), ExtMath.floord(this.player.posZ));
}
this.effectRenderer.updateEffects();
}
@ -782,18 +783,18 @@ public class Client implements IThreadListener, IClient {
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE); // GL_FRONT_AND_BACK, GL_LINE
}
if(this.open == null) {
if(this.thePlayer != null)
this.thePlayer.setAngles(this.deltaX, this.deltaY);
if(this.player != null)
this.player.setAngles(this.deltaX, this.deltaY);
this.deltaX = this.deltaY = 0.0f;
}
if(this.thePlayer != null)
this.soundManager.setListener(this.thePlayer, (float)Timing.tick_fraction);
if(this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock())
if(this.player != null)
this.soundManager.setListener(this.player, (float)Timing.tick_fraction);
if(this.player != null && this.player.isEntityInsideOpaqueBlock())
this.thirdPersonView = 0;
GL11.glPushMatrix();
GL11.glClear(16640);
GlState.enableTexture2D();
if(this.theWorld != null)
if(this.world != null)
this.entityRenderer.renderWorld((float)Timing.tick_fraction, System.nanoTime() - this.tickStart);
GL11.glPopMatrix();
@ -825,7 +826,7 @@ public class Client implements IThreadListener, IClient {
public void renderHud() {
this.setupOverlay();
if(this.theWorld != null && this.open == null && this.thirdPersonView == 0 && this.viewEntity != null) {
if(this.world != null && this.open == null && this.thirdPersonView == 0 && this.viewEntity != null) {
if(this.drawDebug) {
this.renderWorldDirections((float)Timing.tick_fraction);
}
@ -834,7 +835,7 @@ public class Client implements IThreadListener, IClient {
Drawing.drawRect(this.fb_x / 2 - 16, this.fb_y / 2 - 1, 32, 2, this.pointed != null && this.pointed.type != ObjectType.MISS ? 0xffffffff : 0xffcfcfcf);
}
}
if(this.theWorld != null && this.open == null) {
if(this.world != null && this.open == null) {
int selected = // this.getRenderViewEntity() != null && this.getRenderViewEntity().isPlayer() ? 9 : 0,
this.getRenderViewEntity() != null && this.getRenderViewEntity().isPlayer() ?
((EntityNPC)this.getRenderViewEntity()).inventory.currentItem : -1;
@ -845,12 +846,12 @@ public class Client implements IThreadListener, IClient {
Drawing.drawRectBorder(x - 1, y - 1, 36, 36, 0xff6f6f6f, selected == n ? 0xffffffff : 0xff000000, 0xffafafaf, 0xff4f4f4f);
}
ItemStack itemstack = this.thePlayer != null ? this.thePlayer.inventory.getCurrentItem() : null;
String current = itemstack != null ? itemstack.getItem().getHotbarText(this.thePlayer, itemstack) : "";
ItemStack itemstack = this.player != null ? this.player.inventory.getCurrentItem() : null;
String current = itemstack != null ? itemstack.getItem().getHotbarText(this.player, itemstack) : "";
if(!current.isEmpty())
Drawing.drawTextUpward(current, this.fb_x / 2, this.fb_y - 60, 0xffffffff);
}
if(this.theWorld != null && !(this.open instanceof GuiConsole)) {
if(this.world != null && !(this.open instanceof GuiConsole)) {
int x = this.fb_x / 2;
int y = 0;
Iterator<Entry<Integer, Long>> iter = this.bars.entrySet().iterator();
@ -858,7 +859,7 @@ public class Client implements IThreadListener, IClient {
while(iter.hasNext()) {
Entry<Integer, Long> status = iter.next();
Entity ent;
if(this.thePlayer != null && now - status.getValue() < 10000L && (ent = this.thePlayer.worldObj.getEntityByID(status.getKey())) instanceof EntityLiving) {
if(this.player != null && now - status.getValue() < 10000L && (ent = this.player.worldObj.getEntityByID(status.getKey())) instanceof EntityLiving) {
EntityLiving entity = (EntityLiving)ent;
String s = entity.getName() + TextColor.GRAY + " [" +
EntityLiving.getHealthColor(entity.getHealth(), entity.getMaxHealth()) +
@ -876,10 +877,10 @@ public class Client implements IThreadListener, IClient {
}
}
if(this.thePlayer != null && (!this.drawDebug || this.open != null)) {
if(this.player != null && (!this.drawDebug || this.open != null)) {
x = 40;
y = 40;
for(PotionEffect effect : this.thePlayer.getEffects()) {
for(PotionEffect effect : this.player.getEffects()) {
Potion potion = effect.getPotion();
int color = potion.getColor();
String name = (potion.isBadEffect() ? TextColor.ORANGE : TextColor.ACID) + potion.getDisplay() + PotionHelper.getPotionPotency(effect.getAmplifier());
@ -933,15 +934,15 @@ public class Client implements IThreadListener, IClient {
}
}
if(this.thePlayer != null) {
if(this.player != null) {
x = 40;
y = this.fb_y - 40 - (this.thePlayer.isRidingHorse() && this.thePlayer.getHorseJumpPower() != 0.0f ? 2 : 1) * 40;
if(this.thePlayer.isRidingHorse() && this.thePlayer.getHorseJumpPower() != 0.0f) // {
y = bar(x, y, String.format(TextColor.NEON + "Sprungkraft: " + TextColor.CYAN + "%d %%", (int)(this.thePlayer.getHorseJumpPower() * 100.0f)),
this.thePlayer.getHorseJumpPower(), 0x4040ff);
y = this.fb_y - 40 - (this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f ? 2 : 1) * 40;
if(this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f) // {
y = bar(x, y, String.format(TextColor.NEON + "Sprungkraft: " + TextColor.CYAN + "%d %%", (int)(this.player.getHorseJumpPower() * 100.0f)),
this.player.getHorseJumpPower(), 0x4040ff);
// }
// else {
y = bar(x, y, String.format(TextColor.ACID + "EXP: " + TextColor.GREEN + "Level %d, %d/%d", this.thePlayer.experienceLevel, (int)((float)this.thePlayer.xpBarCap() * this.thePlayer.experience), this.thePlayer.xpBarCap()), this.thePlayer.experience, 0x40ff40);
y = bar(x, y, String.format(TextColor.ACID + "EXP: " + TextColor.GREEN + "Level %d, %d/%d", this.player.experienceLevel, (int)((float)this.player.xpBarCap() * this.player.experience), this.player.xpBarCap()), this.player.experience, 0x40ff40);
// }
}
@ -1012,7 +1013,7 @@ public class Client implements IThreadListener, IClient {
}
if(this.open != null)
this.open.render();
else if(this.theWorld == null || this.theWorld.hasNoChunks() || this.charEditor)
else if(this.world == null || this.world.hasNoChunks() || this.charEditor)
Drawing.drawScaled(this, Gui.DIRT_BACKGROUND);
if(Bind.INFO.isDown() && (this.open == null || !(this.open.selected instanceof Textbox)))
this.drawInfo();
@ -1111,8 +1112,8 @@ public class Client implements IThreadListener, IClient {
}
if(this.cameraUsed) {
this.cameraUsed = false;
if(this.theWorld != null)
this.theWorld.setLastLightning(1, 0xffffff);
if(this.world != null)
this.world.setLastLightning(1, 0xffffff);
}
if(this.isDirty())
this.save();
@ -1139,8 +1140,8 @@ public class Client implements IThreadListener, IClient {
// }
if(this.zooming)
this.zoomLevel = ExtMath.clampf(this.zoomLevel + (dir < 0 ? -0.25f : 0.25f), 2.0f, 16.0f);
else if(this.thePlayer != null)
this.thePlayer.inventory.changeCurrentItem(dir);
else if(this.player != null)
this.player.inventory.changeCurrentItem(dir);
}
// public void resize(int width, int height)
@ -1179,8 +1180,8 @@ public class Client implements IThreadListener, IClient {
{
if(!this.refreshing)
this.waitingForFile = false;
if(this.thePlayer != null)
this.thePlayer.setScreenClosed();
if(this.player != null)
this.player.setScreenClosed();
if (this.open != null)
{
this.open.onGuiClosed();
@ -1193,7 +1194,7 @@ public class Client implements IThreadListener, IClient {
// guiScreenIn = new GuiMainMenu();
// }
// else
if (gui == null && this.theWorld != null && this.thePlayer.getHealth() <= 0)
if (gui == null && this.world != null && this.player.getHealth() <= 0)
{
gui = GuiGameOver.INSTANCE;
}
@ -1235,16 +1236,16 @@ public class Client implements IThreadListener, IClient {
this.controller.resetInteraction();
}
if (this.leftClickCounter <= 0 && !this.thePlayer.isUsingItem())
if (this.leftClickCounter <= 0 && !this.player.isUsingItem())
{
if (leftClick && this.pointed != null && this.pointed.type == HitPosition.ObjectType.BLOCK)
{
BlockPos blockpos = this.pointed.block;
if (this.theWorld.getState(blockpos).getBlock().getMaterial() != Material.air && this.controller.onPlayerDamageBlock(blockpos, this.pointed.side))
if (this.world.getState(blockpos).getBlock().getMaterial() != Material.air && this.controller.onPlayerDamageBlock(blockpos, this.pointed.side))
{
this.effectRenderer.addBlockHitEffects(blockpos, this.pointed.side);
this.thePlayer.swingItem();
this.player.swingItem();
}
}
else
@ -1260,17 +1261,17 @@ public class Client implements IThreadListener, IClient {
{
if (this.pointed == null)
{
this.thePlayer.swingItem();
this.player.swingItem();
Log.JNI.warn("Null zurückgegeben als 'hitResult', das sollte niemals passieren!");
this.leftClickCounter = 10;
}
else
{
ItemStack itemstack = this.thePlayer.inventory.getCurrentItem();
if ((this.pointed.type != ObjectType.BLOCK || this.theWorld.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.thePlayer, this.theWorld, ItemControl.PRIMARY, null))
ItemStack itemstack = this.player.inventory.getCurrentItem();
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.thePlayer.swingItem();
this.thePlayer.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.PRIMARY.ordinal()));
this.player.swingItem();
this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.PRIMARY.ordinal()));
this.leftClickCounter = 10;
return;
}
@ -1278,13 +1279,13 @@ public class Client implements IThreadListener, IClient {
switch (this.pointed.type)
{
case ENTITY:
this.thePlayer.swingItem();
this.controller.attackEntity(this.thePlayer, this.pointed.entity);
this.player.swingItem();
this.controller.attackEntity(this.player, this.pointed.entity);
break;
case BLOCK:
this.thePlayer.swingItem();
this.player.swingItem();
BlockPos blockpos = this.pointed.block;
if (this.theWorld.getState(blockpos).getBlock().getMaterial() != Material.air)
if (this.world.getState(blockpos).getBlock().getMaterial() != Material.air)
{
this.controller.clickBlock(blockpos, this.pointed.side);
break;
@ -1293,7 +1294,7 @@ public class Client implements IThreadListener, IClient {
break;
case MISS:
default:
this.thePlayer.swingItem();
this.player.swingItem();
this.leftClickCounter = 10;
}
}
@ -1306,7 +1307,7 @@ public class Client implements IThreadListener, IClient {
{
this.rightClickTimer = 4;
boolean flag = true;
ItemStack itemstack = this.thePlayer.inventory.getCurrentItem();
ItemStack itemstack = this.player.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() == Items.camera && !this.saving)
{
@ -1319,10 +1320,10 @@ public class Client implements IThreadListener, IClient {
}
else
{
if ((this.pointed.type != ObjectType.BLOCK || this.theWorld.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.thePlayer, this.theWorld, 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.thePlayer.swingItem();
this.thePlayer.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.SECONDARY.ordinal()));
this.player.swingItem();
this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.SECONDARY.ordinal()));
return;
}
@ -1334,7 +1335,7 @@ public class Client implements IThreadListener, IClient {
// flag = false;
// }
// else
if (this.controller.interactWithEntitySendPacket(this.thePlayer, this.pointed.entity))
if (this.controller.interactWithEntitySendPacket(this.player, this.pointed.entity))
{
flag = false;
}
@ -1344,14 +1345,14 @@ public class Client implements IThreadListener, IClient {
case BLOCK:
BlockPos blockpos = this.pointed.block;
if (this.theWorld.getState(blockpos).getBlock().getMaterial() != Material.air)
if (this.world.getState(blockpos).getBlock().getMaterial() != Material.air)
{
int i = itemstack != null ? itemstack.stackSize : 0;
if (this.controller.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.pointed.side, this.pointed.vec))
if (this.controller.onPlayerRightClick(this.player, this.world, itemstack, blockpos, this.pointed.side, this.pointed.vec))
{
flag = false;
this.thePlayer.swingItem();
this.player.swingItem();
}
if (itemstack == null)
@ -1361,7 +1362,7 @@ public class Client implements IThreadListener, IClient {
if (itemstack.stackSize == 0)
{
this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null;
this.player.inventory.mainInventory[this.player.inventory.currentItem] = null;
}
else if (itemstack.stackSize != i) // || this.controller.isCreative())
{
@ -1373,9 +1374,9 @@ public class Client implements IThreadListener, IClient {
if (flag)
{
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
ItemStack itemstack1 = this.player.inventory.getCurrentItem();
if (itemstack1 != null && this.controller.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
if (itemstack1 != null && this.controller.sendUseItem(this.player, this.world, itemstack1))
{
this.entityRenderer.itemRenderer.resetEquippedProgress2();
}
@ -1387,8 +1388,8 @@ public class Client implements IThreadListener, IClient {
{
if (this.pointed != null)
{
if(this.thePlayer.getHeldItem() != null && this.thePlayer.getHeldItem().getItem().onAction(this.thePlayer.getHeldItem(), this.thePlayer, this.theWorld, ItemControl.TERTIARY, null)) {
this.thePlayer.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.TERTIARY.ordinal()));
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()));
return;
}
@ -1402,14 +1403,14 @@ public class Client implements IThreadListener, IClient {
if (this.pointed.type == HitPosition.ObjectType.BLOCK)
{
BlockPos blockpos = this.pointed.block;
Block block = this.theWorld.getState(blockpos).getBlock();
Block block = this.world.getState(blockpos).getBlock();
if (block.getMaterial() == Material.air)
{
return;
}
item = block.getItem(this.theWorld, blockpos);
item = block.getItem(this.world, blockpos);
if (item == null)
{
@ -1417,7 +1418,7 @@ public class Client implements IThreadListener, IClient {
}
Block block1 = item instanceof ItemBlock && !block.isPickStrict() ? item.getBlock() : block;
meta = block1.getDamageValue(this.theWorld, blockpos);
meta = block1.getDamageValue(this.world, blockpos);
flag1 = item.getHasSubtypes();
}
else
@ -1431,11 +1432,11 @@ public class Client implements IThreadListener, IClient {
return;
}
InventoryPlayer inventoryplayer = this.thePlayer.inventory;
InventoryPlayer inventoryplayer = this.player.inventory;
inventoryplayer.setCurrentItem(item, meta, flag1);
if(this.itemCheat) {
this.thePlayer.sendQueue.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl()));
this.player.sendQueue.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl()));
}
}
}
@ -1444,8 +1445,8 @@ public class Client implements IThreadListener, IClient {
{
if (this.pointed != null)
{
if(this.thePlayer.getHeldItem() != null && this.thePlayer.getHeldItem().getItem().onAction(this.thePlayer.getHeldItem(), this.thePlayer, this.theWorld, ItemControl.QUARTERNARY, null)) {
this.thePlayer.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.QUARTERNARY.ordinal()));
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()));
return;
}
}
@ -1465,7 +1466,7 @@ public class Client implements IThreadListener, IClient {
this.viewEntity = null;
this.connection = null;
this.soundManager.stopSounds();
this.theWorld = world;
this.world = world;
if (this.renderGlobal != null)
{
@ -1477,15 +1478,15 @@ public class Client implements IThreadListener, IClient {
this.effectRenderer.clearEffects(world);
}
if (this.thePlayer == null)
if (this.player == null)
{
this.thePlayer = this.controller.createPlayerEntity(world, type);
this.thePlayer.rotYaw = -180.0F;
this.player = this.controller.createPlayerEntity(world, type);
this.player.rotYaw = -180.0F;
}
this.thePlayer.preparePlayerToSpawn();
world.spawnEntityInWorld(this.thePlayer);
this.viewEntity = this.thePlayer;
this.player.preparePlayerToSpawn();
world.spawnEntityInWorld(this.player);
this.viewEntity = this.player;
System.gc();
// SKC.loaded(true);
@ -1493,24 +1494,24 @@ public class Client implements IThreadListener, IClient {
public void setDimensionAndSpawnPlayer(int dimension, int type)
{
this.theWorld.removeAllEntities();
this.world.removeAllEntities();
int i = 0;
if (this.thePlayer != null)
if (this.player != null)
{
i = this.thePlayer.getId();
this.theWorld.removeEntity(this.thePlayer);
i = this.player.getId();
this.world.removeEntity(this.player);
}
this.viewEntity = null;
EntityNPC entityplayersp = this.thePlayer;
this.thePlayer = this.controller.createPlayerEntity(this.theWorld, type);
this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
this.viewEntity = this.thePlayer;
this.thePlayer.preparePlayerToSpawn();
this.theWorld.spawnEntityInWorld(this.thePlayer);
this.thePlayer.rotYaw = -180.0F;
this.thePlayer.setId(i);
EntityNPC entityplayersp = this.player;
this.player = this.controller.createPlayerEntity(this.world, type);
this.player.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
this.viewEntity = this.player;
this.player.preparePlayerToSpawn();
this.world.spawnEntityInWorld(this.player);
this.player.rotYaw = -180.0F;
this.player.setId(i);
// if (this.open instanceof GuiGameOver)
// {
@ -1521,7 +1522,7 @@ public class Client implements IThreadListener, IClient {
public ClientPlayer getNetHandler()
{
return this.thePlayer != null ? (ClientPlayer)this.thePlayer.sendQueue : null;
return this.player != null ? (ClientPlayer)this.player.sendQueue : null;
}
// public void setSkin(BufferedImage skin, String id, ModelType model, boolean slim)
@ -1567,8 +1568,8 @@ public class Client implements IThreadListener, IClient {
}
public void performAction(Action action) {
if(this.thePlayer != null)
this.thePlayer.sendQueue.addToSendQueue(new CPacketAction(action));
if(this.player != null)
this.player.sendQueue.addToSendQueue(new CPacketAction(action));
}
public void setBossStatus(EntityLiving entity) {
@ -1708,7 +1709,7 @@ public class Client implements IThreadListener, IClient {
String mem = String.format("JVM-Speicher: %d%% %d/%dMB", usedMem * 100L / maxMem, usedMem / 1024L / 1024L, maxMem / 1024L / 1024L)
+ "\n" +
String.format("JVM-Reserviert: %d%% %dMB", totalMem * 100L / maxMem, totalMem / 1024L / 1024L);
if(this.theWorld == null) {
if(this.world == null) {
return mem;
}
@ -1736,27 +1737,27 @@ public class Client implements IThreadListener, IClient {
Biome biome = null;
String bline;
String lline;
if(this.theWorld.isBlockLoaded(blockpos)) {
Chunk chunk = this.theWorld.getChunk(blockpos);
if(this.world.isBlockLoaded(blockpos)) {
Chunk chunk = this.world.getChunk(blockpos);
biome = chunk.getBiome(blockpos, null);
bline = "Biom: " + biome.display + " (" + biome.id + ")" + /* (this.debugHideInfo ? "" : */ (", D: " +
TextColor.stripCodes(this.theWorld.dimension.getFormattedName(false)) +
" (" + this.theWorld.dimension.getDimensionId() + ")");
TextColor.stripCodes(this.world.dimension.getFormattedName(false)) +
" (" + this.world.dimension.getDimensionId() + ")");
lline = "Licht: " + chunk.getLightSub(blockpos, 0) + " (" + chunk.getLight(LightType.SKY, blockpos) + " Himmel, "
+ chunk.getLight(LightType.BLOCK, blockpos) + " Blöcke, " + String.format(
"%.1f", this.theWorld.getSunBrightness(1.0f) * 15.0f) + " Welt), A: "
+ String.format("%.3f", this.theWorld.getCelestialAngle(1.0f));
"%.1f", this.world.getSunBrightness(1.0f) * 15.0f) + " Welt), A: "
+ String.format("%.3f", this.world.getCelestialAngle(1.0f));
}
else {
bline = "Biom: <?>, D: " +
TextColor.stripCodes(this.theWorld.dimension.getFormattedName(false)) +
" (" + this.theWorld.dimension.getDimensionId() + ")";
TextColor.stripCodes(this.world.dimension.getFormattedName(false)) +
" (" + this.world.dimension.getDimensionId() + ")";
lline = "Licht: " + String.format(
"%.1f", this.theWorld.getSunBrightness(1.0f) * 15.0f) + " Welt, A: "
+ String.format("%.3f", this.theWorld.getCelestialAngle(1.0f));
"%.1f", this.world.getSunBrightness(1.0f) * 15.0f) + " Welt, A: "
+ String.format("%.3f", this.world.getCelestialAngle(1.0f));
}
float temp = this.theWorld.getTempOffset() + (biome != null ? biome.getTemperature(blockpos) : 0.0f);
float temp = this.world.getTempOffset() + (biome != null ? biome.getTemperature(blockpos) : 0.0f);
long ticked = System.currentTimeMillis() - this.lastTicked;
return
@ -1767,8 +1768,8 @@ public class Client implements IThreadListener, IClient {
// this.connected != null ? this.connected : "[???]"))),
this.renderGlobal.getDebugInfoRenders() + "\n" +
this.renderGlobal.getDebugInfoEntities() + "\n" +
"Partikel: " + this.effectRenderer.getStatistics() + ". O: " + this.theWorld.getDebugLoadedEntities() + "\n" +
this.theWorld.getInfo() + "\n" +
"Partikel: " + this.effectRenderer.getStatistics() + ". O: " + this.world.getDebugLoadedEntities() + "\n" +
this.world.getInfo() + "\n" +
// "",
String.format("XYZ: %.3f / %.3f / %.3f", this.viewEntity.posX,
this.viewEntity.getEntityBoundingBox().minY, this.viewEntity.posZ) + "\n" +
@ -1784,21 +1785,21 @@ public class Client implements IThreadListener, IClient {
bline + "\n" +
lline + "\n" +
String.format("Zeit: %d T, R %d / %d T, U %d / %d T",
this.theWorld.getDayTime(),
this.theWorld.getDayTime() % this.theWorld.dimension.getRotationalPeriod(),
this.theWorld.dimension.getRotationalPeriod(),
this.theWorld.getDayTime() % this.theWorld.dimension.getOrbitalPeriod(),
this.theWorld.dimension.getOrbitalPeriod()
this.world.getDayTime(),
this.world.getDayTime() % this.world.dimension.getRotationalPeriod(),
this.world.dimension.getRotationalPeriod(),
this.world.getDayTime() % this.world.dimension.getOrbitalPeriod(),
this.world.dimension.getOrbitalPeriod()
) + "\n" +
String.format("Laub: %s%s, T: %.2f K / %.2f °C, %s (R %.1f, %.1f)",
!this.theWorld.dimension.getType().days ? "*" : "",
this.theWorld.getLeavesGen(blockpos).getDisplayName(),
!this.world.dimension.getType().days ? "*" : "",
this.world.getLeavesGen(blockpos).getDisplayName(),
temp, World.ABSOLUTE_ZERO + temp,
this.theWorld.getWeather().getDisplay(), this.theWorld.getRainStrength(),
this.theWorld.getDarkness()
this.world.getWeather().getDisplay(), this.world.getRainStrength(),
this.world.getDarkness()
) + "\n" +
String.format("Zeitfaktor: %dx, Schwerkraft: %.2f m/s²",
this.timeFactor, this.theWorld.gravity * 10.0
this.timeFactor, this.world.gravity * 10.0
) + "\n" +
String.format("Letzte Zeitsynch.: + %d.%d s",
ticked / 1000L, (ticked / 100L) % 10L
@ -1811,17 +1812,17 @@ public class Client implements IThreadListener, IClient {
}
public String getRight(boolean showPlayerInfo) {
if(this.theWorld == null) {
if(this.world == null) {
return null;
}
if(!showPlayerInfo && this.pointed != null && this.pointed.type == HitPosition.ObjectType.BLOCK
&& this.pointed.block != null) {
BlockPos pos = this.pointed.block;
State block = this.theWorld.getState(pos);
State block = this.world.getState(pos);
if(!this.debugWorld) {
block = block.getBlock().getActualState(block, this.theWorld, pos);
block = block.getBlock().getActualState(block, this.world, pos);
}
StringBuilder str = new StringBuilder(
@ -1841,7 +1842,7 @@ public class Client implements IThreadListener, IClient {
}
else if((this.pointed != null && this.pointed.type == HitPosition.ObjectType.ENTITY
&& this.pointed.entity != null) || showPlayerInfo) {
Entity entity = showPlayerInfo ? this.thePlayer : this.pointed.entity;
Entity entity = showPlayerInfo ? this.player : this.pointed.entity;
ItemStack held = entity instanceof EntityLiving && ((EntityLiving)entity).getHeldItem() != null ? ((EntityLiving)entity).getHeldItem() : null;
return
@ -2260,24 +2261,24 @@ public class Client implements IThreadListener, IClient {
// if(this.theWorld != null && this.open == null && Bind.COMMAND.isPressed()) {
// this.displayGuiScreen(GuiChat.INSTANCE);
// }
if(this.theWorld != null && Bind.MENU.isPressed()) {
if(this.world != null && Bind.MENU.isPressed()) {
if(this.open != (this.charEditor ? GuiChar.INSTANCE : null))
this.displayGuiScreen(this.charEditor ? GuiChar.INSTANCE : null);
else
this.displayGuiScreen(GuiMenu.INSTANCE);
}
else if(this.theWorld == null && !(this.open instanceof GuiMenu) && Bind.MENU.isPressed()) {
else if(this.world == null && !(this.open instanceof GuiMenu) && Bind.MENU.isPressed()) {
this.displayGuiScreen(GuiMenu.INSTANCE);
}
if(this.theWorld != null && !this.charEditor && Bind.INVENTORY.isPressed()) {
if(this.world != null && !this.charEditor && Bind.INVENTORY.isPressed()) {
if(this.open instanceof GuiContainer) {
this.displayGuiScreen(null);
}
else if(this.open == null) {
if(this.thePlayer.isRiding() && this.thePlayer.vehicle instanceof EntityHorse)
this.thePlayer.sendHorseInventory();
if(this.player.isRiding() && this.player.vehicle instanceof EntityHorse)
this.player.sendHorseInventory();
else
this.displayGuiScreen(/* this.itemCheat ? new GuiCheat() : */ new GuiInventory(this.thePlayer));
this.displayGuiScreen(/* this.itemCheat ? new GuiCheat() : */ new GuiInventory(this.player));
}
}
}
@ -2392,7 +2393,7 @@ public class Client implements IThreadListener, IClient {
}
public void unload(boolean loading) {
if(this.theWorld != null) {
if(this.world != null) {
if(this.getNetHandler() != null)
this.getNetHandler().getNetworkManager().closeChannel("Quitting");
this.unloadWorld();
@ -2904,7 +2905,7 @@ public class Client implements IThreadListener, IClient {
return;
}
}
if(this.thePlayer != null && this.getNetHandler() != null)
if(this.player != null && this.getNetHandler() != null)
this.getNetHandler().addToSendQueue(new CPacketMessage(line.startsWith("/") ? CPacketMessage.Type.COMMAND : CPacketMessage.Type.CHAT, line.startsWith("/") ? line.substring(1) : line));
// Log.CONSOLE.user("%s", line);
// this.command(line);
@ -3214,8 +3215,11 @@ public class Client implements IThreadListener, IClient {
this.waitingForFile = true;
new Thread(new Runnable() {
public void run() {
String output;
String output = null;
JFileChooser chooser = null;
try {
if(Util.WINDOWS)
throw new RuntimeException("Windows wird von Zenity nicht unterstützt");
List<String> list = Lists.newArrayList("zenity", "--file-selection");
switch(mode) {
case DIRECTORY_SAVE:
@ -3249,21 +3253,40 @@ public class Client implements IThreadListener, IClient {
}
}
catch(Throwable e) {
Log.SYSTEM.error(e, "Konnte Zenity nicht starten");
Client.this.logFeed(TextColor.RED + "Konnte Dateibrowser nicht öffnen");
Client.this.waitingForFile = false;
return;
Log.SYSTEM.error(e, "Konnte Dateibrowser nicht starten");
chooser = new JFileChooser(def.isDirectory() ? def : def.getParentFile());
chooser.setDialogTitle(title);
chooser.setMultiSelectionEnabled(mode == FileMode.FILE_LOAD_MULTI);
chooser.setFileSelectionMode(mode == FileMode.DIRECTORY_LOAD || mode == FileMode.DIRECTORY_SAVE ? JFileChooser.DIRECTORIES_ONLY : JFileChooser.FILES_ONLY);
int result;
if(mode == FileMode.FILE_SAVE || mode == FileMode.DIRECTORY_SAVE)
result = chooser.showSaveDialog(null);
else
result = chooser.showOpenDialog(null);
if(result != JFileChooser.APPROVE_OPTION) {
// Client.this.logFeed(TextColor.RED + "Konnte Dateibrowser nicht öffnen");
Client.this.waitingForFile = false;
return;
}
}
if(output == null) {
if(output == null && chooser == null) {
Client.this.waitingForFile = false;
return;
}
if(mode == FileMode.FILE_LOAD_MULTI) {
final List<File> files = Lists.newArrayList();
for(String out : output.split(":")) {
File file = new File(out);
if(file.isFile())
files.add(file);
if(chooser != null) {
for(File file : chooser.getSelectedFiles()) {
if(file.isFile())
files.add(file);
}
}
else {
for(String out : output.split(":")) {
File file = new File(out);
if(file.isFile())
files.add(file);
}
}
if(files.isEmpty()) {
Client.this.waitingForFile = false;
@ -3281,7 +3304,7 @@ public class Client implements IThreadListener, IClient {
});
}
else {
File file = new File(output);
File file = chooser != null ? chooser.getSelectedFile() : new File(output);
switch(mode) {
case DIRECTORY_LOAD:
if(!file.isDirectory()) {
@ -3317,12 +3340,12 @@ public class Client implements IThreadListener, IClient {
});
}
}
}, "Zenity 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.theWorld, x, y, z, motionX, motionY, motionZ, this.effectRenderer, compund));
this.effectRenderer.addEffect(new EntityFirework.StarterFX(this.world, x, y, z, motionX, motionY, motionZ, this.effectRenderer, compund));
}
public int getRenderDistance() {
@ -3346,7 +3369,7 @@ public class Client implements IThreadListener, IClient {
}
public EntityNPC getPlayer() {
return this.thePlayer;
return this.player;
}
public IEntityFX spawnEffectParticle(int particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed,

View file

@ -113,7 +113,7 @@ public class PlayerController
// }
// else
// {
World world = this.gm.theWorld;
World world = this.gm.world;
State iblockstate = world.getState(pos);
Block block1 = iblockstate.getBlock();
@ -135,15 +135,15 @@ public class PlayerController
// if (!this.creative)
// {
ItemStack itemstack1 = this.gm.thePlayer.getCurrentEquippedItem();
ItemStack itemstack1 = this.gm.player.getCurrentEquippedItem();
if (itemstack1 != null)
{
itemstack1.onBlockDestroyed(world, block1, pos, this.gm.thePlayer);
itemstack1.onBlockDestroyed(world, block1, pos, this.gm.player);
if (itemstack1.stackSize == 0)
{
this.gm.thePlayer.destroyCurrentEquippedItem();
this.gm.player.destroyCurrentEquippedItem();
}
}
// }
@ -188,8 +188,8 @@ public class PlayerController
}
else
{
ItemStack stack = this.gm.thePlayer.getHeldItem();
if(stack != null && stack.getItem().onAction(stack, this.gm.thePlayer, this.gm.theWorld, ItemControl.PRIMARY, loc)) {
ItemStack stack = this.gm.player.getHeldItem();
if(stack != null && stack.getItem().onAction(stack, this.gm.player, this.gm.world, ItemControl.PRIMARY, loc)) {
this.interacting = true;
this.netClientHandler.addToSendQueue(new CPacketBreak(CPacketBreak.Action.START_DESTROY_BLOCK, loc, face));
return true;
@ -209,15 +209,15 @@ public class PlayerController
}
this.netClientHandler.addToSendQueue(new CPacketBreak(CPacketBreak.Action.START_DESTROY_BLOCK, loc, face));
Block block1 = this.gm.theWorld.getState(loc).getBlock();
Block block1 = this.gm.world.getState(loc).getBlock();
boolean flag = block1.getMaterial() != Material.air;
if (flag && this.curBlockDamageMP == 0.0F)
{
block1.onBlockClicked(this.gm.theWorld, loc, this.gm.thePlayer);
block1.onBlockClicked(this.gm.world, loc, this.gm.player);
}
if (flag && block1.getPlayerRelativeBlockHardness(this.gm.thePlayer, this.gm.thePlayer.worldObj, loc) >= 1.0F)
if (flag && block1.getPlayerRelativeBlockHardness(this.gm.player, this.gm.player.worldObj, loc) >= 1.0F)
{
this.onPlayerDestroyBlock(loc, face);
// if(this.cheat && block1.getPlayerRelativeBlockHardness(this.gm.thePlayer, this.gm.thePlayer.worldObj, loc) < 1.0F)
@ -227,10 +227,10 @@ public class PlayerController
{
this.isHittingBlock = true;
this.currentBlock = loc;
this.currentItemHittingBlock = this.gm.thePlayer.getHeldItem();
this.currentItemHittingBlock = this.gm.player.getHeldItem();
this.curBlockDamageMP = 0.0F;
this.stepSoundTickCounter = 0.0F;
this.gm.theWorld.sendBlockBreakProgress(this.gm.thePlayer.getId(), this.currentBlock, (int)(this.curBlockDamageMP * 10.0F) - 1);
this.gm.world.sendBlockBreakProgress(this.gm.player.getId(), this.currentBlock, (int)(this.curBlockDamageMP * 10.0F) - 1);
}
}
@ -248,7 +248,7 @@ public class PlayerController
this.netClientHandler.addToSendQueue(new CPacketBreak(CPacketBreak.Action.ABORT_DESTROY_BLOCK, this.currentBlock, Facing.DOWN));
this.isHittingBlock = false;
this.curBlockDamageMP = 0.0F;
this.gm.theWorld.sendBlockBreakProgress(this.gm.thePlayer.getId(), this.currentBlock, -1);
this.gm.world.sendBlockBreakProgress(this.gm.player.getId(), this.currentBlock, -1);
}
}
@ -277,7 +277,7 @@ public class PlayerController
// }
else if (this.isHittingPosition(posBlock))
{
Block block = this.gm.theWorld.getState(posBlock).getBlock();
Block block = this.gm.world.getState(posBlock).getBlock();
if (block.getMaterial() == Material.air)
{
@ -286,7 +286,7 @@ public class PlayerController
}
else
{
this.curBlockDamageMP += block.getPlayerRelativeBlockHardness(this.gm.thePlayer, this.gm.thePlayer.worldObj, posBlock);
this.curBlockDamageMP += block.getPlayerRelativeBlockHardness(this.gm.player, this.gm.player.worldObj, posBlock);
if (this.stepSoundTickCounter % 4.0F == 0.0F && block.sound.getStepSound() != null)
{
@ -305,7 +305,7 @@ public class PlayerController
this.blockHitDelay = 5;
}
this.gm.theWorld.sendBlockBreakProgress(this.gm.thePlayer.getId(), this.currentBlock, (int)(this.curBlockDamageMP * 10.0F) - 1);
this.gm.world.sendBlockBreakProgress(this.gm.player.getId(), this.currentBlock, (int)(this.curBlockDamageMP * 10.0F) - 1);
return true;
}
}
@ -339,7 +339,7 @@ public class PlayerController
private boolean isHittingPosition(BlockPos pos)
{
ItemStack itemstack = this.gm.thePlayer.getHeldItem();
ItemStack itemstack = this.gm.player.getHeldItem();
boolean flag = this.currentItemHittingBlock == null && itemstack == null;
if (this.currentItemHittingBlock != null && itemstack != null)
@ -355,7 +355,7 @@ public class PlayerController
*/
private void syncCurrentPlayItem()
{
int i = this.gm.thePlayer.inventory.currentItem;
int i = this.gm.player.inventory.currentItem;
if (i != this.currentPlayerItem)
{

View file

@ -301,7 +301,7 @@ public abstract class Gui {
// }
public void drawMainBackground() {
if(this.gm.theWorld != null && !this.gm.charEditor) {
if(this.gm.world != null && !this.gm.charEditor) {
// Drawing.drawGradient(0, 0, this.fb_x, this.fb_y, this.theWorld == null ? this.style.bg_top : 0x3f202020,
// this.theWorld == null ? this.style.bg_btm : 0x3f000000);
Drawing.drawGradient(0, 0, this.gm.fb_x, this.gm.fb_y, 0xc0101010, 0xd0101010);

View file

@ -28,7 +28,7 @@ public class GuiConfirm extends Gui implements ActButton.Callback {
public void init(int width, int height) {
this.add(new Label(0, 0, 500, 24, this.messageLine1, true));
this.add(new TransparentBox(0, 80, 500, 300, this.messageLine2, this.gm.theWorld != null && !this.gm.charEditor));
this.add(new TransparentBox(0, 80, 500, 300, this.messageLine2, this.gm.world != null && !this.gm.charEditor));
this.confirmBtn = this.add(new ActButton(48, 500, 200, 24, this, this.confirmButtonText));
this.cancelBtn = this.add(new ActButton(252, 500, 200, 24, this, this.cancelButtonText));
this.shift();

View file

@ -55,7 +55,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
}
}, "Löschen"));
}
this.logBox = this.add(new TransparentBox(0, this.full ? 24 : 0, width, height - (this.full ? 48 : 24), this.gm.getBuffer(), this.gm.theWorld != null && !this.gm.charEditor));
this.logBox = this.add(new TransparentBox(0, this.full ? 24 : 0, width, height - (this.full ? 48 : 24), this.gm.getBuffer(), this.gm.world != null && !this.gm.charEditor));
if(this.full)
this.add(new Fill(640, 0, width - 640, 24));
this.inputField = this.add(new Textbox(0, height - 24, width, 24, IPlayer.MAX_CMD_LENGTH, true, this, ""));
@ -79,7 +79,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
}
public void drawMainBackground() {
if(this.gm.theWorld == null || this.gm.charEditor)
if(this.gm.world == null || this.gm.charEditor)
super.drawMainBackground();
}
@ -123,7 +123,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
}
this.inputField.setText("");
if((this.gm.conAutoclose || !this.full) && this.gm.theWorld != null)
if((this.gm.conAutoclose || !this.full) && this.gm.world != null)
this.gm.displayGuiScreen(null);
}
}
@ -215,7 +215,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
s = argv[argv.length - 1];
Iterable<String> res = pre.startsWith("#") ?
(argv.length == 1 ? this.gm.getVars() : (argv.length == 2 ? getVarCompletion(argv[0].substring(1)) : Lists.newArrayList())) :
(this.gm.thePlayer == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.thePlayer.sendQueue).getPlayerNames());
(this.gm.player == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.player.sendQueue).getPlayerNames());
if(argv.length == 1 && pre.startsWith("#"))
s = s.substring(1);
for(String s1 : res) {
@ -252,10 +252,10 @@ public class GuiConsole extends Gui implements Textbox.Callback {
blockpos = new BlockPos(this.gm.pointed.entity);
}
if(currentText.startsWith("/")) {
if(this.gm.thePlayer != null) {
if(this.gm.player != null) {
currentText = currentText.substring(1);
this.prefixFirst = currentText.split(" ", -1).length == 1 ? "/" : null;
this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketComplete(currentText, eid, blockpos));
this.gm.player.sendQueue.addToSendQueue(new CPacketComplete(currentText, eid, blockpos));
this.waitingOnAutocomplete = true;
}
}

View file

@ -125,7 +125,7 @@ public class GuiInfo extends Gui {
}
public void init(int width, int height) {
this.add(new TransparentBox(10, 10, width - 20, height - 44, this.info, this.gm.theWorld != null && !this.gm.charEditor));
this.add(new TransparentBox(10, 10, width - 20, height - 44, this.info, this.gm.world != null && !this.gm.charEditor));
this.add(new NavButton(0, height - 24, width, 24, GuiMenu.INSTANCE, "Zurück"));
}

View file

@ -23,7 +23,7 @@ public class GuiMenu extends Gui {
}
public void drawMainBackground() {
if(this.gm.theWorld != null)
if(this.gm.world != null)
super.drawMainBackground();
else
this.gm.renderGlobal.renderStarField(this.gm.fb_x, this.gm.fb_y, 0x000000, 0xffffff, (float)this.ticks + (float)Timing.tick_fraction, this.rand);
@ -48,7 +48,7 @@ public class GuiMenu extends Gui {
private boolean animStep;
public void init(int width, int height) {
if(this.gm.theWorld == null) {
if(this.gm.world == null) {
this.ticks = 0;
this.hacked = 0;
this.resetAnimation();
@ -120,7 +120,7 @@ public class GuiMenu extends Gui {
}
public String getTitle() {
return this.gm.theWorld == null ? "Hauptmenü" : "Menü";
return this.gm.world == null ? "Hauptmenü" : "Menü";
}
private void pickSplash() {
@ -223,7 +223,7 @@ public class GuiMenu extends Gui {
}
public void updateScreen() {
if(this.gm.theWorld == null) {
if(this.gm.world == null) {
this.ticks++;
if(this.gm.shift() && !(this.selected instanceof Textbox))
this.pickSplash();
@ -233,7 +233,7 @@ public class GuiMenu extends Gui {
public void key(Keysym key, boolean ctrl, boolean shift) {
super.key(key, ctrl, shift);
if(this.gm.theWorld == null) {
if(this.gm.world == null) {
if((key == Keysym.UP || key == Keysym.W) && (this.hacked == 0 || this.hacked == 1))
this.hacked++;
else if((key == Keysym.DOWN || key == Keysym.S) && (this.hacked == 2 || this.hacked == 3))
@ -287,7 +287,7 @@ public class GuiMenu extends Gui {
public void drawOverlays() {
super.drawOverlays();
if(this.gm.theWorld == null) {
if(this.gm.world == null) {
int y = 164;
int h = 16;
int n = Drawing.getWidth(this.splashLabel.getText());

View file

@ -74,7 +74,7 @@ public class GuiServer extends Gui implements Textbox.Callback {
}
private void connect() {
if(this.gm.theWorld != null)
if(this.gm.world != null)
return;
String name = null;
if(this.server != null) {

View file

@ -129,7 +129,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
EntityTexManager.altLayer = this.dynId;
EntityTexManager.altNpcLayer = this.dynId == -1 && this.charinfo != null ? this.charinfo.skin : null;
drawEntity(x + 32, y + 60, 28.0f
* Math.min(1.8f / GuiChar.this.gm.thePlayer.height, 1.5f / GuiChar.this.gm.thePlayer.width), -45.0f, -20.0f, GuiChar.this.gm.thePlayer);
* Math.min(1.8f / GuiChar.this.gm.player.height, 1.5f / GuiChar.this.gm.player.width), -45.0f, -20.0f, GuiChar.this.gm.player);
GuiChar.this.gm.cameraUsed = flag;
EntityTexManager.altTexture = null;
EntityTexManager.altLayer = -1;
@ -271,8 +271,8 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
this.adjust = null;
return;
}
this.currentSkin = this.gm.thePlayer != null && !EntityTexManager.hasCustomSkin(this.gm.thePlayer.getId()) ? this.gm.thePlayer.getChar() : null;
this.load(this.gm.thePlayer == null ? ModelType.HUMANOID : this.gm.thePlayer.getModel(), this.gm.thePlayer != null ? this.gm.thePlayer.getSpecies() : SpeciesRegistry.CLASSES.get(EntityHuman.class));
this.currentSkin = this.gm.player != null && !EntityTexManager.hasCustomSkin(this.gm.player.getId()) ? this.gm.player.getChar() : null;
this.load(this.gm.player == null ? ModelType.HUMANOID : this.gm.player.getModel(), this.gm.player != null ? this.gm.player.getSpecies() : SpeciesRegistry.CLASSES.get(EntityHuman.class));
this.add(new ActButton(4, 4, 194, 24, new ActButton.Callback() {
public void use(ActButton elem, Mode action) {
GuiChar.this.gm.showFileDialog(FileMode.FILE_LOAD_MULTI, "Skin konvertieren", TEXTURE_FOLDER, new FileCallback() {
@ -335,12 +335,12 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
}, "Vorlage kopieren"));
this.adjust = this.add(new DragAdjust(width / 2 - 230, height - 64 - 640, 460, 640));
this.add(new Label(width - 396, 36, 392, 20, "Spezies: " + (this.gm.thePlayer == null ? "<?>" : this.gm.thePlayer.getSpecies().name), true));
this.add(new Label(width - 396, 36, 392, 20, "Spezies: " + (this.gm.player == null ? "<?>" : this.gm.player.getSpecies().name), true));
this.add(new NavButton(width - 396, 56, 392, 24, GuiSpecies.INSTANCE, "Spezies ändern"));
this.add(new Label(width - 396, 36 + 92, 392, 20, "Klasse: " + (this.gm.thePlayer == null || this.gm.thePlayer.getSpecies().classEnum == null || this.gm.thePlayer.getNpcClass() == null || this.gm.thePlayer.getNpcClass().toString().isEmpty() ? "<Keine>" : this.gm.thePlayer.getNpcClass().toString()), true))
.enabled = this.gm.thePlayer != null && this.gm.thePlayer.getSpecies().classEnum != null;
this.add(new Label(width - 396, 36 + 92, 392, 20, "Klasse: " + (this.gm.player == null || this.gm.player.getSpecies().classEnum == null || this.gm.player.getNpcClass() == null || this.gm.player.getNpcClass().toString().isEmpty() ? "<Keine>" : this.gm.player.getNpcClass().toString()), true))
.enabled = this.gm.player != null && this.gm.player.getSpecies().classEnum != null;
this.add(new NavButton(width - 396, 56 + 92, 392, 24, GuiClass.INSTANCE, "Klasse ändern"))
.enabled = this.gm.thePlayer != null && this.gm.thePlayer.getSpecies().classEnum != null;
.enabled = this.gm.player != null && this.gm.player.getSpecies().classEnum != null;
final ActButton[] alignBtns = new ActButton[Alignment.values().length];
for (int z = 0; z < Alignment.values().length; z++)
@ -348,25 +348,25 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
final Alignment align = Alignment.values()[z];
alignBtns[z] = this.add(new ActButton(width - 396 + (z % 3) * 132, height - 32 - 28 * 3 + 28 * (z / 3), 128, 24, new ActButton.Callback() {
public void use(ActButton elem, Mode action) {
if(GuiChar.this.gm.thePlayer != null) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal()));
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal()));
for(ActButton btn : alignBtns) {
btn.enabled = btn != elem;
}
}
}
}, align.color + align.display));
alignBtns[z].enabled = this.gm.thePlayer == null || this.gm.thePlayer.getAlignment() != align;
alignBtns[z].enabled = this.gm.player == null || this.gm.player.getAlignment() != align;
}
this.add(new Slider(width / 2 - 200, height - 28, 400, 24, 1, this.gm.thePlayer == null ? 120 : this.gm.thePlayer.getMinSize(), this.gm.thePlayer == null ? 320 : this.gm.thePlayer.getMaxSize(), this.gm.thePlayer == null ? 180 : this.gm.thePlayer.getDefaultSize(), this.gm.thePlayer == null ? 180 : this.gm.thePlayer.getCurrentSize(), new Slider.Callback() {
this.add(new Slider(width / 2 - 200, height - 28, 400, 24, 1, this.gm.player == null ? 120 : this.gm.player.getMinSize(), this.gm.player == null ? 320 : this.gm.player.getMaxSize(), this.gm.player == null ? 180 : this.gm.player.getDefaultSize(), this.gm.player == null ? 180 : this.gm.player.getCurrentSize(), new Slider.Callback() {
public void use(Slider elem, int value) {
if(GuiChar.this.gm.thePlayer != null) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value));
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value));
}
}
}, "Spieler-Größe", "cm")).enabled = this.gm.thePlayer == null || this.gm.thePlayer.getMinSize() != this.gm.thePlayer.getMaxSize();
}, "Spieler-Größe", "cm")).enabled = this.gm.player == null || this.gm.player.getMinSize() != this.gm.player.getMaxSize();
this.add(new Label(width / 2 - 200, 36, 400, 20, "Name", true));
this.add(new Label(width - 396, height - 384, 392, 20, "Beschreibung", true));
final Textbox descField = this.add(new Textbox(width - 396, height - 364, 392, 130, IPlayer.MAX_INFO_LENGTH, new Textbox.Callback() {
@ -375,11 +375,11 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
}, ""));
this.add(new ActButton(width - 198, height - 28, 194, 24, new ActButton.Callback() {
public void use(ActButton elem, Mode action) {
if(GuiChar.this.gm.thePlayer != null) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.gm.displayGuiScreen(GuiLoading.makeWaitTask("Lade Welt ..."));
Dimension dim = UniverseRegistry.getBaseDimensions().get(GuiChar.this.dimension);
GuiChar.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText()));
GuiChar.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId()));
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText()));
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId()));
}
}
}, "Charakter erstellen"));
@ -388,17 +388,17 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
if(value == Action.SEND || value == Action.UNFOCUS) {
String name = elem.getText();
if(name.isEmpty())
elem.setText(GuiChar.this.gm.thePlayer == null ? "..." : GuiChar.this.gm.thePlayer.getCustomNameTag());
else if(GuiChar.this.gm.thePlayer != null) {
elem.setText(GuiChar.this.gm.player == null ? "..." : GuiChar.this.gm.player.getCustomNameTag());
else if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.DISPLAY, name));
GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.DISPLAY, name));
}
}
}
}, IPlayer.VALID_NICK, this.gm.thePlayer == null ? "" : this.gm.thePlayer.getCustomNameTag()));
}, IPlayer.VALID_NICK, this.gm.player == null ? "" : this.gm.player.getCustomNameTag()));
this.templateButton.enabled = false;
this.dimension = new Random().zrange(UniverseRegistry.getBaseDimensions().size());
EntityEggInfo egg = EntityRegistry.SPAWN_EGGS.get(this.gm.thePlayer == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.thePlayer));
EntityEggInfo egg = EntityRegistry.SPAWN_EGGS.get(this.gm.player == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.player));
if(egg != null && egg.origin != null) {
Dimension dim = UniverseRegistry.getDimension(egg.origin);
if(dim != null) {
@ -446,10 +446,10 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
public void drawOverlays()
{
if(this.adjust != null) {
float factor = this.gm.thePlayer.width > 2.15f ? 2.15f / this.gm.thePlayer.width : 1.0f;
factor = this.gm.thePlayer.height > 3.0f && 3.0f / this.gm.thePlayer.height < factor ? 3.0f / this.gm.thePlayer.height : factor;
float factor = this.gm.player.width > 2.15f ? 2.15f / this.gm.player.width : 1.0f;
factor = this.gm.player.height > 3.0f && 3.0f / this.gm.player.height < factor ? 3.0f / this.gm.player.height : factor;
drawEntity(400 + (this.gm.fb_x - 400 - 400) / 2, this.gm.fb_y - 160, 160.0f * factor
, this.yaw, this.pitch, this.gm.thePlayer);
, this.yaw, this.pitch, this.gm.player);
}
}

View file

@ -73,7 +73,7 @@ public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> impleme
if(this.gm.getNetHandler() != null) {
int initialSelection = this.gm.getNetHandler().getSelectedCharacter();
for(PlayerCharacter character : this.gm.getNetHandler().getCharacterList()) {
this.elements.add(new CharacterEntry(initialSelection == this.elements.size() ? new PlayerCharacter(character.name, character.info, character.align, this.gm.thePlayer.worldObj.dimension.getFormattedName(false), this.gm.thePlayer.getPosition(), character.type, this.gm.thePlayer.experienceLevel) : character, initialSelection == this.elements.size()));
this.elements.add(new CharacterEntry(initialSelection == this.elements.size() ? new PlayerCharacter(character.name, character.info, character.align, this.gm.player.worldObj.dimension.getFormattedName(false), this.gm.player.getPosition(), character.type, this.gm.player.experienceLevel) : character, initialSelection == this.elements.size()));
}
this.elements.add(new CharacterEntry(null, false));
this.setSelected(initialSelection);

View file

@ -21,14 +21,14 @@ public class GuiClass extends GuiList<GuiClass.ClassEntry> implements ActButton.
public void draw(int x, int y, int mouseX, int mouseY, boolean hovered)
{
if(GuiClass.this.gm.thePlayer != null && this.clazz == GuiClass.this.gm.thePlayer.getNpcClass())
if(GuiClass.this.gm.player != null && this.clazz == GuiClass.this.gm.player.getNpcClass())
Drawing.drawRect(x, y, 1, 44, 0xffaf0000);
Drawing.drawText(this.clazz.toString().isEmpty() ? "<Keine>" : this.clazz.toString(), x + 3, y, 0xffffffff);
}
public void select(boolean dclick, int mx, int my)
{
if((GuiClass.this.selectButton.enabled = GuiClass.this.gm.thePlayer == null || this.clazz != GuiClass.this.gm.thePlayer.getNpcClass()) && dclick)
if((GuiClass.this.selectButton.enabled = GuiClass.this.gm.player == null || this.clazz != GuiClass.this.gm.player.getNpcClass()) && dclick)
GuiClass.this.use(GuiClass.this.selectButton, Mode.PRIMARY);
}
}
@ -45,8 +45,8 @@ public class GuiClass extends GuiList<GuiClass.ClassEntry> implements ActButton.
super.init(width, height);
this.setDimensions(400, height, 32, height - 32);
this.elements.clear();
if(this.gm.thePlayer != null && this.gm.thePlayer.getSpecies().classEnum != null)
for(Enum clazz : this.gm.thePlayer.getSpecies().classEnum.getEnumConstants()) {
if(this.gm.player != null && this.gm.player.getSpecies().classEnum != null)
for(Enum clazz : this.gm.player.getSpecies().classEnum.getEnumConstants()) {
this.elements.add(new ClassEntry(clazz));
}
this.add(new NavButton(width - 198 * 2, height - 28, 194, 24, GuiChar.INSTANCE, "Zurück"));
@ -69,8 +69,8 @@ public class GuiClass extends GuiList<GuiClass.ClassEntry> implements ActButton.
public void use(ActButton elem, Mode action) {
ClassEntry entry = this.getSelected();
if(entry != null && GuiClass.this.gm.thePlayer != null) {
GuiClass.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal()));
if(entry != null && GuiClass.this.gm.player != null) {
GuiClass.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal()));
this.gm.displayGuiScreen(GuiChar.INSTANCE);
}
}

View file

@ -24,7 +24,7 @@ public class GuiSpecies extends GuiList<GuiSpecies.SpeciesEntry> implements ActB
public void draw(int x, int y, int mouseX, int mouseY, boolean hovered)
{
if(GuiSpecies.this.gm.thePlayer != null && this.species == GuiSpecies.this.gm.thePlayer.getSpecies())
if(GuiSpecies.this.gm.player != null && this.species == GuiSpecies.this.gm.player.getSpecies())
Drawing.drawRect(x, y, 1, 44, 0xffaf0000);
Drawing.drawText(this.species.name, x + 3, y, 0xff000000 | this.species.color1 | this.species.color2);
if(this.species.classEnum != null)
@ -33,7 +33,7 @@ public class GuiSpecies extends GuiList<GuiSpecies.SpeciesEntry> implements ActB
public void select(boolean dclick, int mx, int my)
{
if((GuiSpecies.this.selectButton.enabled = GuiSpecies.this.gm.thePlayer == null || this.species != GuiSpecies.this.gm.thePlayer.getSpecies()) && dclick)
if((GuiSpecies.this.selectButton.enabled = GuiSpecies.this.gm.player == null || this.species != GuiSpecies.this.gm.player.getSpecies()) && dclick)
GuiSpecies.this.use(GuiSpecies.this.selectButton, Mode.PRIMARY);
}
}
@ -73,7 +73,7 @@ public class GuiSpecies extends GuiList<GuiSpecies.SpeciesEntry> implements ActB
public void use(ActButton elem, Mode action) {
SpeciesEntry entry = this.getSelected();
if(entry != null && GuiSpecies.this.gm.thePlayer != null)
GuiSpecies.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz)));
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)));
}
}

View file

@ -19,7 +19,7 @@ public class GuiChest extends GuiContainer
public GuiChest(IInventory upperInv, IInventory lowerInv)
{
super(new ContainerChest(upperInv, lowerInv, Client.CLIENT.thePlayer));
super(new ContainerChest(upperInv, lowerInv, Client.CLIENT.player));
this.upperChestInventory = upperInv;
this.lowerChestInventory = lowerInv;
// this.allowUserInput = false;

View file

@ -213,7 +213,7 @@ public abstract class GuiContainer extends Gui
*/
public void initGui()
{
this.gm.thePlayer.openContainer = this.inventorySlots;
this.gm.player.openContainer = this.inventorySlots;
// this.guiLeft = (this.width - this.xSize) / 2;
// this.guiTop = (this.height - this.ySize) / 2;
// this.addButtons();
@ -360,7 +360,7 @@ public abstract class GuiContainer extends Gui
ItemRenderer.disableStandardItemLighting();
// this.drawGuiContainerForegroundLayer(mouseX, mouseY);
ItemRenderer.enableGUIStandardItemLighting();
InventoryPlayer inventoryplayer = this.gm.thePlayer.inventory;
InventoryPlayer inventoryplayer = this.gm.player.inventory;
ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack;
if(this.gm.itemCheat)
itemstack = itemstack == null ? this.cheatStack : itemstack;
@ -451,7 +451,7 @@ public abstract class GuiContainer extends Gui
}
protected void renderToolTip(ItemStack stack, int x, int y) {
List<String> list = stack.getTooltip(this.gm.thePlayer);
List<String> list = stack.getTooltip(this.gm.player);
StringBuilder sb = new StringBuilder();
for(int i = 0; i < list.size(); ++i) {
if(i != 0)
@ -512,7 +512,7 @@ public abstract class GuiContainer extends Gui
ItemStack itemstack = slotIn.getStack();
boolean flag = false;
boolean flag1 = slotIn == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick;
ItemStack itemstack1 = this.gm.thePlayer.inventory.getItemStack();
ItemStack itemstack1 = this.gm.player.inventory.getItemStack();
String s = null;
if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != null)
@ -589,7 +589,7 @@ public abstract class GuiContainer extends Gui
private void updateDragSplitting()
{
ItemStack itemstack = this.gm.thePlayer.inventory.getItemStack();
ItemStack itemstack = this.gm.player.inventory.getItemStack();
if (itemstack != null && this.dragSplitting)
{
@ -643,8 +643,8 @@ public abstract class GuiContainer extends Gui
return;
if(this.cheatStack != null) {
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.thePlayer != null && slot.inventory == this.gm.thePlayer.inventory)
this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1));
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));
if(mouseButton != 1 && !this.gm.ctrl())
this.cheatStack = null;
return;
@ -652,7 +652,7 @@ public abstract class GuiContainer extends Gui
if((mouseButton == 0 || mouseButton == 1 || mouseButton == 2) && this.clickSide(mouseX, mouseY, -1, this.gm.shift() || mouseButton == 1, this.gm.ctrl() || mouseButton == 2))
return;
if(mouseButton == 0) {
if(this.gm.itemCheat && this.gm.thePlayer != null && this.gm.thePlayer.inventory.getItemStack() == null) {
if(this.gm.itemCheat && this.gm.player != null && this.gm.player.inventory.getItemStack() == null) {
for (CheatTab tab : CheatTab.values())
{
if (this.isInsideTab(tab, mouseX, mouseY))
@ -711,7 +711,7 @@ public abstract class GuiContainer extends Gui
// else
if (!this.dragSplitting)
{
if (this.gm.thePlayer.inventory.getItemStack() == null)
if (this.gm.player.inventory.getItemStack() == null)
{
// if (mouseButton == this.gm.bindTertiary.getKeyCode() + 100)
// {
@ -774,7 +774,7 @@ public abstract class GuiContainer extends Gui
if(this.gm == null || this.cheatStack != null)
return;
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
ItemStack itemstack = this.gm.thePlayer.inventory.getItemStack();
ItemStack itemstack = this.gm.player.inventory.getItemStack();
// if (this.clickedSlot != null && this.gm.touchscreen)
// {
@ -849,7 +849,7 @@ public abstract class GuiContainer extends Gui
{
for (Slot slot2 : this.inventorySlots.inventorySlots)
{
if (slot2 != null && slot2.canTakeStack(this.gm.thePlayer) && slot2.getHasStack() && slot2.inventory == slot.inventory && Container.canAddItemToSlot(slot2, this.shiftClickedSlot, true))
if (slot2 != null && slot2.canTakeStack(this.gm.player) && slot2.getHasStack() && slot2.inventory == slot.inventory && Container.canAddItemToSlot(slot2, this.shiftClickedSlot, true))
{
this.handleMouseClick(slot2, slot2.slotNumber, state, 1);
}
@ -935,7 +935,7 @@ public abstract class GuiContainer extends Gui
this.handleMouseClick((Slot)null, -999, Container.getDragCode(2, this.dragSplittingLimit), 5);
}
else if (this.gm.thePlayer.inventory.getItemStack() != null)
else if (this.gm.player.inventory.getItemStack() != null)
{
// if (state == this.gm.bindTertiary.getKeyCode() + 100)
// {
@ -955,7 +955,7 @@ public abstract class GuiContainer extends Gui
}
}
if (this.gm.thePlayer.inventory.getItemStack() == null)
if (this.gm.player.inventory.getItemStack() == null)
{
this.lastClickTime = 0L;
}
@ -994,11 +994,11 @@ public abstract class GuiContainer extends Gui
slotId = slotIn.slotNumber;
}
this.gm.controller.windowClick(this.inventorySlots.windowId, slotId, clickedButton, clickType, this.gm.thePlayer);
this.gm.controller.windowClick(this.inventorySlots.windowId, slotId, clickedButton, clickType, this.gm.player);
}
public void dropItem() {
if (this.gm != null && this.gm.thePlayer != null && this.theSlot != null && this.theSlot.getHasStack())
if (this.gm != null && this.gm.player != null && this.theSlot != null && this.theSlot.getHasStack())
{
// if (keyCode == this.gm.bindTertiary.getKeyCode())
// {
@ -1034,7 +1034,7 @@ public abstract class GuiContainer extends Gui
*/
public void useHotbar(int slot)
{
if (!this.clickSide((this.gm.mouse_x - this.container_x) / 2, (this.gm.mouse_y - this.container_y) / 2, slot, this.gm.shift(), this.gm.ctrl()) && this.gm != null && this.gm.thePlayer != null && this.gm.thePlayer.inventory.getItemStack() == null && this.cheatStack == null && this.theSlot != null)
if (!this.clickSide((this.gm.mouse_x - this.container_x) / 2, (this.gm.mouse_y - this.container_y) / 2, slot, this.gm.shift(), this.gm.ctrl()) && this.gm != null && this.gm.player != null && this.gm.player.inventory.getItemStack() == null && this.cheatStack == null && this.theSlot != null)
{
// for (int i = 0; i < 9; ++i)
// {
@ -1054,9 +1054,9 @@ public abstract class GuiContainer extends Gui
*/
public void onGuiClosed()
{
if (this.gm != null && this.gm.thePlayer != null)
if (this.gm != null && this.gm.player != null)
{
this.inventorySlots.onContainerClosed(this.gm.thePlayer);
this.inventorySlots.onContainerClosed(this.gm.player);
}
}
@ -1075,9 +1075,9 @@ public abstract class GuiContainer extends Gui
{
// super.updateScreen();
if (this.gm != null && this.gm.thePlayer != null && (!this.gm.thePlayer.isEntityAlive() || this.gm.thePlayer.dead))
if (this.gm != null && this.gm.player != null && (!this.gm.player.isEntityAlive() || this.gm.player.dead))
{
this.gm.thePlayer.closeScreen();
this.gm.player.closeScreen();
}
}
@ -1182,7 +1182,7 @@ public abstract class GuiContainer extends Gui
}
private boolean clickSide(int mouseX, int mouseY, int slot, boolean instant, boolean full) {
if(this.gm.itemCheat && this.isPointInRegion(this.xSize + 2, 0, 18 * 12, 18 * 9, mouseX, mouseY) && this.gm.thePlayer != null && this.gm.thePlayer.inventory.getItemStack() == null && this.cheatStack == null) {
if(this.gm.itemCheat && this.isPointInRegion(this.xSize + 2, 0, 18 * 12, 18 * 9, mouseX, mouseY) && this.gm.player != null && this.gm.player.inventory.getItemStack() == null && this.cheatStack == null) {
int i = (ITEM_LIST.size() + 12 - 1) / 12 - 9;
int j = (int)((double)(this.currentScroll * (float)i) + 0.5D);
@ -1197,7 +1197,7 @@ public abstract class GuiContainer extends Gui
if(i1 >= 0 && i1 < ITEM_LIST.size()) {
if(slot >= 0 || instant) {
this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full));
this.gm.player.sendQueue.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full));
}
else {
this.cheatStack = ITEM_LIST.get(i1).copy();

View file

@ -70,7 +70,7 @@ public class GuiEnchant extends GuiContainer
int l = mouseX - 60;
int i1 = mouseY - (14 + 19 * k);
if (l >= 0 && i1 >= 0 && l < 108 && i1 < 19 && this.container.enchantItem(this.gm.thePlayer, k))
if (l >= 0 && i1 >= 0 && l < 108 && i1 < 19 && this.container.enchantItem(this.gm.player, k))
{
this.gm.controller.sendEnchantPacket(this.container.windowId, k);
}
@ -107,7 +107,7 @@ public class GuiEnchant extends GuiContainer
String s1 = "" + l1;
int i2 = 6839882;
if (/* (k < l + 1 || */ this.gm.thePlayer.experienceLevel < l1) // && !this.gm.thePlayer.creative)
if (/* (k < l + 1 || */ this.gm.player.experienceLevel < l1) // && !this.gm.thePlayer.creative)
{
this.rect(i1, 14 + 19 * l, 108, 19, 0x400000);
this.rect(i1 + 1, 15 + 19 * l, 16, 16, 0x200000);
@ -171,7 +171,7 @@ public class GuiEnchant extends GuiContainer
// sb.append("\n");
// }
if (this.gm.thePlayer.experienceLevel < k)
if (this.gm.player.experienceLevel < k)
{
sb.append((sb.length() != 0 ? "\n" : "") + TextColor.RED + String.format("Erfahrungsstufe %d erforderlich", this.container.enchantLevels[j]));
}

View file

@ -19,7 +19,7 @@ public class GuiHopper extends GuiContainer
public GuiHopper(InventoryPlayer playerInv, IInventory hopperInv)
{
super(new ContainerHopper(playerInv, hopperInv, Client.CLIENT.thePlayer));
super(new ContainerHopper(playerInv, hopperInv, Client.CLIENT.player));
this.playerInventory = playerInv;
this.hopperInventory = hopperInv;
// this.allowUserInput = false;

View file

@ -27,7 +27,7 @@ public class GuiHorse extends GuiContainer
public GuiHorse(IInventory playerInv, IInventory horseInv, EntityHorse horse)
{
super(new ContainerHorseInventory(playerInv, horseInv, horse, Client.CLIENT.thePlayer));
super(new ContainerHorseInventory(playerInv, horseInv, horse, Client.CLIENT.player));
this.playerInventory = playerInv;
this.horseInventory = horseInv;
// this.horseEntity = horse;

View file

@ -16,7 +16,7 @@ public class GuiMachine extends GuiContainer
public GuiMachine(InventoryPlayer player, IInventory inv, TileEntityMachine machine)
{
super(new ContainerMachine(player, machine, inv, Client.CLIENT.thePlayer));
super(new ContainerMachine(player, machine, inv, Client.CLIENT.player));
this.playerInv = player;
this.machineInv = machine;
// this.allowUserInput = false;

View file

@ -21,7 +21,7 @@ public class GuiRepair extends GuiContainer implements ICrafting
public GuiRepair(InventoryPlayer inventoryIn, World worldIn)
{
super(new ContainerRepair(inventoryIn, worldIn, Client.CLIENT.thePlayer));
super(new ContainerRepair(inventoryIn, worldIn, Client.CLIENT.player));
this.playerInventory = inventoryIn;
this.anvil = (ContainerRepair)this.inventorySlots;
}

View file

@ -18,10 +18,10 @@ public class GuiGameOver extends Gui {
public void init(int width, int height) {
this.timer = 0;
this.add(new Label(0, 0, 200, 20, "Du bist gestorben!"));
this.add(new Label(0, 32, 200, 20, "Punktestand: " + TextColor.YELLOW + this.gm.thePlayer.experienceLevel));
this.add(new Label(0, 32, 200, 20, "Punktestand: " + TextColor.YELLOW + this.gm.player.experienceLevel));
this.button = this.add(new ActButton(0, 100, 200, 24, new ActButton.Callback() {
public void use(ActButton elem, Mode action) {
GuiGameOver.this.gm.thePlayer.respawnPlayer();
GuiGameOver.this.gm.player.respawnPlayer();
GuiGameOver.this.gm.displayGuiScreen(null);
}
}, "Wiederbeleben"));

View file

@ -202,7 +202,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
this.gameController.loadWorld(this.clientWorldController, packetIn.getEntityType());
// this.gameController.thePlayer.dimension = this.clientWorldController.dimension.getDimensionId();
this.gameController.thePlayer.setId(packetIn.getEntityId());
this.gameController.player.setId(packetIn.getEntityId());
this.gameController.displayGuiScreen(this.gameController.charEditor ? GuiChar.INSTANCE : null);
// this.currentServerMaxPlayers = packetIn.getMaxPlayers();
// this.gameController.controller.setCheat(packetIn.getCheat());
@ -465,7 +465,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
entity.getDataWatcher().updateWatchedObjectsFromList(packetIn.func_149376_c());
if(entity == this.gameController.thePlayer && this.gameController.open instanceof GuiChar)
if(entity == this.gameController.player && this.gameController.open instanceof GuiChar)
((GuiChar)this.gameController.open).checkReopen();
}
}
@ -481,7 +481,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
double z = (double)packetIn.getZ() / 32.0D;
float yaw = packetIn.getYaw();
float pitch = packetIn.getPitch();
EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld); // 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.prevX = player.lastTickPosX = (double)(player.serverPosX = packetIn.getX());
player.prevY = player.lastTickPosY = (double)(player.serverPosY = packetIn.getY());
@ -551,7 +551,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (packetIn.getHeldItemHotbarIndex() >= 0 && packetIn.getHeldItemHotbarIndex() < InventoryPlayer.getHotbarSize())
{
this.gameController.thePlayer.inventory.currentItem = packetIn.getHeldItemHotbarIndex();
this.gameController.player.inventory.currentItem = packetIn.getHeldItemHotbarIndex();
}
}
@ -620,7 +620,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handlePlayerPosLook(SPacketPlayerPosLook packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer;
EntityNPC entityplayer = this.gameController.player;
double d0 = packetIn.getX();
double d1 = packetIn.getY();
double d2 = packetIn.getZ();
@ -669,9 +669,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (!this.doneLoadingTerrain)
{
this.gameController.thePlayer.prevX = this.gameController.thePlayer.posX;
this.gameController.thePlayer.prevY = this.gameController.thePlayer.posY;
this.gameController.thePlayer.prevZ = this.gameController.thePlayer.posZ;
this.gameController.player.prevX = this.gameController.player.posX;
this.gameController.player.prevY = this.gameController.player.posY;
this.gameController.player.prevZ = this.gameController.player.posZ;
this.doneLoadingTerrain = true;
// this.gameController.displayGuiScreen(null);
// if(this.travelSound) {
@ -769,7 +769,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (entitylivingbase == null)
{
entitylivingbase = this.gameController.thePlayer;
entitylivingbase = this.gameController.player;
}
if (entity != null)
@ -907,7 +907,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
double d2 = (double)packetIn.getZ() / 32.0D;
float f = (float)(packetIn.getYaw() * 360) / 256.0F;
float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
EntityLiving entitylivingbase = (EntityLiving)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
EntityLiving entitylivingbase = (EntityLiving)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.world);
entitylivingbase.serverPosX = packetIn.getX();
entitylivingbase.serverPosY = packetIn.getY();
entitylivingbase.serverPosZ = packetIn.getZ();
@ -942,7 +942,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
// this.gameController.theWorld.getWorldInfo().setTime(packetIn.getTotalWorldTime());
this.gameController.theWorld.setDayTime(packetIn.getWorldTime());
this.gameController.world.setDayTime(packetIn.getWorldTime());
this.gameController.setTicked(packetIn.getServerinfo());
}
@ -968,9 +968,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
// boolean flag = false;
if (packetIn.getEntityId() == this.gameController.thePlayer.getId())
if (packetIn.getEntityId() == this.gameController.player.getId())
{
entity = this.gameController.thePlayer;
entity = this.gameController.player;
if (entity1 instanceof EntityBoat)
{
@ -1036,7 +1036,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleUpdateHealth(SPacketUpdateHealth packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
this.gameController.thePlayer.setPlayerSPHealth(packetIn.getHealth());
this.gameController.player.setPlayerSPHealth(packetIn.getHealth());
// this.gameController.thePlayer.getFoodStats().setFoodLevel(packetIn.getFoodLevel());
// this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(packetIn.getSaturationLevel());
}
@ -1044,7 +1044,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleSetExperience(SPacketSetExperience packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
this.gameController.thePlayer.setXPStats(packetIn.getProgress(), packetIn.getTotalExperience(), packetIn.getLevel());
this.gameController.player.setXPStats(packetIn.getProgress(), packetIn.getTotalExperience(), packetIn.getLevel());
}
public void handleRespawn(SPacketRespawn packetIn)
@ -1080,11 +1080,11 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleExplosion(S27PacketExplosion packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
Explosion explosion = new Explosion(this.gameController.world, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
explosion.doExplosionB(true, packetIn.hasAltSound());
this.gameController.thePlayer.motionX += (double)packetIn.func_149149_c();
this.gameController.thePlayer.motionY += (double)packetIn.func_149144_d();
this.gameController.thePlayer.motionZ += (double)packetIn.func_149147_e();
this.gameController.player.motionX += (double)packetIn.func_149149_c();
this.gameController.player.motionY += (double)packetIn.func_149144_d();
this.gameController.player.motionZ += (double)packetIn.func_149147_e();
}
/**
@ -1094,7 +1094,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleOpenWindow(S2DPacketOpenWindow packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayersp = this.gameController.thePlayer;
EntityNPC entityplayersp = this.gameController.player;
if ("container".equals(packetIn.getGuiId()))
{
@ -1128,7 +1128,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
TileEntity machine = this.clientWorldController.getTileEntity(packetIn.getTilePos());
if(machine instanceof TileEntityMachine)
this.gameController.displayGuiScreen(new GuiMachine(this.gameController.thePlayer.inventory, containerlocalmenu, (TileEntityMachine)machine));
this.gameController.displayGuiScreen(new GuiMachine(this.gameController.player.inventory, containerlocalmenu, (TileEntityMachine)machine));
}
else {
entityplayersp.displayGUIChest(containerlocalmenu);
@ -1143,7 +1143,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleSetSlot(S2FPacketSetSlot packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer;
EntityNPC entityplayer = this.gameController.player;
if (packetIn.getWindowId() == -1)
{
@ -1185,7 +1185,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
Container container = null;
EntityNPC entityplayer = this.gameController.thePlayer;
EntityNPC entityplayer = this.gameController.player;
if (packetIn.getWindowId() == 0)
{
@ -1208,7 +1208,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleWindowItems(S30PacketWindowItems packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer;
EntityNPC entityplayer = this.gameController.player;
if (packetIn.func_148911_c() == 0)
{
@ -1235,7 +1235,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
tileentity.setPos(packetIn.getSignPosition());
}
this.gameController.thePlayer.openEditSign((TileEntitySign)tileentity);
this.gameController.player.openEditSign((TileEntitySign)tileentity);
}
/**
@ -1246,9 +1246,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
// boolean flag = false;
if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
if (tileentity instanceof TileEntitySign)
{
@ -1280,9 +1280,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
{
TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
// int i = packetIn.getTileEntityType();
if (tileentity != null && packetIn.isTileEntityType(tileentity)) // i == 1 && tileentity instanceof TileEntityMobSpawner || /* i == 2 && tileentity instanceof TileEntityCommandBlock || */ i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || /* i == 5 && tileentity instanceof TileEntityFlowerPot || */ i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityMachine)
@ -1298,7 +1298,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleWindowProperty(S31PacketWindowProperty packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer;
EntityNPC entityplayer = this.gameController.player;
if (entityplayer.openContainer != null && entityplayer.openContainer.windowId == packetIn.getWindowId())
{
@ -1335,7 +1335,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleBlockAction(SPacketBlockAction packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
this.gameController.theWorld.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
this.gameController.world.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
}
/**
@ -1344,7 +1344,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleBlockBreakAnim(SPacketBlockBreakAnim packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
this.gameController.theWorld.sendBlockBreakProgress(packetIn.getBreakerId(), packetIn.getPosition(), packetIn.getProgress());
this.gameController.world.sendBlockBreakProgress(packetIn.getBreakerId(), packetIn.getPosition(), packetIn.getProgress());
}
public void handleMapChunkBulk(SPacketMapChunkBulk packetIn)
@ -1403,7 +1403,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// }
// else
// {
this.gameController.theWorld.playAuxSFX(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
this.gameController.world.playAuxSFX(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
// }
}
@ -1597,7 +1597,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handlePlayerAbilities(S39PacketPlayerAbilities packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer;
EntityNPC entityplayer = this.gameController.player;
entityplayer.flying = packetIn.isFlying();
entityplayer.noclip = packetIn.isNoclip();
// entityplayer.speed = packetIn.getSpeed();
@ -1629,7 +1629,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// else if(packetIn.getSoundName().startsWith("music#")) {
// return;
// }
this.gameController.theWorld.playSound(packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getSound(), packetIn.getVolume());
this.gameController.world.playSound(packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getSound(), packetIn.getVolume());
}
// public void handleDisplay(S48PacketDisplay packetIn)
@ -1901,7 +1901,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
int i = packetIn.getWindowId();
Gui gui = this.gameController.open;
if (gui != null && gui instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId)
if (gui != null && gui instanceof GuiMerchant && i == this.gameController.player.openContainer.windowId)
{
// NpcMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
MerchantRecipeList merchantrecipelist = packetIn.getTrades();

View file

@ -129,10 +129,10 @@ public class EntityRenderer {
if (this.gm.getRenderViewEntity() == null)
{
this.gm.setRenderViewEntity(this.gm.thePlayer);
this.gm.setRenderViewEntity(this.gm.player);
}
float light = this.gm.theWorld.getLightBrightness(new BlockPos(this.gm.getRenderViewEntity()));
float light = this.gm.world.getLightBrightness(new BlockPos(this.gm.getRenderViewEntity()));
// Log.info(String.format("%.3f", light));
float dist = (float)this.gm.renderDistance / 32.0F;
float shift = light * (1.0F - dist) + dist;
@ -186,10 +186,10 @@ public class EntityRenderer {
if (entity != null)
{
if (this.gm.theWorld != null)
if (this.gm.world != null)
{
this.gm.setPointedEntity(null);
double max = this.gm.thePlayer != null ? this.gm.thePlayer.getReachDistance() : 5.0;
double max = this.gm.player != null ? this.gm.player.getReachDistance() : 5.0;
this.gm.pointed = entity.rayTrace(max, partialTicks);
double dist = max;
Vec3 eye = entity.getPositionEyes(partialTicks);
@ -219,7 +219,7 @@ public class EntityRenderer {
this.pointedEntity = null;
Vec3 hit = null;
float exp = 1.0F;
List<Entity> list = this.gm.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(look.xCoord * max, look.yCoord * max, look.zCoord * max).expand((double)exp, (double)exp, (double)exp), new Predicate<Entity>()
List<Entity> list = this.gm.world.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(look.xCoord * max, look.yCoord * max, look.zCoord * max).expand((double)exp, (double)exp, (double)exp), new Predicate<Entity>()
{
public boolean test(Entity p_apply_1_)
{
@ -502,7 +502,7 @@ public class EntityRenderer {
f3 = f3 * 0.1F;
f4 = f4 * 0.1F;
f5 = f5 * 0.1F;
HitPosition movingobjectposition = this.gm.theWorld.rayTraceBlocks(new Vec3(d0 + (double)f3, d1 + (double)f4, d2 + (double)f5), new Vec3(d0 - d4 + (double)f3 + (double)f5, d1 - d6 + (double)f4, d2 - d5 + (double)f5));
HitPosition movingobjectposition = this.gm.world.rayTraceBlocks(new Vec3(d0 + (double)f3, d1 + (double)f4, d2 + (double)f5), new Vec3(d0 - d4 + (double)f3 + (double)f5, d1 - d6 + (double)f4, d2 - d5 + (double)f5));
if (movingobjectposition != null)
{
@ -749,7 +749,7 @@ public class EntityRenderer {
{
if (this.lightmapUpdateNeeded)
{
WorldClient world = this.gm.theWorld;
WorldClient world = this.gm.world;
if (world != null)
{
@ -792,9 +792,9 @@ public class EntityRenderer {
// f10 = 0.25F + f7 * 0.75F;
// }
if (this.gm.thePlayer.hasEffect(Potion.NIGHT_VISION))
if (this.gm.player.hasEffect(Potion.NIGHT_VISION))
{
float vis = this.getNightVisionBrightness(this.gm.thePlayer, partialTicks);
float vis = this.getNightVisionBrightness(this.gm.player, partialTicks);
float mult = 1.0F / red;
if (mult > 1.0F / green)
@ -926,7 +926,7 @@ public class EntityRenderer {
if (this.gm.getRenderViewEntity() == null)
{
this.gm.setRenderViewEntity(this.gm.thePlayer);
this.gm.setRenderViewEntity(this.gm.player);
}
this.getMouseOver(partialTicks);
@ -958,7 +958,7 @@ public class EntityRenderer {
this.updateFogColor(partialTicks);
GL11.glClear(16640);
this.setupCameraTransform(partialTicks);
ActiveRenderInfo.updateRenderInfo(this.gm.thePlayer, this.gm.thirdPersonView == 2);
ActiveRenderInfo.updateRenderInfo(this.gm.player, this.gm.thirdPersonView == 2);
Entity entity = this.gm.getRenderViewEntity();
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
@ -981,14 +981,14 @@ public class EntityRenderer {
this.setupFog(0, partialTicks);
GlState.shadeModel(GL11.GL_SMOOTH);
if (entity.posY + (double)entity.getEyeHeight() < (double)this.gm.theWorld.dimension.getCloudHeight())
if (entity.posY + (double)entity.getEyeHeight() < (double)this.gm.world.dimension.getCloudHeight())
{
this.renderCloudsCheck(renderglobal, partialTicks);
}
this.setupFog(0, partialTicks);
this.gm.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
ItemRenderer.disableStandardItemLighting();
renderglobal.setupTerrain(entity, (double)partialTicks, this.frameCount++, this.gm.thePlayer.noclip);
renderglobal.setupTerrain(entity, (double)partialTicks, this.frameCount++, this.gm.player.noclip);
this.gm.renderGlobal.updateChunks(finishTimeNano);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
@ -1073,7 +1073,7 @@ public class EntityRenderer {
GlState.disableBlend();
GlState.disableFog();
if (entity.posY + (double)entity.getEyeHeight() >= (double)this.gm.theWorld.dimension.getCloudHeight())
if (entity.posY + (double)entity.getEyeHeight() >= (double)this.gm.world.dimension.getCloudHeight())
{
this.renderCloudsCheck(renderglobal, partialTicks);
}
@ -1096,7 +1096,7 @@ public class EntityRenderer {
GL11.glPushMatrix();
this.setupFog(0, partialTicks);
// renderGlobalIn.renderClouds(partialTicks);
if(this.gm.theWorld.dimension.getType().clouds)
if(this.gm.world.dimension.getType().clouds)
renderGlobalIn.renderClouds(partialTicks);
GlState.disableFog();
GL11.glPopMatrix();
@ -1109,7 +1109,7 @@ public class EntityRenderer {
private void addRainParticles()
{
float f = this.gm.theWorld.getRainStrength();
float f = this.gm.world.getRainStrength();
// if (this.gm.downfallSetting != 0)
// {
@ -1120,7 +1120,7 @@ public class EntityRenderer {
{
this.random.setSeed((long)this.rendererUpdateCount * 312987231L);
Entity entity = this.gm.getRenderViewEntity();
World world = this.gm.theWorld;
World world = this.gm.world;
BlockPos blockpos = new BlockPos(entity);
int i = 10;
double d0 = 0.0D;
@ -1166,7 +1166,7 @@ public class EntityRenderer {
}
}
if(temp < 194.0f || this.random.chance(5))
this.gm.theWorld.spawnParticle(temp >= 194.0f && this.random.chance(10) ? ParticleType.LAVA : ParticleType.SMOKE_NORMAL, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D);
this.gm.world.spawnParticle(temp >= 194.0f && this.random.chance(10) ? ParticleType.LAVA : ParticleType.SMOKE_NORMAL, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D);
}
else if (block.getMaterial() != Material.air)
{
@ -1180,7 +1180,7 @@ public class EntityRenderer {
d2 = (double)blockpos2.getZ() + d4;
}
this.gm.theWorld.spawnParticle(temp <= 5.0f ? ParticleType.HAIL_CORN : ParticleType.WATER_DROP, (double)blockpos2.getX() + d3, (double)((float)blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), (double)blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D);
this.gm.world.spawnParticle(temp <= 5.0f ? ParticleType.HAIL_CORN : ParticleType.WATER_DROP, (double)blockpos2.getX() + d3, (double)((float)blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), (double)blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D);
}
}
}
@ -1191,11 +1191,11 @@ public class EntityRenderer {
if (d1 > (double)(blockpos.getY() + 1) && world.getPrecipitationHeight(blockpos).getY() > ExtMath.floorf((float)blockpos.getY()))
{
this.gm.theWorld.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.2f : 0.1F);
this.gm.world.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.2f : 0.1F);
}
else
{
this.gm.theWorld.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.4f : 0.2F);
this.gm.world.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.4f : 0.2F);
}
}
}
@ -1210,13 +1210,13 @@ public class EntityRenderer {
*/
protected void renderRainSnow(float partialTicks)
{
float f = this.gm.theWorld.getRainStrength();
float f = this.gm.world.getRainStrength();
if (f > 0.0F) // && this.gm.downfallSetting < 2)
{
this.enableLightmap();
Entity entity = this.gm.getRenderViewEntity();
World world = this.gm.theWorld;
World world = this.gm.world;
int i = ExtMath.floord(entity.posX);
int j = ExtMath.floord(entity.posY);
int k = ExtMath.floord(entity.posZ);
@ -1411,7 +1411,7 @@ public class EntityRenderer {
*/
private void updateFogColor(float partial)
{
WorldClient world = this.gm.theWorld;
WorldClient world = this.gm.world;
Entity entity = this.gm.getRenderViewEntity();
float dist = 0.25F + 0.75F * (float)this.gm.renderDistance / 32.0F;
dist = 1.0F - (float)Math.pow((double)dist, 0.25D);
@ -1473,7 +1473,7 @@ public class EntityRenderer {
this.fogColorBlue *= mul;
}
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.gm.theWorld, entity, partial);
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.gm.world, entity, partial);
// if (this.cloudFog)
// {
@ -1586,7 +1586,7 @@ public class EntityRenderer {
private void setupFog(int start, float partial)
{
Entity entity = this.gm.getRenderViewEntity();
float fog = this.gm.theWorld.getFogStrength();
float fog = this.gm.world.getFogStrength();
float distance = Math.min(0.995f, Math.max(0.005f, FOG_DISTANCE - (0.3f * fog)));
float density = 1.0f - Math.min(1.0f, FOG_DENSITY * (1.0f - fog * 0.1f));
// boolean flag = false;
@ -1599,7 +1599,7 @@ public class EntityRenderer {
GL11.glFogfv(GL11.GL_FOG_COLOR, (FloatBuffer)this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F));
GL11.glNormal3f(0.0F, -1.0F, 0.0F);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.gm.theWorld, entity, partial);
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.gm.world, entity, partial);
if(distance >= 1.0f) {
;
@ -1676,7 +1676,7 @@ public class EntityRenderer {
// SKC.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV);
// }
if (this.gm.theWorld.dimension.hasDenseFog())
if (this.gm.world.dimension.hasDenseFog())
{
GlState.setFogStart(far * ((distance / 0.75f) * 0.05F));
GlState.setFogEnd(Math.min(far, 192.0F) * Math.max(density * (distance / 0.75f), (distance / 0.75f) * 0.05F + 0.01f));

View file

@ -163,7 +163,7 @@ public class ItemRenderer
*/
private void setLightMapFromPlayer(EntityNPC clientPlayer)
{
int i = this.gm.theWorld.getCombinedLight(new BlockPos(clientPlayer.posX, clientPlayer.posY + (double)clientPlayer.getEyeHeight(), clientPlayer.posZ), 0);
int i = this.gm.world.getCombinedLight(new BlockPos(clientPlayer.posX, clientPlayer.posY + (double)clientPlayer.getEyeHeight(), clientPlayer.posZ), 0);
float f = (float)(i & 65535);
float f1 = (float)(i >> 16);
GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, f, f1);
@ -299,9 +299,9 @@ public class ItemRenderer
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(1.0F, 1.0F, 1.0F);
GL11.glTranslatef(5.6F, 0.0F, 0.0F);
RenderNpc render = this.renderManager.getRenderObject(this.gm.thePlayer.getModel());
RenderNpc render = this.renderManager.getRenderObject(this.gm.player.getModel());
GlState.disableCull();
render.renderPlayerArm(this.gm.thePlayer);
render.renderPlayerArm(this.gm.player);
GlState.enableCull();
}
@ -407,7 +407,7 @@ public class ItemRenderer
public void renderItemInFirstPerson(float partialTicks)
{
float f = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTicks);
EntityNPC clientplayer = this.gm.thePlayer;
EntityNPC clientplayer = this.gm.player;
float f1 = clientplayer.getSwingProgress(partialTicks);
float f2 = clientplayer.prevPitch + (clientplayer.rotPitch - clientplayer.prevPitch) * partialTicks;
float f3 = clientplayer.prevYaw + (clientplayer.rotYaw - clientplayer.prevYaw) * partialTicks;
@ -475,10 +475,10 @@ public class ItemRenderer
{
GlState.disableAlpha();
if (this.gm.thePlayer.isEntityInsideOpaqueBlock())
if (this.gm.player.isEntityInsideOpaqueBlock())
{
State iblockstate = this.gm.theWorld.getState(new BlockPos(this.gm.thePlayer));
EntityNPC entityplayer = this.gm.thePlayer;
State iblockstate = this.gm.world.getState(new BlockPos(this.gm.player));
EntityNPC entityplayer = this.gm.player;
for (int i = 0; i < 8; ++i)
{
@ -486,7 +486,7 @@ public class ItemRenderer
double d1 = entityplayer.posY + (double)(((float)((i >> 1) % 2) - 0.5F) * 0.1F);
double d2 = entityplayer.posZ + (double)(((float)((i >> 2) % 2) - 0.5F) * entityplayer.width * 0.8F);
BlockPos blockpos = new BlockPos(d0, d1 + (double)entityplayer.getEyeHeight(), d2);
State iblockstate1 = this.gm.theWorld.getState(blockpos);
State iblockstate1 = this.gm.world.getState(blockpos);
if (iblockstate1.getBlock().isVisuallyOpaque())
{
@ -500,7 +500,7 @@ public class ItemRenderer
}
}
if(this.gm.thePlayer.isBurning()) {
if(this.gm.player.isBurning()) {
this.renderFireInFirstPerson(partialTicks);
}
@ -590,7 +590,7 @@ public class ItemRenderer
public void updateEquippedItem()
{
this.prevEquippedProgress = this.equippedProgress;
EntityNPC entityplayer = this.gm.thePlayer;
EntityNPC entityplayer = this.gm.player;
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
boolean flag = false;

View file

@ -560,7 +560,7 @@ public class RenderGlobal
GlState.enableAlpha();
}
if (this.gm.renderOutlines && this.gm.thePlayer != null)
if (this.gm.renderOutlines && this.gm.player != null)
{
GlState.depthFunc(GL11.GL_ALWAYS);
GlState.disableFog();
@ -575,7 +575,7 @@ public class RenderGlobal
{
Entity entity3 = list.get(j);
if ((entity3 != this.gm.getRenderViewEntity() || this.gm.thirdPersonView != 0) &&
entity3 instanceof EntityLiving && entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.noFrustumCheck || Frustum.isInFrustum(entity3.getEntityBoundingBox()) || entity3.passenger == this.gm.thePlayer))
entity3 instanceof EntityLiving && entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.noFrustumCheck || Frustum.isInFrustum(entity3.getEntityBoundingBox()) || entity3.passenger == this.gm.player))
{
// this.renderManager.renderEntity(entity3, partialTicks);
int c = ((EntityLiving)entity3).getColor();
@ -623,7 +623,7 @@ public class RenderGlobal
}
entity2 = (Entity)iterator.next();
flag2 = this.renderManager.shouldRender(entity2, d0, d1, d2) || entity2.passenger == this.gm.thePlayer;
flag2 = this.renderManager.shouldRender(entity2, d0, d1, d2) || entity2.passenger == this.gm.player;
if (!flag2)
{
@ -1125,11 +1125,11 @@ public class RenderGlobal
public void renderSky(float partialTicks)
{
if (this.gm.theWorld.dimension.getSkyBoxTexture() != null)
if (this.gm.world.dimension.getSkyBoxTexture() != null)
{
this.renderSkyBox(this.gm.theWorld.dimension.getSkyBoxTexture());
this.renderSkyBox(this.gm.world.dimension.getSkyBoxTexture());
}
else if (this.gm.theWorld.dimension.getType().sky)
else if (this.gm.world.dimension.getType().sky)
{
GlState.disableTexture2D();
Vec3 vec3 = this.theWorld.getSkyColor(this.gm.getRenderViewEntity(), partialTicks);
@ -1223,7 +1223,7 @@ public class RenderGlobal
GlState.color(1.0F, 1.0F, 1.0F, f16);
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(this.theWorld.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
if(this.gm.theWorld.dimension.getType().sun) {
if(this.gm.world.dimension.getType().sun) {
float size = 30.0F;
this.renderEngine.bindTexture(SUN_TEX);
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
@ -1233,7 +1233,7 @@ public class RenderGlobal
worldrenderer.pos((double)(-size), 100.0D, (double)size).tex(0.0D, 1.0D).endVertex();
Tessellator.draw();
}
if(this.gm.theWorld.dimension.getType().moon) {
if(this.gm.world.dimension.getType().moon) {
float size = 20.0F;
this.renderEngine.bindTexture(MOON_TEX);
int i = this.theWorld.getMoonPhase();
@ -1332,7 +1332,7 @@ public class RenderGlobal
int j = ExtMath.floord(d2 / 2048.0D);
d1 = d1 - (double)(i * 2048);
d2 = d2 - (double)(j * 2048);
this.renderEngine.bindTexture(this.gm.theWorld.dimension.getCloudTexture());
this.renderEngine.bindTexture(this.gm.world.dimension.getCloudTexture());
GlState.enableBlend();
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
Vec3 vec3 = this.theWorld.getCloudColour(this.gm.getRenderViewEntity(), partialTicks);

View file

@ -65,7 +65,7 @@ public class RenderFish extends Render<EntityHook>
double d2 = entity.angler.prevZ + (entity.angler.posZ - entity.angler.prevZ) * (double)partialTicks + vec3.zCoord;
double d3 = (double)entity.angler.getEyeHeight();
if (this.renderManager.gm != null && this.renderManager.gm.thirdPersonView > 0 || entity.angler != Client.CLIENT.thePlayer)
if (this.renderManager.gm != null && this.renderManager.gm.thirdPersonView > 0 || entity.angler != Client.CLIENT.player)
{
float f9 = (entity.angler.prevYawOffset + (entity.angler.yawOffset - entity.angler.prevYawOffset) * partialTicks) * (float)Math.PI / 180.0F;
double d4 = (double)ExtMath.sin(f9);

View file

@ -69,12 +69,12 @@ public class RenderHumanoid extends RenderNpc
public void doRender(EntityNPC entity, double x, double y, double z, float partialTicks)
{
if (entity != this.renderManager.gm.thePlayer || this.renderManager.livingPlayer == entity)
if (entity != this.renderManager.gm.player || this.renderManager.livingPlayer == entity)
{
// if(entity.isBoss())
// BossStatus.setBossStatus(entity);
double d0 = y;
if(/* this.canSneak() && */ entity.isSneakingVisually() && entity != this.renderManager.gm.thePlayer)
if(/* this.canSneak() && */ entity.isSneakingVisually() && entity != this.renderManager.gm.player)
d0 = y - 0.125D;
this.setModelVisibilities(entity);
super.doRender(entity, x, d0, z, partialTicks);

View file

@ -44,6 +44,7 @@ public enum Log {
private static final List<LogMessage> LOG = Lists.newArrayList();
private static LogLevel level = LogLevel.INFO;
private static boolean colors = true;
private static IThreadListener sync = new IThreadListener() {
public ListenableFuture<Object> schedule(Runnable run) {
return null;
@ -71,14 +72,16 @@ public enum Log {
if(pos - last != 0)
System.err.print(str.substring(last, pos));
color = TextColor.getColor(c); // (c >= CHR_COLORS2) && (c <= CHR_COLORE2) ? aux_colors[c - CHR_COLORS2] : text_colors[c - CHR_COLORS1];
System.err.printf("\u001b[38;2;%d;%d;%dm", (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
if(colors)
System.err.printf("\u001b[38;2;%d;%d;%dm", (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
last = ++pos;
continue;
}
else if(c == CHR_CRESET) {
if(pos - last != 0)
System.err.print(str.substring(last, pos));
System.err.print("\u001b[0m");
if(colors)
System.err.print("\u001b[0m");
last = ++pos;
continue;
}
@ -99,7 +102,7 @@ public enum Log {
if(pos >= str.length() && pos - last != 0)
System.err.print(str.substring(last, pos));
}
System.err.print("\u001b[0m\n");
System.err.print(colors ? "\u001b[0m\n" : "\n");
}
public static String str_time(long time) {
@ -112,6 +115,7 @@ public enum Log {
public static void init(IThreadListener sync) {
Log.sync = sync;
Log.colors = System.getProperty("log.nocolor") == null && !Util.WINDOWS;
}
public static void flushLog() {

View file

@ -12,7 +12,8 @@ import common.collect.Maps;
import common.log.Log;
public abstract class Util {
private static long start = getTime();
public static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
private static final long START = getTime();
public static String strip(String str, int offset, int len, char newl, char tab, char unk) {
StringBuilder sb = new StringBuilder();
@ -303,10 +304,10 @@ int utf_len(const char *str) {
}
public static void checkOs() {
if(System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac")) {
if(System.getProperty("os.name").startsWith("Mac")) {
String info = "Inkompatibles Betriebssystem";
String msg = "Linux oder *BSD ist erforderlich, um dieses Programm auszuführen.\n" +
"Alle Versionen von Windows und Mac OS (X) sind nicht kompatibel.";
String msg = "Linux, *BSD oder Windows ist erforderlich, um dieses Programm\n" +
"auszuführen. Alle Versionen von Mac OS (X) sind nicht kompatibel.";
System.err.println("#################################################################");
System.err.println("*** " + info + " ***");
System.err.println(msg);
@ -382,7 +383,7 @@ int utf_len(const char *str) {
}
public static long rtime() {
return Util.getTime() - start;
return Util.getTime() - START;
}
public static double ftime() {