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

View file

@ -301,7 +301,7 @@ public abstract class Gui {
// } // }
public void drawMainBackground() { 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, // 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); // this.theWorld == null ? this.style.bg_btm : 0x3f000000);
Drawing.drawGradient(0, 0, this.gm.fb_x, this.gm.fb_y, 0xc0101010, 0xd0101010); 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) { public void init(int width, int height) {
this.add(new Label(0, 0, 500, 24, this.messageLine1, true)); 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.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.cancelBtn = this.add(new ActButton(252, 500, 200, 24, this, this.cancelButtonText));
this.shift(); this.shift();

View file

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

View file

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

View file

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

View file

@ -129,7 +129,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
EntityTexManager.altLayer = this.dynId; EntityTexManager.altLayer = this.dynId;
EntityTexManager.altNpcLayer = this.dynId == -1 && this.charinfo != null ? this.charinfo.skin : null; EntityTexManager.altNpcLayer = this.dynId == -1 && this.charinfo != null ? this.charinfo.skin : null;
drawEntity(x + 32, y + 60, 28.0f 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; GuiChar.this.gm.cameraUsed = flag;
EntityTexManager.altTexture = null; EntityTexManager.altTexture = null;
EntityTexManager.altLayer = -1; EntityTexManager.altLayer = -1;
@ -271,8 +271,8 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
this.adjust = null; this.adjust = null;
return; return;
} }
this.currentSkin = this.gm.thePlayer != null && !EntityTexManager.hasCustomSkin(this.gm.thePlayer.getId()) ? this.gm.thePlayer.getChar() : null; this.currentSkin = this.gm.player != null && !EntityTexManager.hasCustomSkin(this.gm.player.getId()) ? this.gm.player.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.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() { this.add(new ActButton(4, 4, 194, 24, new ActButton.Callback() {
public void use(ActButton elem, Mode action) { public void use(ActButton elem, Mode action) {
GuiChar.this.gm.showFileDialog(FileMode.FILE_LOAD_MULTI, "Skin konvertieren", TEXTURE_FOLDER, new FileCallback() { 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")); }, "Vorlage kopieren"));
this.adjust = this.add(new DragAdjust(width / 2 - 230, height - 64 - 640, 460, 640)); 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 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)) 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.thePlayer != null && this.gm.thePlayer.getSpecies().classEnum != null; .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")) 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]; final ActButton[] alignBtns = new ActButton[Alignment.values().length];
for (int z = 0; z < Alignment.values().length; z++) 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]; 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() { 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) { 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.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) { for(ActButton btn : alignBtns) {
btn.enabled = btn != elem; btn.enabled = btn != elem;
} }
} }
} }
}, align.color + align.display)); }, 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) { 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.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 / 2 - 200, 36, 400, 20, "Name", true));
this.add(new Label(width - 396, height - 384, 392, 20, "Beschreibung", 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() { 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() { this.add(new ActButton(width - 198, height - 28, 194, 24, new ActButton.Callback() {
public void use(ActButton elem, Mode action) { 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 ...")); GuiChar.this.gm.displayGuiScreen(GuiLoading.makeWaitTask("Lade Welt ..."));
Dimension dim = UniverseRegistry.getBaseDimensions().get(GuiChar.this.dimension); Dimension dim = UniverseRegistry.getBaseDimensions().get(GuiChar.this.dimension);
GuiChar.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText())); GuiChar.this.gm.player.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 CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId()));
} }
} }
}, "Charakter erstellen")); }, "Charakter erstellen"));
@ -388,17 +388,17 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
if(value == Action.SEND || value == Action.UNFOCUS) { if(value == Action.SEND || value == Action.UNFOCUS) {
String name = elem.getText(); String name = elem.getText();
if(name.isEmpty()) if(name.isEmpty())
elem.setText(GuiChar.this.gm.thePlayer == null ? "..." : GuiChar.this.gm.thePlayer.getCustomNameTag()); elem.setText(GuiChar.this.gm.player == null ? "..." : GuiChar.this.gm.player.getCustomNameTag());
else if(GuiChar.this.gm.thePlayer != null) { else if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false; 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.templateButton.enabled = false;
this.dimension = new Random().zrange(UniverseRegistry.getBaseDimensions().size()); 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) { if(egg != null && egg.origin != null) {
Dimension dim = UniverseRegistry.getDimension(egg.origin); Dimension dim = UniverseRegistry.getDimension(egg.origin);
if(dim != null) { if(dim != null) {
@ -446,10 +446,10 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
public void drawOverlays() public void drawOverlays()
{ {
if(this.adjust != null) { if(this.adjust != null) {
float factor = this.gm.thePlayer.width > 2.15f ? 2.15f / this.gm.thePlayer.width : 1.0f; float factor = this.gm.player.width > 2.15f ? 2.15f / this.gm.player.width : 1.0f;
factor = this.gm.thePlayer.height > 3.0f && 3.0f / this.gm.thePlayer.height < factor ? 3.0f / this.gm.thePlayer.height : factor; 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 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) { if(this.gm.getNetHandler() != null) {
int initialSelection = this.gm.getNetHandler().getSelectedCharacter(); int initialSelection = this.gm.getNetHandler().getSelectedCharacter();
for(PlayerCharacter character : this.gm.getNetHandler().getCharacterList()) { 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.elements.add(new CharacterEntry(null, false));
this.setSelected(initialSelection); 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) 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.drawRect(x, y, 1, 44, 0xffaf0000);
Drawing.drawText(this.clazz.toString().isEmpty() ? "<Keine>" : this.clazz.toString(), x + 3, y, 0xffffffff); Drawing.drawText(this.clazz.toString().isEmpty() ? "<Keine>" : this.clazz.toString(), x + 3, y, 0xffffffff);
} }
public void select(boolean dclick, int mx, int my) 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); 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); super.init(width, height);
this.setDimensions(400, height, 32, height - 32); this.setDimensions(400, height, 32, height - 32);
this.elements.clear(); this.elements.clear();
if(this.gm.thePlayer != null && this.gm.thePlayer.getSpecies().classEnum != null) if(this.gm.player != null && this.gm.player.getSpecies().classEnum != null)
for(Enum clazz : this.gm.thePlayer.getSpecies().classEnum.getEnumConstants()) { for(Enum clazz : this.gm.player.getSpecies().classEnum.getEnumConstants()) {
this.elements.add(new ClassEntry(clazz)); this.elements.add(new ClassEntry(clazz));
} }
this.add(new NavButton(width - 198 * 2, height - 28, 194, 24, GuiChar.INSTANCE, "Zurück")); 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) { public void use(ActButton elem, Mode action) {
ClassEntry entry = this.getSelected(); ClassEntry entry = this.getSelected();
if(entry != null && GuiClass.this.gm.thePlayer != null) { if(entry != null && GuiClass.this.gm.player != null) {
GuiClass.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal())); GuiClass.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal()));
this.gm.displayGuiScreen(GuiChar.INSTANCE); 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) 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.drawRect(x, y, 1, 44, 0xffaf0000);
Drawing.drawText(this.species.name, x + 3, y, 0xff000000 | this.species.color1 | this.species.color2); Drawing.drawText(this.species.name, x + 3, y, 0xff000000 | this.species.color1 | this.species.color2);
if(this.species.classEnum != null) 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) 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); 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) { public void use(ActButton elem, Mode action) {
SpeciesEntry entry = this.getSelected(); SpeciesEntry entry = this.getSelected();
if(entry != null && GuiSpecies.this.gm.thePlayer != null) if(entry != null && GuiSpecies.this.gm.player != null)
GuiSpecies.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz))); 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) 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.upperChestInventory = upperInv;
this.lowerChestInventory = lowerInv; this.lowerChestInventory = lowerInv;
// this.allowUserInput = false; // this.allowUserInput = false;

View file

@ -213,7 +213,7 @@ public abstract class GuiContainer extends Gui
*/ */
public void initGui() public void initGui()
{ {
this.gm.thePlayer.openContainer = this.inventorySlots; this.gm.player.openContainer = this.inventorySlots;
// this.guiLeft = (this.width - this.xSize) / 2; // this.guiLeft = (this.width - this.xSize) / 2;
// this.guiTop = (this.height - this.ySize) / 2; // this.guiTop = (this.height - this.ySize) / 2;
// this.addButtons(); // this.addButtons();
@ -360,7 +360,7 @@ public abstract class GuiContainer extends Gui
ItemRenderer.disableStandardItemLighting(); ItemRenderer.disableStandardItemLighting();
// this.drawGuiContainerForegroundLayer(mouseX, mouseY); // this.drawGuiContainerForegroundLayer(mouseX, mouseY);
ItemRenderer.enableGUIStandardItemLighting(); ItemRenderer.enableGUIStandardItemLighting();
InventoryPlayer inventoryplayer = this.gm.thePlayer.inventory; InventoryPlayer inventoryplayer = this.gm.player.inventory;
ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack; ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack;
if(this.gm.itemCheat) if(this.gm.itemCheat)
itemstack = itemstack == null ? this.cheatStack : itemstack; 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) { 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(); StringBuilder sb = new StringBuilder();
for(int i = 0; i < list.size(); ++i) { for(int i = 0; i < list.size(); ++i) {
if(i != 0) if(i != 0)
@ -512,7 +512,7 @@ public abstract class GuiContainer extends Gui
ItemStack itemstack = slotIn.getStack(); ItemStack itemstack = slotIn.getStack();
boolean flag = false; boolean flag = false;
boolean flag1 = slotIn == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; 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; String s = null;
if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != 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() private void updateDragSplitting()
{ {
ItemStack itemstack = this.gm.thePlayer.inventory.getItemStack(); ItemStack itemstack = this.gm.player.inventory.getItemStack();
if (itemstack != null && this.dragSplitting) if (itemstack != null && this.dragSplitting)
{ {
@ -643,8 +643,8 @@ public abstract class GuiContainer extends Gui
return; return;
if(this.cheatStack != null) { if(this.cheatStack != null) {
Slot slot = this.getSlotAtPosition(mouseX, mouseY); Slot slot = this.getSlotAtPosition(mouseX, mouseY);
if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.thePlayer != null && slot.inventory == this.gm.thePlayer.inventory) if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.player != null && slot.inventory == this.gm.player.inventory)
this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1)); this.gm.player.sendQueue.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1));
if(mouseButton != 1 && !this.gm.ctrl()) if(mouseButton != 1 && !this.gm.ctrl())
this.cheatStack = null; this.cheatStack = null;
return; return;
@ -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)) if((mouseButton == 0 || mouseButton == 1 || mouseButton == 2) && this.clickSide(mouseX, mouseY, -1, this.gm.shift() || mouseButton == 1, this.gm.ctrl() || mouseButton == 2))
return; return;
if(mouseButton == 0) { 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()) for (CheatTab tab : CheatTab.values())
{ {
if (this.isInsideTab(tab, mouseX, mouseY)) if (this.isInsideTab(tab, mouseX, mouseY))
@ -711,7 +711,7 @@ public abstract class GuiContainer extends Gui
// else // else
if (!this.dragSplitting) if (!this.dragSplitting)
{ {
if (this.gm.thePlayer.inventory.getItemStack() == null) if (this.gm.player.inventory.getItemStack() == null)
{ {
// if (mouseButton == this.gm.bindTertiary.getKeyCode() + 100) // if (mouseButton == this.gm.bindTertiary.getKeyCode() + 100)
// { // {
@ -774,7 +774,7 @@ public abstract class GuiContainer extends Gui
if(this.gm == null || this.cheatStack != null) if(this.gm == null || this.cheatStack != null)
return; return;
Slot slot = this.getSlotAtPosition(mouseX, mouseY); 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) // if (this.clickedSlot != null && this.gm.touchscreen)
// { // {
@ -849,7 +849,7 @@ public abstract class GuiContainer extends Gui
{ {
for (Slot slot2 : this.inventorySlots.inventorySlots) 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); 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); 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) // 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; this.lastClickTime = 0L;
} }
@ -994,11 +994,11 @@ public abstract class GuiContainer extends Gui
slotId = slotIn.slotNumber; 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() { 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()) // if (keyCode == this.gm.bindTertiary.getKeyCode())
// { // {
@ -1034,7 +1034,7 @@ public abstract class GuiContainer extends Gui
*/ */
public void useHotbar(int slot) 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) // for (int i = 0; i < 9; ++i)
// { // {
@ -1054,9 +1054,9 @@ public abstract class GuiContainer extends Gui
*/ */
public void onGuiClosed() 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(); // 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) { 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 i = (ITEM_LIST.size() + 12 - 1) / 12 - 9;
int j = (int)((double)(this.currentScroll * (float)i) + 0.5D); 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(i1 >= 0 && i1 < ITEM_LIST.size()) {
if(slot >= 0 || instant) { 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 { else {
this.cheatStack = ITEM_LIST.get(i1).copy(); this.cheatStack = ITEM_LIST.get(i1).copy();

View file

@ -70,7 +70,7 @@ public class GuiEnchant extends GuiContainer
int l = mouseX - 60; int l = mouseX - 60;
int i1 = mouseY - (14 + 19 * k); 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); this.gm.controller.sendEnchantPacket(this.container.windowId, k);
} }
@ -107,7 +107,7 @@ public class GuiEnchant extends GuiContainer
String s1 = "" + l1; String s1 = "" + l1;
int i2 = 6839882; 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, 14 + 19 * l, 108, 19, 0x400000);
this.rect(i1 + 1, 15 + 19 * l, 16, 16, 0x200000); this.rect(i1 + 1, 15 + 19 * l, 16, 16, 0x200000);
@ -171,7 +171,7 @@ public class GuiEnchant extends GuiContainer
// sb.append("\n"); // 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])); 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) 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.playerInventory = playerInv;
this.hopperInventory = hopperInv; this.hopperInventory = hopperInv;
// this.allowUserInput = false; // this.allowUserInput = false;

View file

@ -27,7 +27,7 @@ public class GuiHorse extends GuiContainer
public GuiHorse(IInventory playerInv, IInventory horseInv, EntityHorse horse) 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.playerInventory = playerInv;
this.horseInventory = horseInv; this.horseInventory = horseInv;
// this.horseEntity = horse; // this.horseEntity = horse;

View file

@ -16,7 +16,7 @@ public class GuiMachine extends GuiContainer
public GuiMachine(InventoryPlayer player, IInventory inv, TileEntityMachine machine) 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.playerInv = player;
this.machineInv = machine; this.machineInv = machine;
// this.allowUserInput = false; // this.allowUserInput = false;

View file

@ -21,7 +21,7 @@ public class GuiRepair extends GuiContainer implements ICrafting
public GuiRepair(InventoryPlayer inventoryIn, World worldIn) 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.playerInventory = inventoryIn;
this.anvil = (ContainerRepair)this.inventorySlots; this.anvil = (ContainerRepair)this.inventorySlots;
} }

View file

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

View file

@ -202,7 +202,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); // this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
this.gameController.loadWorld(this.clientWorldController, packetIn.getEntityType()); this.gameController.loadWorld(this.clientWorldController, packetIn.getEntityType());
// this.gameController.thePlayer.dimension = this.clientWorldController.dimension.getDimensionId(); // 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.gameController.displayGuiScreen(this.gameController.charEditor ? GuiChar.INSTANCE : null);
// this.currentServerMaxPlayers = packetIn.getMaxPlayers(); // this.currentServerMaxPlayers = packetIn.getMaxPlayers();
// this.gameController.controller.setCheat(packetIn.getCheat()); // this.gameController.controller.setCheat(packetIn.getCheat());
@ -465,7 +465,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
entity.getDataWatcher().updateWatchedObjectsFromList(packetIn.func_149376_c()); 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(); ((GuiChar)this.gameController.open).checkReopen();
} }
} }
@ -481,7 +481,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
double z = (double)packetIn.getZ() / 32.0D; double z = (double)packetIn.getZ() / 32.0D;
float yaw = packetIn.getYaw(); float yaw = packetIn.getYaw();
float pitch = packetIn.getPitch(); float pitch = packetIn.getPitch();
EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.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.setOtherPlayer(this.gameController);
player.prevX = player.lastTickPosX = (double)(player.serverPosX = packetIn.getX()); player.prevX = player.lastTickPosX = (double)(player.serverPosX = packetIn.getX());
player.prevY = player.lastTickPosY = (double)(player.serverPosY = packetIn.getY()); player.prevY = player.lastTickPosY = (double)(player.serverPosY = packetIn.getY());
@ -551,7 +551,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (packetIn.getHeldItemHotbarIndex() >= 0 && packetIn.getHeldItemHotbarIndex() < InventoryPlayer.getHotbarSize()) 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) public void handlePlayerPosLook(SPacketPlayerPosLook packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer; EntityNPC entityplayer = this.gameController.player;
double d0 = packetIn.getX(); double d0 = packetIn.getX();
double d1 = packetIn.getY(); double d1 = packetIn.getY();
double d2 = packetIn.getZ(); double d2 = packetIn.getZ();
@ -669,9 +669,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (!this.doneLoadingTerrain) if (!this.doneLoadingTerrain)
{ {
this.gameController.thePlayer.prevX = this.gameController.thePlayer.posX; this.gameController.player.prevX = this.gameController.player.posX;
this.gameController.thePlayer.prevY = this.gameController.thePlayer.posY; this.gameController.player.prevY = this.gameController.player.posY;
this.gameController.thePlayer.prevZ = this.gameController.thePlayer.posZ; this.gameController.player.prevZ = this.gameController.player.posZ;
this.doneLoadingTerrain = true; this.doneLoadingTerrain = true;
// this.gameController.displayGuiScreen(null); // this.gameController.displayGuiScreen(null);
// if(this.travelSound) { // if(this.travelSound) {
@ -769,7 +769,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (entitylivingbase == null) if (entitylivingbase == null)
{ {
entitylivingbase = this.gameController.thePlayer; entitylivingbase = this.gameController.player;
} }
if (entity != null) if (entity != null)
@ -907,7 +907,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
double d2 = (double)packetIn.getZ() / 32.0D; double d2 = (double)packetIn.getZ() / 32.0D;
float f = (float)(packetIn.getYaw() * 360) / 256.0F; float f = (float)(packetIn.getYaw() * 360) / 256.0F;
float f1 = (float)(packetIn.getPitch() * 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.serverPosX = packetIn.getX();
entitylivingbase.serverPosY = packetIn.getY(); entitylivingbase.serverPosY = packetIn.getY();
entitylivingbase.serverPosZ = packetIn.getZ(); entitylivingbase.serverPosZ = packetIn.getZ();
@ -942,7 +942,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
// this.gameController.theWorld.getWorldInfo().setTime(packetIn.getTotalWorldTime()); // this.gameController.theWorld.getWorldInfo().setTime(packetIn.getTotalWorldTime());
this.gameController.theWorld.setDayTime(packetIn.getWorldTime()); this.gameController.world.setDayTime(packetIn.getWorldTime());
this.gameController.setTicked(packetIn.getServerinfo()); this.gameController.setTicked(packetIn.getServerinfo());
} }
@ -968,9 +968,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
// boolean flag = false; // 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) if (entity1 instanceof EntityBoat)
{ {
@ -1036,7 +1036,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleUpdateHealth(SPacketUpdateHealth packetIn) public void handleUpdateHealth(SPacketUpdateHealth packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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().setFoodLevel(packetIn.getFoodLevel());
// this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(packetIn.getSaturationLevel()); // this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(packetIn.getSaturationLevel());
} }
@ -1044,7 +1044,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleSetExperience(SPacketSetExperience packetIn) public void handleSetExperience(SPacketSetExperience packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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) public void handleRespawn(SPacketRespawn packetIn)
@ -1080,11 +1080,11 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleExplosion(S27PacketExplosion packetIn) public void handleExplosion(S27PacketExplosion packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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()); explosion.doExplosionB(true, packetIn.hasAltSound());
this.gameController.thePlayer.motionX += (double)packetIn.func_149149_c(); this.gameController.player.motionX += (double)packetIn.func_149149_c();
this.gameController.thePlayer.motionY += (double)packetIn.func_149144_d(); this.gameController.player.motionY += (double)packetIn.func_149144_d();
this.gameController.thePlayer.motionZ += (double)packetIn.func_149147_e(); 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) public void handleOpenWindow(S2DPacketOpenWindow packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayersp = this.gameController.thePlayer; EntityNPC entityplayersp = this.gameController.player;
if ("container".equals(packetIn.getGuiId())) if ("container".equals(packetIn.getGuiId()))
{ {
@ -1128,7 +1128,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
TileEntity machine = this.clientWorldController.getTileEntity(packetIn.getTilePos()); TileEntity machine = this.clientWorldController.getTileEntity(packetIn.getTilePos());
if(machine instanceof TileEntityMachine) 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 { else {
entityplayersp.displayGUIChest(containerlocalmenu); entityplayersp.displayGUIChest(containerlocalmenu);
@ -1143,7 +1143,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleSetSlot(S2FPacketSetSlot packetIn) public void handleSetSlot(S2FPacketSetSlot packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer; EntityNPC entityplayer = this.gameController.player;
if (packetIn.getWindowId() == -1) if (packetIn.getWindowId() == -1)
{ {
@ -1185,7 +1185,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
Container container = null; Container container = null;
EntityNPC entityplayer = this.gameController.thePlayer; EntityNPC entityplayer = this.gameController.player;
if (packetIn.getWindowId() == 0) if (packetIn.getWindowId() == 0)
{ {
@ -1208,7 +1208,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
public void handleWindowItems(S30PacketWindowItems packetIn) public void handleWindowItems(S30PacketWindowItems packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer; EntityNPC entityplayer = this.gameController.player;
if (packetIn.func_148911_c() == 0) if (packetIn.func_148911_c() == 0)
{ {
@ -1235,7 +1235,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
tileentity.setPos(packetIn.getSignPosition()); 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); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
// boolean flag = false; // 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) if (tileentity instanceof TileEntitySign)
{ {
@ -1280,9 +1280,9 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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(); // 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) 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) public void handleWindowProperty(S31PacketWindowProperty packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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()) 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) public void handleBlockAction(SPacketBlockAction packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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) public void handleBlockBreakAnim(SPacketBlockBreakAnim packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); 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) public void handleMapChunkBulk(SPacketMapChunkBulk packetIn)
@ -1403,7 +1403,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// } // }
// else // 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) public void handlePlayerAbilities(S39PacketPlayerAbilities packetIn)
{ {
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController); NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
EntityNPC entityplayer = this.gameController.thePlayer; EntityNPC entityplayer = this.gameController.player;
entityplayer.flying = packetIn.isFlying(); entityplayer.flying = packetIn.isFlying();
entityplayer.noclip = packetIn.isNoclip(); entityplayer.noclip = packetIn.isNoclip();
// entityplayer.speed = packetIn.getSpeed(); // entityplayer.speed = packetIn.getSpeed();
@ -1629,7 +1629,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// else if(packetIn.getSoundName().startsWith("music#")) { // else if(packetIn.getSoundName().startsWith("music#")) {
// return; // 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) // public void handleDisplay(S48PacketDisplay packetIn)
@ -1901,7 +1901,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
int i = packetIn.getWindowId(); int i = packetIn.getWindowId();
Gui gui = this.gameController.open; 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(); // NpcMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
MerchantRecipeList merchantrecipelist = packetIn.getTrades(); MerchantRecipeList merchantrecipelist = packetIn.getTrades();

View file

@ -129,10 +129,10 @@ public class EntityRenderer {
if (this.gm.getRenderViewEntity() == null) 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)); // Log.info(String.format("%.3f", light));
float dist = (float)this.gm.renderDistance / 32.0F; float dist = (float)this.gm.renderDistance / 32.0F;
float shift = light * (1.0F - dist) + dist; float shift = light * (1.0F - dist) + dist;
@ -186,10 +186,10 @@ public class EntityRenderer {
if (entity != null) if (entity != null)
{ {
if (this.gm.theWorld != null) if (this.gm.world != null)
{ {
this.gm.setPointedEntity(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); this.gm.pointed = entity.rayTrace(max, partialTicks);
double dist = max; double dist = max;
Vec3 eye = entity.getPositionEyes(partialTicks); Vec3 eye = entity.getPositionEyes(partialTicks);
@ -219,7 +219,7 @@ public class EntityRenderer {
this.pointedEntity = null; this.pointedEntity = null;
Vec3 hit = null; Vec3 hit = null;
float exp = 1.0F; 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_) public boolean test(Entity p_apply_1_)
{ {
@ -502,7 +502,7 @@ public class EntityRenderer {
f3 = f3 * 0.1F; f3 = f3 * 0.1F;
f4 = f4 * 0.1F; f4 = f4 * 0.1F;
f5 = f5 * 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) if (movingobjectposition != null)
{ {
@ -749,7 +749,7 @@ public class EntityRenderer {
{ {
if (this.lightmapUpdateNeeded) if (this.lightmapUpdateNeeded)
{ {
WorldClient world = this.gm.theWorld; WorldClient world = this.gm.world;
if (world != null) if (world != null)
{ {
@ -792,9 +792,9 @@ public class EntityRenderer {
// f10 = 0.25F + f7 * 0.75F; // 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; float mult = 1.0F / red;
if (mult > 1.0F / green) if (mult > 1.0F / green)
@ -926,7 +926,7 @@ public class EntityRenderer {
if (this.gm.getRenderViewEntity() == null) if (this.gm.getRenderViewEntity() == null)
{ {
this.gm.setRenderViewEntity(this.gm.thePlayer); this.gm.setRenderViewEntity(this.gm.player);
} }
this.getMouseOver(partialTicks); this.getMouseOver(partialTicks);
@ -958,7 +958,7 @@ public class EntityRenderer {
this.updateFogColor(partialTicks); this.updateFogColor(partialTicks);
GL11.glClear(16640); GL11.glClear(16640);
this.setupCameraTransform(partialTicks); 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(); Entity entity = this.gm.getRenderViewEntity();
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
@ -981,14 +981,14 @@ public class EntityRenderer {
this.setupFog(0, partialTicks); this.setupFog(0, partialTicks);
GlState.shadeModel(GL11.GL_SMOOTH); 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.renderCloudsCheck(renderglobal, partialTicks);
} }
this.setupFog(0, partialTicks); this.setupFog(0, partialTicks);
this.gm.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); this.gm.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
ItemRenderer.disableStandardItemLighting(); 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); this.gm.renderGlobal.updateChunks(finishTimeNano);
GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix(); GL11.glPushMatrix();
@ -1073,7 +1073,7 @@ public class EntityRenderer {
GlState.disableBlend(); GlState.disableBlend();
GlState.disableFog(); 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); this.renderCloudsCheck(renderglobal, partialTicks);
} }
@ -1096,7 +1096,7 @@ public class EntityRenderer {
GL11.glPushMatrix(); GL11.glPushMatrix();
this.setupFog(0, partialTicks); this.setupFog(0, partialTicks);
// renderGlobalIn.renderClouds(partialTicks); // renderGlobalIn.renderClouds(partialTicks);
if(this.gm.theWorld.dimension.getType().clouds) if(this.gm.world.dimension.getType().clouds)
renderGlobalIn.renderClouds(partialTicks); renderGlobalIn.renderClouds(partialTicks);
GlState.disableFog(); GlState.disableFog();
GL11.glPopMatrix(); GL11.glPopMatrix();
@ -1109,7 +1109,7 @@ public class EntityRenderer {
private void addRainParticles() private void addRainParticles()
{ {
float f = this.gm.theWorld.getRainStrength(); float f = this.gm.world.getRainStrength();
// if (this.gm.downfallSetting != 0) // if (this.gm.downfallSetting != 0)
// { // {
@ -1120,7 +1120,7 @@ public class EntityRenderer {
{ {
this.random.setSeed((long)this.rendererUpdateCount * 312987231L); this.random.setSeed((long)this.rendererUpdateCount * 312987231L);
Entity entity = this.gm.getRenderViewEntity(); Entity entity = this.gm.getRenderViewEntity();
World world = this.gm.theWorld; World world = this.gm.world;
BlockPos blockpos = new BlockPos(entity); BlockPos blockpos = new BlockPos(entity);
int i = 10; int i = 10;
double d0 = 0.0D; double d0 = 0.0D;
@ -1166,7 +1166,7 @@ public class EntityRenderer {
} }
} }
if(temp < 194.0f || this.random.chance(5)) 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) else if (block.getMaterial() != Material.air)
{ {
@ -1180,7 +1180,7 @@ public class EntityRenderer {
d2 = (double)blockpos2.getZ() + d4; 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())) 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 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) 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) if (f > 0.0F) // && this.gm.downfallSetting < 2)
{ {
this.enableLightmap(); this.enableLightmap();
Entity entity = this.gm.getRenderViewEntity(); Entity entity = this.gm.getRenderViewEntity();
World world = this.gm.theWorld; World world = this.gm.world;
int i = ExtMath.floord(entity.posX); int i = ExtMath.floord(entity.posX);
int j = ExtMath.floord(entity.posY); int j = ExtMath.floord(entity.posY);
int k = ExtMath.floord(entity.posZ); int k = ExtMath.floord(entity.posZ);
@ -1411,7 +1411,7 @@ public class EntityRenderer {
*/ */
private void updateFogColor(float partial) private void updateFogColor(float partial)
{ {
WorldClient world = this.gm.theWorld; WorldClient world = this.gm.world;
Entity entity = this.gm.getRenderViewEntity(); Entity entity = this.gm.getRenderViewEntity();
float dist = 0.25F + 0.75F * (float)this.gm.renderDistance / 32.0F; float dist = 0.25F + 0.75F * (float)this.gm.renderDistance / 32.0F;
dist = 1.0F - (float)Math.pow((double)dist, 0.25D); dist = 1.0F - (float)Math.pow((double)dist, 0.25D);
@ -1473,7 +1473,7 @@ public class EntityRenderer {
this.fogColorBlue *= mul; this.fogColorBlue *= mul;
} }
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.gm.theWorld, entity, partial); Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.gm.world, entity, partial);
// if (this.cloudFog) // if (this.cloudFog)
// { // {
@ -1586,7 +1586,7 @@ public class EntityRenderer {
private void setupFog(int start, float partial) private void setupFog(int start, float partial)
{ {
Entity entity = this.gm.getRenderViewEntity(); 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 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)); float density = 1.0f - Math.min(1.0f, FOG_DENSITY * (1.0f - fog * 0.1f));
// boolean flag = false; // 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.glFogfv(GL11.GL_FOG_COLOR, (FloatBuffer)this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F));
GL11.glNormal3f(0.0F, -1.0F, 0.0F); GL11.glNormal3f(0.0F, -1.0F, 0.0F);
GlState.color(1.0F, 1.0F, 1.0F, 1.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) { if(distance >= 1.0f) {
; ;
@ -1676,7 +1676,7 @@ public class EntityRenderer {
// SKC.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); // 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.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)); 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) 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 f = (float)(i & 65535);
float f1 = (float)(i >> 16); float f1 = (float)(i >> 16);
GL13.glMultiTexCoord2f(GL13.GL_TEXTURE1, f, f1); 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.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glScalef(1.0F, 1.0F, 1.0F);
GL11.glTranslatef(5.6F, 0.0F, 0.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(); GlState.disableCull();
render.renderPlayerArm(this.gm.thePlayer); render.renderPlayerArm(this.gm.player);
GlState.enableCull(); GlState.enableCull();
} }
@ -407,7 +407,7 @@ public class ItemRenderer
public void renderItemInFirstPerson(float partialTicks) public void renderItemInFirstPerson(float partialTicks)
{ {
float f = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * 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 f1 = clientplayer.getSwingProgress(partialTicks);
float f2 = clientplayer.prevPitch + (clientplayer.rotPitch - clientplayer.prevPitch) * partialTicks; float f2 = clientplayer.prevPitch + (clientplayer.rotPitch - clientplayer.prevPitch) * partialTicks;
float f3 = clientplayer.prevYaw + (clientplayer.rotYaw - clientplayer.prevYaw) * partialTicks; float f3 = clientplayer.prevYaw + (clientplayer.rotYaw - clientplayer.prevYaw) * partialTicks;
@ -475,10 +475,10 @@ public class ItemRenderer
{ {
GlState.disableAlpha(); GlState.disableAlpha();
if (this.gm.thePlayer.isEntityInsideOpaqueBlock()) if (this.gm.player.isEntityInsideOpaqueBlock())
{ {
State iblockstate = this.gm.theWorld.getState(new BlockPos(this.gm.thePlayer)); State iblockstate = this.gm.world.getState(new BlockPos(this.gm.player));
EntityNPC entityplayer = this.gm.thePlayer; EntityNPC entityplayer = this.gm.player;
for (int i = 0; i < 8; ++i) 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 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); 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); 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()) if (iblockstate1.getBlock().isVisuallyOpaque())
{ {
@ -500,7 +500,7 @@ public class ItemRenderer
} }
} }
if(this.gm.thePlayer.isBurning()) { if(this.gm.player.isBurning()) {
this.renderFireInFirstPerson(partialTicks); this.renderFireInFirstPerson(partialTicks);
} }
@ -590,7 +590,7 @@ public class ItemRenderer
public void updateEquippedItem() public void updateEquippedItem()
{ {
this.prevEquippedProgress = this.equippedProgress; this.prevEquippedProgress = this.equippedProgress;
EntityNPC entityplayer = this.gm.thePlayer; EntityNPC entityplayer = this.gm.player;
ItemStack itemstack = entityplayer.inventory.getCurrentItem(); ItemStack itemstack = entityplayer.inventory.getCurrentItem();
boolean flag = false; boolean flag = false;

View file

@ -560,7 +560,7 @@ public class RenderGlobal
GlState.enableAlpha(); GlState.enableAlpha();
} }
if (this.gm.renderOutlines && this.gm.thePlayer != null) if (this.gm.renderOutlines && this.gm.player != null)
{ {
GlState.depthFunc(GL11.GL_ALWAYS); GlState.depthFunc(GL11.GL_ALWAYS);
GlState.disableFog(); GlState.disableFog();
@ -575,7 +575,7 @@ public class RenderGlobal
{ {
Entity entity3 = list.get(j); Entity entity3 = list.get(j);
if ((entity3 != this.gm.getRenderViewEntity() || this.gm.thirdPersonView != 0) && 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); // this.renderManager.renderEntity(entity3, partialTicks);
int c = ((EntityLiving)entity3).getColor(); int c = ((EntityLiving)entity3).getColor();
@ -623,7 +623,7 @@ public class RenderGlobal
} }
entity2 = (Entity)iterator.next(); 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) if (!flag2)
{ {
@ -1125,11 +1125,11 @@ public class RenderGlobal
public void renderSky(float partialTicks) 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(); GlState.disableTexture2D();
Vec3 vec3 = this.theWorld.getSkyColor(this.gm.getRenderViewEntity(), partialTicks); 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); GlState.color(1.0F, 1.0F, 1.0F, f16);
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(this.theWorld.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.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; float size = 30.0F;
this.renderEngine.bindTexture(SUN_TEX); this.renderEngine.bindTexture(SUN_TEX);
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_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(); worldrenderer.pos((double)(-size), 100.0D, (double)size).tex(0.0D, 1.0D).endVertex();
Tessellator.draw(); Tessellator.draw();
} }
if(this.gm.theWorld.dimension.getType().moon) { if(this.gm.world.dimension.getType().moon) {
float size = 20.0F; float size = 20.0F;
this.renderEngine.bindTexture(MOON_TEX); this.renderEngine.bindTexture(MOON_TEX);
int i = this.theWorld.getMoonPhase(); int i = this.theWorld.getMoonPhase();
@ -1332,7 +1332,7 @@ public class RenderGlobal
int j = ExtMath.floord(d2 / 2048.0D); int j = ExtMath.floord(d2 / 2048.0D);
d1 = d1 - (double)(i * 2048); d1 = d1 - (double)(i * 2048);
d2 = d2 - (double)(j * 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.enableBlend();
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); 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); 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 d2 = entity.angler.prevZ + (entity.angler.posZ - entity.angler.prevZ) * (double)partialTicks + vec3.zCoord;
double d3 = (double)entity.angler.getEyeHeight(); 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; float f9 = (entity.angler.prevYawOffset + (entity.angler.yawOffset - entity.angler.prevYawOffset) * partialTicks) * (float)Math.PI / 180.0F;
double d4 = (double)ExtMath.sin(f9); 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) 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()) // if(entity.isBoss())
// BossStatus.setBossStatus(entity); // BossStatus.setBossStatus(entity);
double d0 = y; 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; d0 = y - 0.125D;
this.setModelVisibilities(entity); this.setModelVisibilities(entity);
super.doRender(entity, x, d0, z, partialTicks); 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 final List<LogMessage> LOG = Lists.newArrayList();
private static LogLevel level = LogLevel.INFO; private static LogLevel level = LogLevel.INFO;
private static boolean colors = true;
private static IThreadListener sync = new IThreadListener() { private static IThreadListener sync = new IThreadListener() {
public ListenableFuture<Object> schedule(Runnable run) { public ListenableFuture<Object> schedule(Runnable run) {
return null; return null;
@ -71,6 +72,7 @@ public enum Log {
if(pos - last != 0) if(pos - last != 0)
System.err.print(str.substring(last, pos)); 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]; color = TextColor.getColor(c); // (c >= CHR_COLORS2) && (c <= CHR_COLORE2) ? aux_colors[c - CHR_COLORS2] : text_colors[c - CHR_COLORS1];
if(colors)
System.err.printf("\u001b[38;2;%d;%d;%dm", (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff); System.err.printf("\u001b[38;2;%d;%d;%dm", (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
last = ++pos; last = ++pos;
continue; continue;
@ -78,6 +80,7 @@ public enum Log {
else if(c == CHR_CRESET) { else if(c == CHR_CRESET) {
if(pos - last != 0) if(pos - last != 0)
System.err.print(str.substring(last, pos)); System.err.print(str.substring(last, pos));
if(colors)
System.err.print("\u001b[0m"); System.err.print("\u001b[0m");
last = ++pos; last = ++pos;
continue; continue;
@ -99,7 +102,7 @@ public enum Log {
if(pos >= str.length() && pos - last != 0) if(pos >= str.length() && pos - last != 0)
System.err.print(str.substring(last, pos)); 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) { public static String str_time(long time) {
@ -112,6 +115,7 @@ public enum Log {
public static void init(IThreadListener sync) { public static void init(IThreadListener sync) {
Log.sync = sync; Log.sync = sync;
Log.colors = System.getProperty("log.nocolor") == null && !Util.WINDOWS;
} }
public static void flushLog() { public static void flushLog() {

View file

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