universe cleanup
This commit is contained in:
parent
cf37d48292
commit
9b5eab4f57
68 changed files with 553 additions and 369 deletions
|
@ -1728,7 +1728,7 @@ public class Client implements IThreadListener {
|
|||
ChunkClient chunk = this.world.getChunk(blockpos);
|
||||
biome = chunk.getBiome(blockpos);
|
||||
bline = "Biom: " + biome.display + " (" + biome.name + "), D: " +
|
||||
TextColor.stripCodes(this.world.dimension.getNameString()) +
|
||||
TextColor.stripCodes(this.world.dimension.getDisplay()) +
|
||||
" (" + (this.dimensionName == null ? UniverseRegistry.getName(this.world.dimension) : this.dimensionName) + ")";
|
||||
lline = "Licht: " + chunk.getLightSub(blockpos, 0) + " (" + chunk.getLight(LightType.SKY, blockpos) + " Himmel, "
|
||||
+ chunk.getLight(LightType.BLOCK, blockpos) + " Blöcke, " + String.format(
|
||||
|
@ -1737,7 +1737,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
else {
|
||||
bline = "Biom: <?>, D: " +
|
||||
TextColor.stripCodes(this.world.dimension.getNameString()) +
|
||||
TextColor.stripCodes(this.world.dimension.getDisplay()) +
|
||||
" (" + (this.dimensionName == null ? UniverseRegistry.getName(this.world.dimension) : this.dimensionName) + ")";
|
||||
lline = "Licht: " + String.format(
|
||||
"%.1f", this.world.getSunBrightness(1.0f) * 15.0f) + " Welt, A: "
|
||||
|
|
|
@ -454,7 +454,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
|
|||
|
||||
private void setDimButton() {
|
||||
Dimension dim = DIMENSIONS.get(this.dimension);
|
||||
this.dimButton.setText((dim.getType() == DimType.PLANET ? "Heimplanet" : "Heimdimension") + ": " + dim.getNameString());
|
||||
this.dimButton.setText((dim.getType() == DimType.PLANET ? "Heimplanet" : "Heimdimension") + ": " + dim.getDisplay());
|
||||
this.descLines.setText(Util.buildLines(dim.getBaseNames()));
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import client.gui.element.PressType;
|
|||
import client.renderer.Drawing;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.PlayerCharacter;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.packet.CPacketAction;
|
||||
import common.packet.CPacketAction.Action;
|
||||
import common.util.ExtMath;
|
||||
|
@ -76,7 +77,7 @@ public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> impleme
|
|||
this.elements.clear();
|
||||
int selected = this.gm.selectedCharacter;
|
||||
for(PlayerCharacter character : this.gm.characterList) {
|
||||
this.elements.add(new CharacterEntry(selected == this.elements.size() ? new PlayerCharacter(character.name(), character.info(), character.align(), this.gm.player.worldObj.dimension.getNameString(), this.gm.player.getPosition(), character.type(), this.gm.player.experienceLevel) : character, selected == this.elements.size()));
|
||||
this.elements.add(new CharacterEntry(selected == this.elements.size() ? new PlayerCharacter(character.name(), character.info(), character.align(), this.gm.player.worldObj.dimension.getDisplay(), this.gm.player.getPosition(), character.type(), this.gm.player.experienceLevel, UniverseRegistry.getName(this.gm.player.getOrigin().getDimension())) : character, selected == this.elements.size()));
|
||||
}
|
||||
if(!this.gm.charEditor)
|
||||
this.elements.add(new CharacterEntry(null, false));
|
||||
|
|
|
@ -75,7 +75,7 @@ public class GuiCreateDimension extends Gui {
|
|||
}
|
||||
dtag.merge(ptag);
|
||||
dim.fromTags(dtag);
|
||||
dim.setCustomName(display);
|
||||
dim.setDisplay(display);
|
||||
PRESETS.add(dim);
|
||||
return dim;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class GuiGameOver extends Gui {
|
|||
public void init(int width, int height) {
|
||||
this.timer = 0;
|
||||
this.add(new Label(0, 0, 400, 0, TextColor.DRED + "Du bist gestorben!"));
|
||||
this.add(new MultiLabel(0, 32, 400, 42, String.format(TextColor.GREEN + "Letzte Position" + TextColor.GRAY + ":\n" + TextColor.YELLOW + "%d, %d, %d\n" + TextColor.YELLOW + "%s", ExtMath.floord(this.gm.player.posX), ExtMath.floord(this.gm.player.posY), ExtMath.floord(this.gm.player.posZ), this.gm.player.worldObj.dimension.getNameString())));
|
||||
this.add(new MultiLabel(0, 32, 400, 42, String.format(TextColor.GREEN + "Letzte Position" + TextColor.GRAY + ":\n" + TextColor.YELLOW + "%d, %d, %d\n" + TextColor.YELLOW + "%s", ExtMath.floord(this.gm.player.posX), ExtMath.floord(this.gm.player.posY), ExtMath.floord(this.gm.player.posZ), this.gm.player.worldObj.dimension.getDisplay())));
|
||||
this.button = this.add(new ActButton(100, 100, 200, 0, new ButtonCallback() {
|
||||
public void use(ActButton elem, PressType action) {
|
||||
GuiGameOver.this.gm.player.respawnPlayer();
|
||||
|
|
|
@ -18,7 +18,7 @@ public class GuiSign extends Gui implements FieldCallback {
|
|||
public void init(int width, int height) {
|
||||
this.add(new Label(0, -140, 300, 0, "Bearbeite Schild"));
|
||||
this.add(new Label(0, -80, 300, 0, String.format("%d, %d, %d", this.position.getX(), this.position.getY(), this.position.getZ())));
|
||||
this.add(new Label(0, -50, 300, 0, this.gm.world == null ? "<?>" : this.gm.world.dimension.getNameString()));
|
||||
this.add(new Label(0, -50, 300, 0, this.gm.world == null ? "<?>" : this.gm.world.dimension.getDisplay()));
|
||||
for(int z = 0; z < this.lines.length; z++) {
|
||||
this.lines[z] = this.add(new Field(0, 40 * z, 300, 0, 50, this, this.tempLines[z] == null ? "" : this.tempLines[z]));
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import common.block.tech.BlockDispenser;
|
|||
import common.block.tech.BlockFurnace;
|
||||
import common.block.tech.BlockWorkbench;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.DataWatcher;
|
||||
import common.entity.Entity;
|
||||
|
@ -46,6 +47,7 @@ import common.init.Blocks;
|
|||
import common.init.EntityRegistry;
|
||||
import common.init.ItemRegistry;
|
||||
import common.init.SoundEvent;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.inventory.Container;
|
||||
import common.inventory.InventoryBasic;
|
||||
import common.inventory.InventoryPlayer;
|
||||
|
@ -128,6 +130,7 @@ import common.tileentity.Device;
|
|||
import common.tileentity.TileEntityDisplay;
|
||||
import common.tileentity.TileEntitySign;
|
||||
import common.util.Pair;
|
||||
import common.util.WorldPos;
|
||||
import common.village.MerchantRecipeList;
|
||||
import common.world.Explosion;
|
||||
import common.world.Weather;
|
||||
|
@ -1628,6 +1631,10 @@ public class ClientPlayer implements IClientPlayer
|
|||
else if(this.gm.open instanceof GuiChar guichar) {
|
||||
guichar.setCharsAvailable();
|
||||
}
|
||||
if(!this.gm.charEditor && this.gm.player != null && this.gm.selectedCharacter >= 0 && this.gm.selectedCharacter < this.gm.characterList.size()) {
|
||||
Dimension dim = UniverseRegistry.getDimension(this.gm.characterList.get(this.gm.selectedCharacter).origin());
|
||||
this.gm.player.setOrigin(new WorldPos(0, 0, 0, dim == null ? Space.INSTANCE : dim));
|
||||
}
|
||||
}
|
||||
|
||||
public void handleKeepAlive(SPacketKeepAlive packetIn)
|
||||
|
@ -1885,7 +1892,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
public void handleDimName(SPacketDimensionName packet) {
|
||||
NetHandler.checkThread(packet, this, this.gm, this.world);
|
||||
if(this.world.dimension.isCustom()) {
|
||||
this.world.dimension.setCustomName(packet.getCustomName());
|
||||
this.world.dimension.setDisplay(packet.getCustomName());
|
||||
this.world.dimension.setBaseNames(packet.getFullName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,14 @@ import client.Client;
|
|||
import client.network.ClientPlayer;
|
||||
import client.world.WorldClient;
|
||||
import common.block.Block;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.EntityRegistry;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.item.block.ItemBlock;
|
||||
|
@ -20,6 +23,7 @@ import common.sound.PositionedSound;
|
|||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.Vec3;
|
||||
import common.util.WorldPos;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -284,6 +288,10 @@ public class PlayerController {
|
|||
public EntityNPC createPlayerEntity(WorldClient world, int type) {
|
||||
EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(type, world);
|
||||
player.setClientPlayer(this.handler);
|
||||
if(!this.gm.charEditor && this.gm.selectedCharacter >= 0 && this.gm.selectedCharacter < this.gm.characterList.size()) {
|
||||
Dimension dim = UniverseRegistry.getDimension(this.gm.characterList.get(this.gm.selectedCharacter).origin());
|
||||
player.setOrigin(new WorldPos(0, 0, 0, dim == null ? Space.INSTANCE : dim));
|
||||
}
|
||||
return player;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue