From 6e77090c5b56bf3c3b4aa1fcc1c053e1a086399b Mon Sep 17 00:00:00 2001 From: Sen Date: Tue, 13 May 2025 17:02:57 +0200 Subject: [PATCH] server client split world classes --- client/src/client/Client.java | 104 +------ client/src/client/PlayerController.java | 4 +- client/src/client/gui/GuiConsole.java | 4 +- client/src/client/gui/character/GuiChar.java | 10 +- client/src/client/gui/character/GuiClass.java | 2 +- .../src/client/gui/character/GuiSpecies.java | 2 +- .../client/gui/container/GuiContainer.java | 4 +- .../client/network/ClientLoginHandler.java | 1 + client/src/client/network/ClientPlayer.java | 51 +++- .../src/client/renderer/EntityRenderer.java | 2 +- client/src/client/renderer/RenderGlobal.java | 2 +- .../client/renderer/particle/EntityFX.java | 3 +- .../renderer/particle/EntityFirework.java | 2 +- .../particle/EntityParticleEmitter.java | 2 +- .../src/client}/world/EmptyChunk.java | 4 +- .../src/client}/world/WorldClient.java | 54 ++-- common/src/common/IClient.java | 34 --- common/src/common/IServer.java | 25 -- common/src/common/ai/EntityAIFleeSun.java | 4 +- common/src/common/ai/EntityAIMoveIndoors.java | 6 +- .../common/ai/EntityAIMoveThroughVillage.java | 6 +- common/src/common/ai/EntityAINpcMate.java | 4 +- .../common/ai/EntityAIRestrictOpenDoor.java | 8 +- common/src/common/ai/EntityAIRestrictSun.java | 4 +- .../src/common/ai/EntityAIWatchClosest.java | 4 +- common/src/common/biome/Biome.java | 8 +- common/src/common/biome/BiomeChaos.java | 4 +- common/src/common/biome/BiomeDesert.java | 4 +- .../src/common/biome/BiomeExterminated.java | 4 +- common/src/common/biome/BiomeForest.java | 6 +- common/src/common/biome/BiomeHell.java | 4 +- common/src/common/biome/BiomeHills.java | 6 +- common/src/common/biome/BiomeJungle.java | 4 +- common/src/common/biome/BiomeMesa.java | 6 +- common/src/common/biome/BiomeMoon.java | 4 +- common/src/common/biome/BiomeMutated.java | 8 +- common/src/common/biome/BiomeNone.java | 6 +- common/src/common/biome/BiomePlains.java | 4 +- common/src/common/biome/BiomeSavanna.java | 8 +- common/src/common/biome/BiomeSnow.java | 4 +- common/src/common/biome/BiomeSpace.java | 4 +- common/src/common/biome/BiomeSwamp.java | 4 +- common/src/common/biome/BiomeTaiga.java | 6 +- common/src/common/biome/BiomeTian.java | 4 +- common/src/common/block/Block.java | 16 +- .../common/block/BlockBasePressurePlate.java | 8 +- common/src/common/block/BlockBedrock.java | 4 +- .../src/common/block/BlockBlackenedDirt.java | 4 +- .../src/common/block/BlockBlackenedSoil.java | 4 +- common/src/common/block/BlockBlueShroom.java | 4 +- .../src/common/block/BlockBrewingStand.java | 8 +- common/src/common/block/BlockBush.java | 4 +- common/src/common/block/BlockButton.java | 8 +- common/src/common/block/BlockCactus.java | 4 +- common/src/common/block/BlockChest.java | 6 +- common/src/common/block/BlockCocoa.java | 6 +- common/src/common/block/BlockContainer.java | 4 +- common/src/common/block/BlockCore.java | 6 +- common/src/common/block/BlockCrops.java | 6 +- .../common/block/BlockDaylightDetector.java | 8 +- common/src/common/block/BlockDispenser.java | 8 +- common/src/common/block/BlockDoublePlant.java | 6 +- common/src/common/block/BlockDragonEgg.java | 6 +- .../src/common/block/BlockDynamicLiquid.java | 6 +- .../common/block/BlockEnchantmentTable.java | 4 +- common/src/common/block/BlockFalling.java | 6 +- common/src/common/block/BlockFarmland.java | 4 +- common/src/common/block/BlockFire.java | 10 +- common/src/common/block/BlockFloorPortal.java | 4 +- common/src/common/block/BlockFlower.java | 4 +- common/src/common/block/BlockFlowerPot.java | 4 +- common/src/common/block/BlockFurnace.java | 10 +- common/src/common/block/BlockGrass.java | 6 +- common/src/common/block/BlockHopper.java | 6 +- common/src/common/block/BlockIce.java | 4 +- common/src/common/block/BlockLeaves.java | 10 +- common/src/common/block/BlockLever.java | 4 +- common/src/common/block/BlockLiquid.java | 8 +- common/src/common/block/BlockLog.java | 4 +- common/src/common/block/BlockMachine.java | 6 +- common/src/common/block/BlockMushroom.java | 8 +- common/src/common/block/BlockMycelium.java | 8 +- common/src/common/block/BlockNuke.java | 4 +- common/src/common/block/BlockPistonBase.java | 4 +- common/src/common/block/BlockPistonHead.java | 4 +- .../src/common/block/BlockPistonMoving.java | 4 +- common/src/common/block/BlockPortal.java | 6 +- common/src/common/block/BlockPumpkin.java | 2 +- common/src/common/block/BlockRailBase.java | 6 +- .../src/common/block/BlockRailDetector.java | 8 +- .../common/block/BlockRedstoneComparator.java | 14 +- .../src/common/block/BlockRedstoneDiode.java | 12 +- .../src/common/block/BlockRedstoneLight.java | 6 +- common/src/common/block/BlockRedstoneOre.java | 8 +- .../common/block/BlockRedstoneRepeater.java | 8 +- .../src/common/block/BlockRedstoneTorch.java | 16 +- .../src/common/block/BlockRedstoneWire.java | 10 +- common/src/common/block/BlockReed.java | 4 +- common/src/common/block/BlockSapling.java | 10 +- common/src/common/block/BlockSign.java | 2 +- common/src/common/block/BlockSkull.java | 4 +- common/src/common/block/BlockSnow.java | 4 +- common/src/common/block/BlockSnowBlock.java | 4 +- .../src/common/block/BlockStainedGlass.java | 4 +- .../common/block/BlockStainedGlassPane.java | 4 +- common/src/common/block/BlockStairs.java | 12 +- .../src/common/block/BlockStaticLiquid.java | 4 +- common/src/common/block/BlockStem.java | 6 +- common/src/common/block/BlockTNT.java | 4 +- common/src/common/block/BlockTallGrass.java | 6 +- common/src/common/block/BlockTorch.java | 8 +- common/src/common/block/BlockTripWire.java | 10 +- .../src/common/block/BlockTripWireHook.java | 8 +- common/src/common/block/BlockVine.java | 4 +- common/src/common/block/BlockWarpChest.java | 4 +- common/src/common/block/BlockWart.java | 4 +- common/src/common/block/IGrowable.java | 4 +- common/src/common/entity/Entity.java | 8 +- .../common/entity/animal/EntityDragon.java | 4 +- .../common/entity/effect/EntityLightning.java | 4 +- .../common/entity/item/EntityFireworks.java | 4 +- common/src/common/entity/item/EntityItem.java | 4 +- .../common/entity/npc/EntityArachnoid.java | 2 +- .../src/common/entity/npc/EntityDarkMage.java | 4 +- .../src/common/entity/npc/EntityHaunter.java | 4 +- .../common/entity/npc/EntityHoveringNPC.java | 10 +- common/src/common/entity/npc/EntityHuman.java | 8 +- common/src/common/entity/npc/EntityNPC.java | 200 ++++++------- common/src/common/entity/npc/EntitySlime.java | 6 +- .../src/common/entity/npc/EntityUndead.java | 4 +- .../src/common/entity/npc/EntityZombie.java | 4 +- .../common/entity/projectile/EntityHook.java | 4 +- .../src/common/entity/types/EntityLiving.java | 22 +- .../common/entity/types/EntityThrowable.java | 4 +- common/src/common/entity/types/IEntityFX.java | 9 - common/src/common/init/Config.java | 72 ++--- common/src/common/item/ItemBanHammer.java | 4 +- common/src/common/item/ItemBucket.java | 10 +- common/src/common/item/ItemDye.java | 4 +- common/src/common/item/ItemExterminator.java | 4 +- common/src/common/item/ItemInfoWand.java | 4 +- common/src/common/item/ItemLightning.java | 4 +- common/src/common/item/ItemWand.java | 12 +- common/src/common/item/ItemWeatherToken.java | 4 +- common/src/common/network/IClientPlayer.java | 199 +------------ common/src/common/packet/APacketEmpty.java | 14 - .../common/packet/RPacketLoginSuccess.java | 37 ++- .../common/tileentity/TileEntityBeacon.java | 4 +- .../TileEntityDaylightDetector.java | 6 +- common/src/common/village/Village.java | 10 +- common/src/common/world/AWorldClient.java | 15 + common/src/common/world/AWorldServer.java | 62 ++++ common/src/common/world/Chunk.java | 4 +- common/src/common/world/Explosion.java | 2 +- common/src/common/world/IWorld.java | 279 ++++++++++++++++++ common/src/common/world/World.java | 2 +- common/src/common/worldgen/BlockReplacer.java | 4 +- .../src/common/worldgen/ChunkGenerator.java | 4 +- .../src/common/worldgen/FeatureDungeons.java | 6 +- .../src/common/worldgen/FeatureGenerator.java | 6 +- common/src/common/worldgen/FeatureLakes.java | 6 +- .../src/common/worldgen/FeatureLiquids.java | 6 +- common/src/common/worldgen/FeatureOres.java | 6 +- .../src/common/worldgen/GeneratorCavern.java | 4 +- .../src/common/worldgen/GeneratorDebug.java | 4 +- .../common/worldgen/GeneratorDestroyed.java | 4 +- common/src/common/worldgen/GeneratorFlat.java | 4 +- .../src/common/worldgen/GeneratorIsland.java | 4 +- .../src/common/worldgen/GeneratorPerlin.java | 4 +- .../src/common/worldgen/GeneratorSimple.java | 4 +- .../src/common/worldgen/ReplacerAltBiome.java | 4 +- .../common/worldgen/ReplacerAltSurface.java | 4 +- common/src/common/worldgen/ReplacerBiome.java | 4 +- .../src/common/worldgen/ReplacerTopLayer.java | 4 +- .../src/common/worldgen/caves/MapGenBase.java | 8 +- .../common/worldgen/caves/MapGenBigCaves.java | 4 +- .../common/worldgen/caves/MapGenCaves.java | 4 +- .../common/worldgen/caves/MapGenRavine.java | 4 +- .../feature/WorldGenAbandonedChest.java | 4 +- .../worldgen/feature/WorldGenAsteroid.java | 4 +- .../worldgen/feature/WorldGenBlockBlob.java | 4 +- .../common/worldgen/feature/WorldGenClay.java | 4 +- .../worldgen/feature/WorldGenClayExt.java | 4 +- .../worldgen/feature/WorldGenDesertWells.java | 4 +- .../common/worldgen/feature/WorldGenFire.java | 4 +- .../worldgen/feature/WorldGenGlowStone.java | 4 +- .../worldgen/feature/WorldGenHellLava.java | 4 +- .../worldgen/feature/WorldGenIcePath.java | 4 +- .../worldgen/feature/WorldGenIceSpike.java | 4 +- .../common/worldgen/feature/WorldGenSand.java | 4 +- .../worldgen/feature/WorldGenSpikes.java | 4 +- .../worldgen/foliage/FeatureDoublePlant.java | 4 +- .../worldgen/foliage/WorldGenBigMushroom.java | 4 +- .../worldgen/foliage/WorldGenCactus.java | 4 +- .../worldgen/foliage/WorldGenDeadBush.java | 4 +- .../worldgen/foliage/WorldGenFlowers.java | 4 +- .../worldgen/foliage/WorldGenMelon.java | 4 +- .../worldgen/foliage/WorldGenMushroom.java | 4 +- .../worldgen/foliage/WorldGenPumpkin.java | 4 +- .../common/worldgen/foliage/WorldGenReed.java | 4 +- .../worldgen/foliage/WorldGenShrub.java | 4 +- .../worldgen/foliage/WorldGenTallGrass.java | 4 +- .../worldgen/foliage/WorldGenVines.java | 4 +- .../worldgen/foliage/WorldGenWaterlily.java | 4 +- .../worldgen/tree/WorldGenBaseTree.java | 10 +- .../common/worldgen/tree/WorldGenBigTree.java | 6 +- .../common/worldgen/tree/WorldGenBirch.java | 4 +- .../common/worldgen/tree/WorldGenDarkOak.java | 10 +- .../worldgen/tree/WorldGenHugeTree.java | 12 +- .../common/worldgen/tree/WorldGenJungle.java | 8 +- .../common/worldgen/tree/WorldGenPine.java | 12 +- .../common/worldgen/tree/WorldGenSavanna.java | 8 +- .../common/worldgen/tree/WorldGenSwamp.java | 6 +- .../common/worldgen/tree/WorldGenTaiga1.java | 4 +- .../common/worldgen/tree/WorldGenTaiga2.java | 4 +- .../common/worldgen/tree/WorldGenTree.java | 6 +- server/src/server/Server.java | 50 ++-- .../server}/clipboard/ClipboardPlacer.java | 5 +- .../src/server/command/EntityListParser.java | 2 +- server/src/server/command/EntityParser.java | 2 +- server/src/server/command/WorldParser.java | 2 +- .../server/command/commands/CommandSpawn.java | 2 +- .../server/command/commands/CommandTime.java | 2 +- .../command/commands/CommandWeather.java | 2 +- .../server/command/commands/CommandWorld.java | 2 +- server/src/server/network/Player.java | 26 +- .../server}/village/VillageCollection.java | 6 +- server/src/server/world/Converter.java | 3 +- .../src/server}/world/Region.java | 4 +- .../src/server}/world/Spawner.java | 4 +- .../src/server}/world/WorldServer.java | 59 ++-- .../worldgen/structure/MapGenBridge.java | 4 +- .../worldgen/structure/MapGenMineshaft.java | 2 +- .../structure/MapGenScatteredFeature.java | 4 +- .../worldgen/structure/MapGenStronghold.java | 4 +- .../worldgen/structure/MapGenStructure.java | 14 +- .../worldgen/structure/MapGenStructureIO.java | 4 +- .../worldgen/structure/MapGenVillage.java | 4 +- .../structure/StructureBoundingBox.java | 2 +- .../worldgen/structure/StructureBridge.java | 4 +- .../structure/StructureComponent.java | 4 +- .../structure/StructureMineshaft.java | 4 +- .../structure/StructureMineshaftStart.java | 4 +- .../structure/StructureScattered.java | 4 +- .../worldgen/structure/StructureStart.java | 4 +- .../structure/StructureStronghold.java | 4 +- .../worldgen/structure/StructureVillage.java | 4 +- 247 files changed, 1309 insertions(+), 1187 deletions(-) rename {common/src/common => client/src/client}/world/EmptyChunk.java (95%) rename {common/src/common => client/src/client}/world/WorldClient.java (92%) delete mode 100644 common/src/common/IClient.java delete mode 100644 common/src/common/IServer.java delete mode 100644 common/src/common/entity/types/IEntityFX.java delete mode 100755 common/src/common/packet/APacketEmpty.java create mode 100644 common/src/common/world/AWorldClient.java create mode 100644 common/src/common/world/AWorldServer.java create mode 100644 common/src/common/world/IWorld.java rename {common/src/common => server/src/server}/clipboard/ClipboardPlacer.java (98%) rename {common/src/common => server/src/server}/village/VillageCollection.java (98%) rename {common/src/common => server/src/server}/world/Region.java (99%) rename {common/src/common => server/src/server}/world/Spawner.java (98%) rename {common/src/common => server/src/server}/world/WorldServer.java (98%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenBridge.java (96%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenMineshaft.java (96%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenScatteredFeature.java (98%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenStronghold.java (98%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenStructure.java (95%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenStructureIO.java (98%) rename {common/src/common => server/src/server}/worldgen/structure/MapGenVillage.java (98%) rename {common/src/common => server/src/server}/worldgen/structure/StructureBoundingBox.java (99%) rename {common/src/common => server/src/server}/worldgen/structure/StructureBridge.java (99%) rename {common/src/common => server/src/server}/worldgen/structure/StructureComponent.java (99%) rename {common/src/common => server/src/server}/worldgen/structure/StructureMineshaft.java (99%) rename {common/src/common => server/src/server}/worldgen/structure/StructureMineshaftStart.java (90%) rename {common/src/common => server/src/server}/worldgen/structure/StructureScattered.java (99%) rename {common/src/common => server/src/server}/worldgen/structure/StructureStart.java (98%) rename {common/src/common => server/src/server}/worldgen/structure/StructureStronghold.java (99%) rename {common/src/common => server/src/server}/worldgen/structure/StructureVillage.java (99%) diff --git a/client/src/client/Client.java b/client/src/client/Client.java index 33f7fc3..e1b1490 100755 --- a/client/src/client/Client.java +++ b/client/src/client/Client.java @@ -66,7 +66,6 @@ import client.renderer.chunk.RenderChunk; import client.renderer.entity.RenderItem; import client.renderer.entity.RenderManager; import client.renderer.particle.EffectRenderer; -import client.renderer.particle.EntityFirework; import client.renderer.texture.ColormapLoader; import client.renderer.texture.EntityTexManager; import client.renderer.texture.TextureManager; @@ -95,7 +94,7 @@ import client.window.Keysym; import client.window.Wheel; import client.window.Window; import client.window.WindowEvent; -import common.IClient; +import client.world.WorldClient; import common.biome.Biome; import common.block.Block; import common.collect.Lists; @@ -106,7 +105,6 @@ import common.entity.animal.EntityHorse; import common.entity.npc.Energy; import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; -import common.entity.types.IEntityFX; import common.future.Futures; import common.future.ListenableFuture; import common.future.ListenableFutureTask; @@ -127,8 +125,6 @@ import common.log.Log; import common.log.LogLevel; import common.log.Message; import common.material.Material; -import common.model.ParticleType; -import common.nbt.NBTTagCompound; import common.network.IThreadListener; import common.network.NetConnection; import common.network.PacketDecoder; @@ -149,7 +145,6 @@ import common.properties.IProperty; import common.rng.Random; import common.sound.EventType; import common.sound.PositionedSound; -import common.sound.Sound; import common.util.BlockPos; import common.util.BoundingBox; import common.util.CharValidator; @@ -164,7 +159,6 @@ import common.world.Chunk; import common.world.LightType; import common.world.State; import common.world.World; -import common.world.WorldClient; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelException; @@ -196,7 +190,7 @@ import io.netty.handler.timeout.ReadTimeoutHandler; [[oder einfach einen Toaster mit nem LCD und Maus]] */ -public class Client implements IThreadListener, IClient { +public class Client implements IThreadListener { public static class SyncFunction implements IntFunction { public void apply(IntVar cv, int value) { Client.CLIENT.sync(value); @@ -1271,7 +1265,7 @@ public class Client implements IThreadListener, IClient { if ((this.pointed.type != ObjectType.BLOCK || this.world.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.player, this.world, ItemControl.PRIMARY, null)) { this.player.swingItem(); - this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.PRIMARY.ordinal())); + this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.PRIMARY.ordinal())); this.leftClickCounter = 10; return; } @@ -1323,7 +1317,7 @@ public class Client implements IThreadListener, IClient { if ((this.pointed.type != ObjectType.BLOCK || this.world.getState(this.pointed.block).getBlock().getMaterial() == Material.air) && itemstack != null && itemstack.getItem().onAction(itemstack, this.player, this.world, ItemControl.SECONDARY, null)) { this.player.swingItem(); - this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.SECONDARY.ordinal())); + this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.SECONDARY.ordinal())); return; } @@ -1389,7 +1383,7 @@ public class Client implements IThreadListener, IClient { if (this.pointed != null) { if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem().onAction(this.player.getHeldItem(), this.player, this.world, ItemControl.TERTIARY, null)) { - this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.TERTIARY.ordinal())); + this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.TERTIARY.ordinal())); return; } @@ -1436,7 +1430,7 @@ public class Client implements IThreadListener, IClient { inventoryplayer.setCurrentItem(item, meta, flag1); if(this.itemCheat) { - this.player.sendQueue.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl())); + this.player.client.addToSendQueue(new CPacketCheat(new ItemStack(item, 1, meta), inventoryplayer.currentItem, this.ctrl())); } } } @@ -1446,7 +1440,7 @@ public class Client implements IThreadListener, IClient { if (this.pointed != null) { if(this.player.getHeldItem() != null && this.player.getHeldItem().getItem().onAction(this.player.getHeldItem(), this.player, this.world, ItemControl.QUARTERNARY, null)) { - this.player.sendQueue.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.QUARTERNARY.ordinal())); + this.player.client.addToSendQueue(new CPacketAction(Action.ITEM_ACTION, ItemControl.QUARTERNARY.ordinal())); return; } } @@ -1522,7 +1516,7 @@ public class Client implements IThreadListener, IClient { public ClientPlayer getNetHandler() { - return this.player != null ? (ClientPlayer)this.player.sendQueue : null; + return this.player != null ? (ClientPlayer)this.player.client : null; } // public void setSkin(BufferedImage skin, String id, ModelType model, boolean slim) @@ -1569,7 +1563,7 @@ public class Client implements IThreadListener, IClient { public void performAction(Action action) { if(this.player != null) - this.player.sendQueue.addToSendQueue(new CPacketAction(action)); + this.player.client.addToSendQueue(new CPacketAction(action)); } public void setBossStatus(EntityLiving entity) { @@ -1805,7 +1799,7 @@ public class Client implements IThreadListener, IClient { ticked / 1000L, (ticked / 100L) % 10L ) + (this.serverInfo != null ? "\n" + this.serverInfo : "") -// WorldServer world = this.server.getWorld(this.theWorld.dimension.getDimensionId()); +// IWorldServer world = this.server.getWorld(this.theWorld.dimension.getDimensionId()); // if(world != null) // list.add("Seed: " + world.getSeed()); ; @@ -3342,82 +3336,4 @@ public class Client implements IThreadListener, IClient { } }, "File Browser listener").start(); } - - public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) - { - this.effectRenderer.addEffect(new EntityFirework.StarterFX(this.world, x, y, z, motionX, motionY, motionZ, this.effectRenderer, compund)); - } - - public int getRenderDistance() { - return this.renderDistance; - } - - public float getGravity() { - return this.gravity; - } - - public int getTimeFactor() { - return this.timeFactor; - } - - public boolean hasDayCycle() { - return this.dayCycle; - } - - public void playSound(Sound sound) { - this.soundManager.playSound(sound); - } - - public EntityNPC getPlayer() { - return this.player; - } - - public IEntityFX spawnEffectParticle(int particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, - int[] parameters) { - return this.effectRenderer.spawnEffectParticle(particleId, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters); - } - - public void addBlockDestroyEffects(BlockPos pos, State state) { - this.effectRenderer.addBlockDestroyEffects(pos, state); - } - - public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) { - this.renderGlobal.sendBlockBreakProgress(breakerId, pos, progress); - } - - public void markBlocksForUpdate(int x1, int y1, int z1, int x2, int y2, int z2) { - this.renderGlobal.markBlocksForUpdate(x1, y1, z1, x2, y2, z2); - } - - public void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes) { - this.effectRenderer.emitParticleAtEntity(entityIn, particleTypes); - } - - public boolean isJumping() { - return this.jump; - } - - public boolean isSprinting() { - return this.sprint; - } - - public boolean isSneaking() { - return this.sneak; - } - - public float getMoveForward() { - return this.moveForward; - } - - public float getMoveStrafe() { - return this.moveStrafe; - } - - public void setMoveForward(float value) { - this.moveForward = value; - } - - public void setMoveStrafe(float value) { - this.moveStrafe = value; - } } diff --git a/client/src/client/PlayerController.java b/client/src/client/PlayerController.java index 80017d3..a06986e 100755 --- a/client/src/client/PlayerController.java +++ b/client/src/client/PlayerController.java @@ -1,6 +1,7 @@ package client; import client.network.ClientPlayer; +import client.world.WorldClient; import common.block.Block; import common.entity.Entity; import common.entity.npc.EntityNPC; @@ -20,7 +21,6 @@ import common.util.Facing; import common.util.Vec3; import common.world.State; import common.world.World; -import common.world.WorldClient; public class PlayerController { @@ -471,7 +471,7 @@ public class PlayerController public EntityNPC createPlayerEntity(WorldClient worldIn, int type) { EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(type, worldIn); - player.setClientPlayer(this.gm, this.netClientHandler); + player.setClientPlayer(this.netClientHandler); return player; } diff --git a/client/src/client/gui/GuiConsole.java b/client/src/client/gui/GuiConsole.java index 3ea6d44..52f1501 100644 --- a/client/src/client/gui/GuiConsole.java +++ b/client/src/client/gui/GuiConsole.java @@ -215,7 +215,7 @@ public class GuiConsole extends Gui implements Textbox.Callback { s = argv[argv.length - 1]; Iterable res = pre.startsWith("#") ? (argv.length == 1 ? this.gm.getVars() : (argv.length == 2 ? getVarCompletion(argv[0].substring(1)) : Lists.newArrayList())) : - (this.gm.player == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.player.sendQueue).getPlayerNames()); + (this.gm.player == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.player.client).getPlayerNames()); if(argv.length == 1 && pre.startsWith("#")) s = s.substring(1); for(String s1 : res) { @@ -255,7 +255,7 @@ public class GuiConsole extends Gui implements Textbox.Callback { if(this.gm.player != null) { currentText = currentText.substring(1); this.prefixFirst = currentText.split(" ", -1).length == 1 ? "/" : null; - this.gm.player.sendQueue.addToSendQueue(new CPacketComplete(currentText, eid, blockpos)); + this.gm.player.client.addToSendQueue(new CPacketComplete(currentText, eid, blockpos)); this.waitingOnAutocomplete = true; } } diff --git a/client/src/client/gui/character/GuiChar.java b/client/src/client/gui/character/GuiChar.java index 540c209..25c3593 100755 --- a/client/src/client/gui/character/GuiChar.java +++ b/client/src/client/gui/character/GuiChar.java @@ -350,7 +350,7 @@ public class GuiChar extends GuiList public void use(ActButton elem, Mode action) { if(GuiChar.this.gm.player != null) { GuiChar.this.waiting = false; - GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal())); + GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal())); for(ActButton btn : alignBtns) { btn.enabled = btn != elem; } @@ -363,7 +363,7 @@ public class GuiChar extends GuiList public void use(Slider elem, int value) { if(GuiChar.this.gm.player != null) { GuiChar.this.waiting = false; - GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value)); + GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value)); } } }, "Spieler-Größe", "cm")).enabled = this.gm.player == null || this.gm.player.getMinSize() != this.gm.player.getMaxSize(); @@ -378,8 +378,8 @@ public class GuiChar extends GuiList if(GuiChar.this.gm.player != null) { GuiChar.this.gm.displayGuiScreen(GuiLoading.makeWaitTask("Lade Welt ...")); Dimension dim = UniverseRegistry.getBaseDimensions().get(GuiChar.this.dimension); - GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText())); - GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId())); + GuiChar.this.gm.player.client.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText())); + GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, dim.getDimensionId())); } } }, "Charakter erstellen")); @@ -391,7 +391,7 @@ public class GuiChar extends GuiList elem.setText(GuiChar.this.gm.player == null ? "..." : GuiChar.this.gm.player.getCustomNameTag()); else if(GuiChar.this.gm.player != null) { GuiChar.this.waiting = false; - GuiChar.this.gm.player.sendQueue.addToSendQueue(new CPacketMessage(CPacketMessage.Type.DISPLAY, name)); + GuiChar.this.gm.player.client.addToSendQueue(new CPacketMessage(CPacketMessage.Type.DISPLAY, name)); } } } diff --git a/client/src/client/gui/character/GuiClass.java b/client/src/client/gui/character/GuiClass.java index 11a8805..e25e5f5 100644 --- a/client/src/client/gui/character/GuiClass.java +++ b/client/src/client/gui/character/GuiClass.java @@ -70,7 +70,7 @@ public class GuiClass extends GuiList implements ActButton. public void use(ActButton elem, Mode action) { ClassEntry entry = this.getSelected(); if(entry != null && GuiClass.this.gm.player != null) { - GuiClass.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal())); + GuiClass.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_CLASS, entry.clazz.ordinal())); this.gm.displayGuiScreen(GuiChar.INSTANCE); } } diff --git a/client/src/client/gui/character/GuiSpecies.java b/client/src/client/gui/character/GuiSpecies.java index 770d8a4..47a9ec7 100644 --- a/client/src/client/gui/character/GuiSpecies.java +++ b/client/src/client/gui/character/GuiSpecies.java @@ -74,6 +74,6 @@ public class GuiSpecies extends GuiList implements ActB public void use(ActButton elem, Mode action) { SpeciesEntry entry = this.getSelected(); if(entry != null && GuiSpecies.this.gm.player != null) - GuiSpecies.this.gm.player.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz))); + GuiSpecies.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz))); } } diff --git a/client/src/client/gui/container/GuiContainer.java b/client/src/client/gui/container/GuiContainer.java index babe081..7ae0eb8 100755 --- a/client/src/client/gui/container/GuiContainer.java +++ b/client/src/client/gui/container/GuiContainer.java @@ -644,7 +644,7 @@ public abstract class GuiContainer extends Gui if(this.cheatStack != null) { Slot slot = this.getSlotAtPosition(mouseX, mouseY); if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.player != null && slot.inventory == this.gm.player.inventory) - this.gm.player.sendQueue.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1)); + this.gm.player.client.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1)); if(mouseButton != 1 && !this.gm.ctrl()) this.cheatStack = null; return; @@ -1197,7 +1197,7 @@ public abstract class GuiContainer extends Gui if(i1 >= 0 && i1 < ITEM_LIST.size()) { if(slot >= 0 || instant) { - this.gm.player.sendQueue.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full)); + this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(i1), slot, full)); } else { this.cheatStack = ITEM_LIST.get(i1).copy(); diff --git a/client/src/client/network/ClientLoginHandler.java b/client/src/client/network/ClientLoginHandler.java index 47e9894..c17ab44 100755 --- a/client/src/client/network/ClientLoginHandler.java +++ b/client/src/client/network/ClientLoginHandler.java @@ -30,6 +30,7 @@ public class ClientLoginHandler extends NetHandler implements IClientLoginHandle public void handleLoginSuccess(RPacketLoginSuccess packetIn) { + this.gm.debugWorld = packetIn.isDebug(); this.networkManager.setConnectionState(PacketRegistry.PLAY); this.networkManager.setNetHandler(new ClientPlayer(this.gm, this.networkManager)); } diff --git a/client/src/client/network/ClientPlayer.java b/client/src/client/network/ClientPlayer.java index 217ff52..eb1cbc1 100755 --- a/client/src/client/network/ClientPlayer.java +++ b/client/src/client/network/ClientPlayer.java @@ -27,6 +27,7 @@ import client.gui.container.GuiRepair; import client.gui.ingame.GuiSign; import client.renderer.particle.EntityPickupFX; import client.renderer.texture.EntityTexManager; +import client.world.WorldClient; import common.attributes.Attribute; import common.attributes.AttributeInstance; import common.attributes.AttributeMap; @@ -126,6 +127,7 @@ import common.packet.SPacketUpdateHealth; import common.packet.SPacketWorld; import common.potion.PotionEffect; import common.rng.Random; +import common.sound.Sound; import common.tileentity.IInteractionObject; import common.tileentity.LocalBlockIntercommunication; import common.tileentity.TileEntity; @@ -137,7 +139,6 @@ import common.world.Chunk; import common.world.Explosion; import common.world.Weather; import common.world.World; -import common.world.WorldClient; public class ClientPlayer extends NetHandler implements IClientPlayer { @@ -180,6 +181,52 @@ public class ClientPlayer extends NetHandler implements IClientPlayer this.netManager = p_i46300_3_; } + + public void playSound(Sound sound) { + this.gameController.getSoundManager().playSound(sound); + } + + public void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes) { + this.gameController.effectRenderer.emitParticleAtEntity(entityIn, particleTypes); + } + + public boolean isJumping() { + return this.gameController.jump; + } + + public boolean isSprinting() { + return this.gameController.sprint; + } + + public boolean isSneaking() { + return this.gameController.sneak; + } + + public float getMoveForward() { + return this.gameController.moveForward; + } + + public float getMoveStrafe() { + return this.gameController.moveStrafe; + } + + public void setMoveForward(float value) { + this.gameController.moveForward = value; + } + + public void setMoveStrafe(float value) { + this.gameController.moveStrafe = value; + } + + public boolean isRenderViewEntity(Entity entity) { + return this.gameController.getRenderViewEntity() == entity; + } + + public void updatePlayerMoveState() { + this.gameController.updatePlayerMoveState(); + } + + /** * Clears the WorldClient instance associated with this NetHandlerPlayClient */ @@ -482,7 +529,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer float yaw = packetIn.getYaw(); float pitch = packetIn.getPitch(); EntityNPC player = (EntityNPC)EntityRegistry.createEntityByID(packetIn.getEntityType(), this.gameController.world); // new EntityNPC(this.gameController.theWorld); // , /* this.getPlayerInfo( */ packetIn.getUser()); // ).getUser()); - player.setOtherPlayer(this.gameController); + player.setOtherPlayer(); player.prevX = player.lastTickPosX = (double)(player.serverPosX = packetIn.getX()); player.prevY = player.lastTickPosY = (double)(player.serverPosY = packetIn.getY()); player.prevZ = player.lastTickPosZ = (double)(player.serverPosZ = packetIn.getZ()); diff --git a/client/src/client/renderer/EntityRenderer.java b/client/src/client/renderer/EntityRenderer.java index d0b2f82..9e5bf48 100755 --- a/client/src/client/renderer/EntityRenderer.java +++ b/client/src/client/renderer/EntityRenderer.java @@ -13,6 +13,7 @@ import client.Client; import client.renderer.particle.EffectRenderer; import client.renderer.texture.DynamicTexture; import client.renderer.texture.TextureMap; +import client.world.WorldClient; import common.biome.Biome; import common.block.Block; import common.entity.Entity; @@ -32,7 +33,6 @@ import common.util.ExtMath; import common.util.HitPosition; import common.util.Vec3; import common.world.World; -import common.world.WorldClient; public class EntityRenderer { private static final String locationMoltenPng = "textures/world/molten.png"; diff --git a/client/src/client/renderer/RenderGlobal.java b/client/src/client/renderer/RenderGlobal.java index 03a90a9..f1ad4b3 100755 --- a/client/src/client/renderer/RenderGlobal.java +++ b/client/src/client/renderer/RenderGlobal.java @@ -25,6 +25,7 @@ import client.renderer.texture.TextureAtlasSprite; import client.renderer.texture.TextureManager; import client.renderer.texture.TextureMap; import client.renderer.tileentity.TileEntityRendererDispatcher; +import client.world.WorldClient; import common.block.Block; import common.block.BlockChest; import common.block.BlockSign; @@ -52,7 +53,6 @@ import common.util.Vec3; import common.util.Vector3f; import common.world.Chunk; import common.world.State; -import common.world.WorldClient; public class RenderGlobal { diff --git a/client/src/client/renderer/particle/EntityFX.java b/client/src/client/renderer/particle/EntityFX.java index f0615ed..67c53bd 100755 --- a/client/src/client/renderer/particle/EntityFX.java +++ b/client/src/client/renderer/particle/EntityFX.java @@ -5,12 +5,11 @@ import client.renderer.RenderBuffer; import client.renderer.texture.TextureAtlasSprite; import common.entity.Entity; import common.entity.EntityType; -import common.entity.types.IEntityFX; import common.nbt.NBTTagCompound; import common.util.ExtMath; import common.world.World; -public class EntityFX extends Entity implements IEntityFX +public class EntityFX extends Entity { protected int particleTextureIndexX; protected int particleTextureIndexY; diff --git a/client/src/client/renderer/particle/EntityFirework.java b/client/src/client/renderer/particle/EntityFirework.java index da4bd91..b3f3072 100755 --- a/client/src/client/renderer/particle/EntityFirework.java +++ b/client/src/client/renderer/particle/EntityFirework.java @@ -2,6 +2,7 @@ package client.renderer.particle; import client.Client; import client.renderer.RenderBuffer; +import client.world.WorldClient; import common.entity.Entity; import common.init.SoundEvent; import common.item.ItemDye; @@ -10,7 +11,6 @@ import common.nbt.NBTTagList; import common.util.BoundingBox; import common.util.ExtMath; import common.world.World; -import common.world.WorldClient; public class EntityFirework { diff --git a/client/src/client/renderer/particle/EntityParticleEmitter.java b/client/src/client/renderer/particle/EntityParticleEmitter.java index 262871b..42f18a8 100755 --- a/client/src/client/renderer/particle/EntityParticleEmitter.java +++ b/client/src/client/renderer/particle/EntityParticleEmitter.java @@ -1,10 +1,10 @@ package client.renderer.particle; import client.renderer.RenderBuffer; +import client.world.WorldClient; import common.entity.Entity; import common.model.ParticleType; import common.world.World; -import common.world.WorldClient; public class EntityParticleEmitter extends EntityFX { diff --git a/common/src/common/world/EmptyChunk.java b/client/src/client/world/EmptyChunk.java similarity index 95% rename from common/src/common/world/EmptyChunk.java rename to client/src/client/world/EmptyChunk.java index 66ef16f..190c2d7 100755 --- a/common/src/common/world/EmptyChunk.java +++ b/client/src/client/world/EmptyChunk.java @@ -1,4 +1,4 @@ -package common.world; +package client.world; import java.util.List; import java.util.function.Predicate; @@ -9,6 +9,8 @@ import common.init.Blocks; import common.tileentity.TileEntity; import common.util.BlockPos; import common.util.BoundingBox; +import common.world.Chunk; +import common.world.LightType; public class EmptyChunk extends Chunk { public EmptyChunk(WorldClient world) { diff --git a/common/src/common/world/WorldClient.java b/client/src/client/world/WorldClient.java similarity index 92% rename from common/src/common/world/WorldClient.java rename to client/src/client/world/WorldClient.java index 998a254..a38b356 100755 --- a/common/src/common/world/WorldClient.java +++ b/client/src/client/world/WorldClient.java @@ -1,9 +1,11 @@ -package common.world; +package client.world; import java.util.List; import java.util.Set; -import common.IClient; +import client.Client; +import client.renderer.particle.EntityFX; +import client.renderer.particle.EntityFirework; import common.biome.Biome; import common.block.Block; import common.collect.Lists; @@ -12,7 +14,6 @@ import common.dimension.Dimension; import common.entity.Entity; import common.entity.item.EntityCart; import common.entity.npc.EntityNPC; -import common.entity.types.IEntityFX; import common.init.BlockRegistry; import common.init.ItemRegistry; import common.init.Items; @@ -32,12 +33,15 @@ import common.util.ExtMath; import common.util.LongHashMap; import common.util.Vec3; import common.util.BlockPos.MutableBlockPos; +import common.world.Chunk; +import common.world.AWorldClient; +import common.world.State; -public class WorldClient extends World +public class WorldClient extends AWorldClient { private static final int DISPLAY_RANGE = 16; - private final IClient gm; + private final Client gm; private final Set entityList = Sets.newHashSet(); private final Set spawnQueue = Sets.newHashSet(); private final Set previousActive = Sets.newHashSet(); @@ -48,14 +52,14 @@ public class WorldClient extends World protected int lastLightning; protected Vec3 lightColor = new Vec3(0xffffff); - public WorldClient(IClient gm, boolean debug, Dimension dim) + public WorldClient(Client gm, boolean debug, Dimension dim) { - super(dim, true, debug); + super(dim, debug); this.gm = gm; this.calculateInitialSkylight(); this.calculateInitialWeather(); - this.setGravity(this.gm.getGravity()); - this.setTimeFactor(this.gm.getTimeFactor()); + this.setGravity(this.gm.gravity); + this.setTimeFactor(this.gm.timeFactor); // this.setDifficulty(this.gm.difficulty); } @@ -63,7 +67,7 @@ public class WorldClient extends World { // this.info.tick(); - if (this.gm.hasDayCycle()) + if (this.gm.dayCycle) { this.daytime += this.timeFactor; } @@ -92,7 +96,7 @@ public class WorldClient extends World protected void updateBlocks() { - this.setActivePlayerChunksAndCheckLight(this.gm.getRenderDistance()); + this.setActivePlayerChunksAndCheckLight(this.gm.renderDistance); this.previousActive.retainAll(this.active); if (this.previousActive.size() == this.active.size()) @@ -160,7 +164,7 @@ public class WorldClient extends World } else if (entityIn instanceof EntityCart) { - this.gm.playSound(new MovingSoundMinecart((EntityCart)entityIn)); + this.gm.getSoundManager().playSound(new MovingSoundMinecart((EntityCart)entityIn)); } return flag; @@ -220,7 +224,7 @@ public class WorldClient extends World public Entity getEntityByID(int id) { - return (Entity)(id == this.gm.getPlayer().getId() ? this.gm.getPlayer() : super.getEntityByID(id)); + return (Entity)(id == this.gm.player.getId() ? this.gm.player : super.getEntityByID(id)); } public Entity removeEntityFromWorld(int entityID) @@ -338,13 +342,13 @@ public class WorldClient extends World // } // else // { - this.gm.playSound(positionedsoundrecord); + this.gm.getSoundManager().playSound(positionedsoundrecord); // } } public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) { - this.gm.makeFireworks(x, y, z, motionX, motionY, motionZ, compund); + this.gm.effectRenderer.addEffect(new EntityFirework.StarterFX(this.gm.world, x, y, z, motionX, motionY, motionZ, this.gm.effectRenderer, compund)); } public Chunk getChunk(int x, int z) @@ -373,7 +377,7 @@ public class WorldClient extends World this.spawnEntityFX(particleType, particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data); } - public IEntityFX spawnEntityFX(ParticleType particle, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] parameters) + public EntityFX spawnEntityFX(ParticleType particle, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] parameters) { if (this.gm.getRenderViewEntity() != null) { @@ -391,14 +395,14 @@ public class WorldClient extends World if (ignoreRange) { - return this.gm.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); + return this.gm.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); } else { double d3 = 16.0D; if(d0 * d0 + d1 * d1 + d2 * d2 > 256.0D) return null; - return this.gm.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); + return this.gm.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); } } return null; @@ -585,10 +589,10 @@ public class WorldClient extends World if (block.getMaterial() != Material.air) { - this.gm.playSound(new PositionedSound(block.sound.getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F)); + this.gm.getSoundManager().playSound(new PositionedSound(block.sound.getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F)); } - this.gm.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255)); + this.gm.effectRenderer.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255)); break; case 2002: @@ -625,7 +629,7 @@ public class WorldClient extends World double d24 = Math.cos(d23) * d22; double d9 = 0.01D + this.rand.doublev() * 0.5D; double d11 = Math.sin(d23) * d22; - IEntityFX entityfx = this.spawnEntityFX(enumparticletypes, enumparticletypes.getShouldIgnoreRange(), d13 + d24 * 0.1D, d14 + 0.3D, d16 + d11 * 0.1D, d24, d9, d11, new int[0]); + EntityFX entityfx = this.spawnEntityFX(enumparticletypes, enumparticletypes.getShouldIgnoreRange(), d13 + d24 * 0.1D, d14 + 0.3D, d16 + d11 * 0.1D, d24, d9, d11, new int[0]); if (entityfx != null) { @@ -662,7 +666,7 @@ public class WorldClient extends World int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); - this.gm.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); + this.gm.renderGlobal.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); } public void notifyLightSet(BlockPos pos) @@ -670,17 +674,17 @@ public class WorldClient extends World int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); - this.gm.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); + this.gm.renderGlobal.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); } public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) { - this.gm.markBlocksForUpdate(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1); + this.gm.renderGlobal.markBlocksForUpdate(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1); } public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) { - this.gm.sendBlockBreakProgress(breakerId, pos, progress); + this.gm.renderGlobal.sendBlockBreakProgress(breakerId, pos, progress); } public float getSunBrightness(float p_72971_1_) { diff --git a/common/src/common/IClient.java b/common/src/common/IClient.java deleted file mode 100644 index 6d050f4..0000000 --- a/common/src/common/IClient.java +++ /dev/null @@ -1,34 +0,0 @@ -package common; - -import common.entity.Entity; -import common.entity.npc.EntityNPC; -import common.entity.types.IEntityFX; -import common.model.ParticleType; -import common.nbt.NBTTagCompound; -import common.sound.Sound; -import common.util.BlockPos; -import common.world.State; - -public interface IClient { - int getRenderDistance(); - float getGravity(); - int getTimeFactor(); - boolean hasDayCycle(); - void playSound(Sound sound); - EntityNPC getPlayer(); - Entity getRenderViewEntity(); - void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund); - IEntityFX spawnEffectParticle(int particleId, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int[] parameters); - void addBlockDestroyEffects(BlockPos pos, State state); - void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress); - void markBlocksForUpdate(int x1, int y1, int z1, int x2, int y2, int z2); - void updatePlayerMoveState(); - void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes); - boolean isJumping(); - boolean isSprinting(); - boolean isSneaking(); - float getMoveForward(); - float getMoveStrafe(); - void setMoveForward(float value); - void setMoveStrafe(float value); -} diff --git a/common/src/common/IServer.java b/common/src/common/IServer.java deleted file mode 100644 index c3fc135..0000000 --- a/common/src/common/IServer.java +++ /dev/null @@ -1,25 +0,0 @@ -package common; - -import java.util.List; -import java.util.Map; - -import common.entity.Entity; -import common.entity.npc.EntityNPC; -import common.network.IPlayer; -import common.network.Packet; -import common.util.BlockPos; -import common.util.PortalType; -import common.util.Position; -import common.world.WorldServer; - -public interface IServer { - List getIPlayers(); - void sendPacket(Packet packet); - void sendPacket(Packet packet, int dimension); - void sendNear(double x, double y, double z, double radius, int dimension, Packet packet); - void sendNearExcept(EntityNPC except, double x, double y, double z, double radius, int dimension, Packet packet); - Map getWarps(); - List getWorlds(); - WorldServer getWorld(int dimension); - void placeInDimension(Entity entity, WorldServer oldWorld, WorldServer world, BlockPos pos, PortalType portal); -} \ No newline at end of file diff --git a/common/src/common/ai/EntityAIFleeSun.java b/common/src/common/ai/EntityAIFleeSun.java index 0347580..85c8c7e 100755 --- a/common/src/common/ai/EntityAIFleeSun.java +++ b/common/src/common/ai/EntityAIFleeSun.java @@ -5,7 +5,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Vec3; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAIFleeSun extends EntityAIBase { @@ -29,7 +29,7 @@ public class EntityAIFleeSun extends EntityAIBase */ public boolean shouldExecute() { - if (!((WorldServer)this.theWorld).isDaytime()) + if (!((AWorldServer)this.theWorld).isDaytime()) { return false; } diff --git a/common/src/common/ai/EntityAIMoveIndoors.java b/common/src/common/ai/EntityAIMoveIndoors.java index 0348347..a5294db 100755 --- a/common/src/common/ai/EntityAIMoveIndoors.java +++ b/common/src/common/ai/EntityAIMoveIndoors.java @@ -5,7 +5,7 @@ import common.util.BlockPos; import common.util.Vec3; import common.village.Village; import common.village.VillageDoorInfo; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAIMoveIndoors extends EntityAIBase { @@ -27,7 +27,7 @@ public class EntityAIMoveIndoors extends EntityAIBase { BlockPos blockpos = new BlockPos(this.entityObj); - if ((!((WorldServer)this.entityObj.worldObj).isDaytime() /* || this.entityObj.worldObj.isRaining() && !this.entityObj.worldObj.getBiomeGenForCoords(blockpos).canRain() */) && !this.entityObj.worldObj.dimension.hasNoLight()) + if ((!((AWorldServer)this.entityObj.worldObj).isDaytime() /* || this.entityObj.worldObj.isRaining() && !this.entityObj.worldObj.getBiomeGenForCoords(blockpos).canRain() */) && !this.entityObj.worldObj.dimension.hasNoLight()) { if (this.entityObj.getRNG().zrange(50) != 0) { @@ -39,7 +39,7 @@ public class EntityAIMoveIndoors extends EntityAIBase } else { - Village village = ((WorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 14); + Village village = ((AWorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 14); if (village == null) { diff --git a/common/src/common/ai/EntityAIMoveThroughVillage.java b/common/src/common/ai/EntityAIMoveThroughVillage.java index be583f8..2ebfcb6 100755 --- a/common/src/common/ai/EntityAIMoveThroughVillage.java +++ b/common/src/common/ai/EntityAIMoveThroughVillage.java @@ -11,7 +11,7 @@ import common.util.ExtMath; import common.util.Vec3; import common.village.Village; import common.village.VillageDoorInfo; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAIMoveThroughVillage extends EntityAIBase { @@ -44,13 +44,13 @@ public class EntityAIMoveThroughVillage extends EntityAIBase { this.resizeDoorList(); - if (this.isNocturnal && ((WorldServer)this.theEntity.worldObj).isDaytime()) + if (this.isNocturnal && ((AWorldServer)this.theEntity.worldObj).isDaytime()) { return false; } else { - Village village = ((WorldServer)this.theEntity.worldObj).getNearestVillage(new BlockPos(this.theEntity), 0); + Village village = ((AWorldServer)this.theEntity.worldObj).getNearestVillage(new BlockPos(this.theEntity), 0); if (village == null) { diff --git a/common/src/common/ai/EntityAINpcMate.java b/common/src/common/ai/EntityAINpcMate.java index 654af34..639566c 100755 --- a/common/src/common/ai/EntityAINpcMate.java +++ b/common/src/common/ai/EntityAINpcMate.java @@ -3,7 +3,7 @@ package common.ai; import common.entity.Entity; import common.entity.npc.EntityNPC; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAINpcMate extends EntityAIBase { @@ -33,7 +33,7 @@ public class EntityAINpcMate extends EntityAIBase { if (this.npc.getIsWillingToMate(true)) { - Entity entity = ((WorldServer)this.worldObj).findNearestEntityWithinAABB(EntityNPC.class, this.npc.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.npc); + Entity entity = ((AWorldServer)this.worldObj).findNearestEntityWithinAABB(EntityNPC.class, this.npc.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.npc); if (entity == null) { diff --git a/common/src/common/ai/EntityAIRestrictOpenDoor.java b/common/src/common/ai/EntityAIRestrictOpenDoor.java index d7a94c4..15235cb 100755 --- a/common/src/common/ai/EntityAIRestrictOpenDoor.java +++ b/common/src/common/ai/EntityAIRestrictOpenDoor.java @@ -5,7 +5,7 @@ import common.pathfinding.PathNavigateGround; import common.util.BlockPos; import common.village.Village; import common.village.VillageDoorInfo; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAIRestrictOpenDoor extends EntityAIBase { @@ -27,14 +27,14 @@ public class EntityAIRestrictOpenDoor extends EntityAIBase */ public boolean shouldExecute() { - if (((WorldServer)this.entityObj.worldObj).isDaytime()) + if (((AWorldServer)this.entityObj.worldObj).isDaytime()) { return false; } else { BlockPos blockpos = new BlockPos(this.entityObj); - Village village = ((WorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 16); + Village village = ((AWorldServer)this.entityObj.worldObj).getNearestVillage(blockpos, 16); if (village == null) { @@ -53,7 +53,7 @@ public class EntityAIRestrictOpenDoor extends EntityAIBase */ public boolean continueExecuting() { - return ((WorldServer)this.entityObj.worldObj).isDaytime() ? false : !this.frontDoor.getIsDetachedFromVillageFlag() && this.frontDoor.isIndoorSide(new BlockPos(this.entityObj)); + return ((AWorldServer)this.entityObj.worldObj).isDaytime() ? false : !this.frontDoor.getIsDetachedFromVillageFlag() && this.frontDoor.isIndoorSide(new BlockPos(this.entityObj)); } /** diff --git a/common/src/common/ai/EntityAIRestrictSun.java b/common/src/common/ai/EntityAIRestrictSun.java index 2734f28..50e2901 100755 --- a/common/src/common/ai/EntityAIRestrictSun.java +++ b/common/src/common/ai/EntityAIRestrictSun.java @@ -2,7 +2,7 @@ package common.ai; import common.entity.types.EntityLiving; import common.pathfinding.PathNavigateGround; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAIRestrictSun extends EntityAIBase { @@ -18,7 +18,7 @@ public class EntityAIRestrictSun extends EntityAIBase */ public boolean shouldExecute() { - return ((WorldServer)this.theEntity.worldObj).isDaytime(); + return ((AWorldServer)this.theEntity.worldObj).isDaytime(); } /** diff --git a/common/src/common/ai/EntityAIWatchClosest.java b/common/src/common/ai/EntityAIWatchClosest.java index 81b0a9e..43c1703 100755 --- a/common/src/common/ai/EntityAIWatchClosest.java +++ b/common/src/common/ai/EntityAIWatchClosest.java @@ -2,7 +2,7 @@ package common.ai; import common.entity.Entity; import common.entity.types.EntityLiving; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityAIWatchClosest extends EntityAIBase { @@ -57,7 +57,7 @@ public class EntityAIWatchClosest extends EntityAIBase } else { - this.closestEntity = ((WorldServer)this.theWatcher.worldObj).findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.getEntityBoundingBox().expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); + this.closestEntity = ((AWorldServer)this.theWatcher.worldObj).findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.getEntityBoundingBox().expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); } return this.closestEntity != null; diff --git a/common/src/common/biome/Biome.java b/common/src/common/biome/Biome.java index bfb66bb..b4d4ea8 100755 --- a/common/src/common/biome/Biome.java +++ b/common/src/common/biome/Biome.java @@ -36,7 +36,7 @@ import common.util.BlockPos; import common.util.ExtMath; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.FeatureGenerator; import common.worldgen.feature.WorldGenClay; @@ -315,7 +315,7 @@ public abstract class Biome { } } - public void decorate(WorldServer world, Random rand, BlockPos pos) + public void decorate(AWorldServer world, Random rand, BlockPos pos) { for (int i = 0; i < this.sandPerChunk2; ++i) { @@ -564,7 +564,7 @@ public abstract class Biome { return Colorizer.getFoliageColor(d0, d1); } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); } @@ -579,7 +579,7 @@ public abstract class Biome { * * If this.fillerBlock is red sand, we replace some of that with red sandstone. */ - public final void generateBiomeTerrain(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public final void generateBiomeTerrain(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { int i = worldIn.getSeaLevel(); State worldState = worldIn.dimension.getFiller(); diff --git a/common/src/common/biome/BiomeChaos.java b/common/src/common/biome/BiomeChaos.java index d2353c7..79ee8c1 100755 --- a/common/src/common/biome/BiomeChaos.java +++ b/common/src/common/biome/BiomeChaos.java @@ -7,7 +7,7 @@ import common.init.EntityRegistry; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.foliage.WorldGenMushroom; @@ -29,7 +29,7 @@ public class BiomeChaos extends Biome } } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); diff --git a/common/src/common/biome/BiomeDesert.java b/common/src/common/biome/BiomeDesert.java index 0890481..b95ad41 100755 --- a/common/src/common/biome/BiomeDesert.java +++ b/common/src/common/biome/BiomeDesert.java @@ -4,7 +4,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.feature.WorldGenDesertWells; public class BiomeDesert extends Biome @@ -24,7 +24,7 @@ public class BiomeDesert extends Biome protected void addMobs(WeightedList mobs) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); diff --git a/common/src/common/biome/BiomeExterminated.java b/common/src/common/biome/BiomeExterminated.java index 1ca72d5..f944a55 100755 --- a/common/src/common/biome/BiomeExterminated.java +++ b/common/src/common/biome/BiomeExterminated.java @@ -4,7 +4,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; public class BiomeExterminated extends Biome { public BiomeExterminated(int id) { @@ -16,7 +16,7 @@ public class BiomeExterminated extends Biome { protected void addMobs(WeightedList mobs) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { } public int getSkyColor() { diff --git a/common/src/common/biome/BiomeForest.java b/common/src/common/biome/BiomeForest.java index 9c30b45..b699026 100755 --- a/common/src/common/biome/BiomeForest.java +++ b/common/src/common/biome/BiomeForest.java @@ -10,7 +10,7 @@ import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.foliage.WorldGenBigMushroom; import common.worldgen.tree.WorldGenBaseTree; import common.worldgen.tree.WorldGenBigTree; @@ -120,7 +120,7 @@ public class BiomeForest extends Biome } } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { // if(worldIn.getLeavesGen() != this.leavesType) { // this.leavesType = worldIn.getLeavesGen(); @@ -229,7 +229,7 @@ public class BiomeForest extends Biome { return this.id != Biome.birchForest.id && this.id != Biome.birchForestHills.id ? new BiomeMutated(id, this) { - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { this.baseBiome.decorate(worldIn, rand, pos); } diff --git a/common/src/common/biome/BiomeHell.java b/common/src/common/biome/BiomeHell.java index d19e23c..1e4b4dc 100755 --- a/common/src/common/biome/BiomeHell.java +++ b/common/src/common/biome/BiomeHell.java @@ -10,7 +10,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureOres; import common.worldgen.feature.WorldGenFire; import common.worldgen.feature.WorldGenGlowStone; @@ -73,7 +73,7 @@ public class BiomeHell extends Biome mobs.add(new RngSpawn(EntityMagma.class, 1, 4, 4)); } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { if(this.subtype == 0) { for (int i = 0; i < 8; ++i) diff --git a/common/src/common/biome/BiomeHills.java b/common/src/common/biome/BiomeHills.java index 578fcab..7ea7137 100755 --- a/common/src/common/biome/BiomeHills.java +++ b/common/src/common/biome/BiomeHills.java @@ -3,7 +3,7 @@ package common.biome; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.FeatureOres; import common.worldgen.tree.WorldGenTaiga2; @@ -36,7 +36,7 @@ public class BiomeHills extends Biome return (WorldGenTree)(rand.rarity(3) ? this.field_150634_aD : super.genBigTreeChance(rand)); } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); // int i = 3 + rand.nextInt(6); @@ -64,7 +64,7 @@ public class BiomeHills extends Biome // } } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { this.topBlock = Blocks.grass.getState(); this.fillerBlock = Blocks.dirt.getState(); diff --git a/common/src/common/biome/BiomeJungle.java b/common/src/common/biome/BiomeJungle.java index 09c52dc..71737c7 100755 --- a/common/src/common/biome/BiomeJungle.java +++ b/common/src/common/biome/BiomeJungle.java @@ -7,7 +7,7 @@ import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.foliage.WorldGenMelon; import common.worldgen.foliage.WorldGenShrub; @@ -63,7 +63,7 @@ public class BiomeJungle extends Biome return rand.chance(4) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); int i = rand.chOffset(); diff --git a/common/src/common/biome/BiomeMesa.java b/common/src/common/biome/BiomeMesa.java index a42e388..eb9fd70 100755 --- a/common/src/common/biome/BiomeMesa.java +++ b/common/src/common/biome/BiomeMesa.java @@ -14,7 +14,7 @@ import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.tree.WorldGenTree; @@ -71,12 +71,12 @@ public class BiomeMesa extends Biome return 9470285; } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { if (this.layers == null || this.layerSeed != worldIn.getSeed()) { diff --git a/common/src/common/biome/BiomeMoon.java b/common/src/common/biome/BiomeMoon.java index ded8deb..49ccfb8 100755 --- a/common/src/common/biome/BiomeMoon.java +++ b/common/src/common/biome/BiomeMoon.java @@ -4,7 +4,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureOres; public class BiomeMoon extends Biome { @@ -19,7 +19,7 @@ public class BiomeMoon extends Biome { protected void addMobs(WeightedList mobs) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { this.cheeseGenerator.generate(worldIn, rand, pos); } } diff --git a/common/src/common/biome/BiomeMutated.java b/common/src/common/biome/BiomeMutated.java index 630b885..2f90e23 100755 --- a/common/src/common/biome/BiomeMutated.java +++ b/common/src/common/biome/BiomeMutated.java @@ -3,7 +3,7 @@ package common.biome; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.tree.WorldGenTree; @@ -43,17 +43,17 @@ public class BiomeMutated extends Biome protected void addMobs(WeightedList mobs) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { this.baseBiome.decorate(worldIn, rand, pos); // TODO: check } - public void decorateNormal(WorldServer worldIn, Random rand, BlockPos pos) + public void decorateNormal(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal); } diff --git a/common/src/common/biome/BiomeNone.java b/common/src/common/biome/BiomeNone.java index 27b2a97..00a5ef4 100755 --- a/common/src/common/biome/BiomeNone.java +++ b/common/src/common/biome/BiomeNone.java @@ -4,7 +4,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; public class BiomeNone extends Biome { @@ -17,10 +17,10 @@ public class BiomeNone extends Biome { protected void addMobs(WeightedList mobs) { } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) { + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { } public Temperature getTempCategory() { diff --git a/common/src/common/biome/BiomePlains.java b/common/src/common/biome/BiomePlains.java index d74d85a..6aace9a 100755 --- a/common/src/common/biome/BiomePlains.java +++ b/common/src/common/biome/BiomePlains.java @@ -5,7 +5,7 @@ import common.block.BlockFlower; import common.entity.animal.EntityHorse; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; public class BiomePlains extends Biome { @@ -68,7 +68,7 @@ public class BiomePlains extends Biome } } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { double d0 = GRASS_NOISE.generate((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D); diff --git a/common/src/common/biome/BiomeSavanna.java b/common/src/common/biome/BiomeSavanna.java index fe9f069..c456f4e 100755 --- a/common/src/common/biome/BiomeSavanna.java +++ b/common/src/common/biome/BiomeSavanna.java @@ -6,7 +6,7 @@ import common.entity.animal.EntityHorse; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.tree.WorldGenSavanna; import common.worldgen.tree.WorldGenTree; @@ -38,7 +38,7 @@ public class BiomeSavanna extends Biome return biomegenbase; } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { DOUBLE_PLANT_GEN.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); @@ -63,7 +63,7 @@ public class BiomeSavanna extends Biome this.grassPerChunk = 5; } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { this.topBlock = Blocks.grass.getState(); this.fillerBlock = Blocks.dirt.getState(); @@ -81,7 +81,7 @@ public class BiomeSavanna extends Biome this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { this.decorateNormal(worldIn, rand, pos); } diff --git a/common/src/common/biome/BiomeSnow.java b/common/src/common/biome/BiomeSnow.java index 695ac5d..d1440e8 100755 --- a/common/src/common/biome/BiomeSnow.java +++ b/common/src/common/biome/BiomeSnow.java @@ -4,7 +4,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.feature.WorldGenIcePath; import common.worldgen.feature.WorldGenIceSpike; import common.worldgen.tree.WorldGenTaiga2; @@ -27,7 +27,7 @@ public class BiomeSnow extends Biome protected void addMobs(WeightedList mobs) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { if (this.spiky) { diff --git a/common/src/common/biome/BiomeSpace.java b/common/src/common/biome/BiomeSpace.java index a2ebccb..550c865 100755 --- a/common/src/common/biome/BiomeSpace.java +++ b/common/src/common/biome/BiomeSpace.java @@ -5,7 +5,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.feature.WorldGenAsteroid; @@ -26,7 +26,7 @@ public class BiomeSpace extends Biome protected void addMobs(WeightedList mobs) { } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { if(rand.chance(5)) { int x = rand.chOffset(); diff --git a/common/src/common/biome/BiomeSwamp.java b/common/src/common/biome/BiomeSwamp.java index b708632..d726a13 100755 --- a/common/src/common/biome/BiomeSwamp.java +++ b/common/src/common/biome/BiomeSwamp.java @@ -8,7 +8,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.tree.WorldGenTree; @@ -53,7 +53,7 @@ public class BiomeSwamp extends Biome return BlockFlower.EnumFlowerType.BLUE_ORCHID; } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { double d0 = GRASS_NOISE.generate((double)x * 0.25D, (double)z * 0.25D); diff --git a/common/src/common/biome/BiomeTaiga.java b/common/src/common/biome/BiomeTaiga.java index 5680a75..440fc02 100755 --- a/common/src/common/biome/BiomeTaiga.java +++ b/common/src/common/biome/BiomeTaiga.java @@ -7,7 +7,7 @@ import common.entity.animal.EntityWolf; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; import common.worldgen.FeatureGenerator; import common.worldgen.feature.WorldGenBlockBlob; @@ -59,7 +59,7 @@ public class BiomeTaiga extends Biome return rand.rarity(5) ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { if (this.field_150644_aH == 1 || this.field_150644_aH == 2) { @@ -87,7 +87,7 @@ public class BiomeTaiga extends Biome super.decorate(worldIn, rand, pos); } - public void genTerrainBlocks(WorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + public void genTerrainBlocks(AWorldServer worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) { if (this.field_150644_aH == 1 || this.field_150644_aH == 2) { diff --git a/common/src/common/biome/BiomeTian.java b/common/src/common/biome/BiomeTian.java index eae35ef..6f8b5bf 100755 --- a/common/src/common/biome/BiomeTian.java +++ b/common/src/common/biome/BiomeTian.java @@ -9,7 +9,7 @@ import common.init.Blocks; import common.rng.Random; import common.rng.WeightedList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.feature.WorldGenSpikes; import common.worldgen.foliage.WorldGenMushroom; @@ -57,7 +57,7 @@ public class BiomeTian extends Biome return rand.pick(rand.chance(this.treeGen2, this.treeGen1, 4), rand.chance(this.treeGen3, this.treeGen4, 15)); } - public void decorate(WorldServer worldIn, Random rand, BlockPos pos) + public void decorate(AWorldServer worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); diff --git a/common/src/common/block/Block.java b/common/src/common/block/Block.java index 484a05f..d1c321a 100755 --- a/common/src/common/block/Block.java +++ b/common/src/common/block/Block.java @@ -46,10 +46,10 @@ import common.util.HitPosition.ObjectType; import common.world.Explosion; import common.world.IBlockAccess; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class Block { @@ -698,14 +698,14 @@ public class Block /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { this.updateTick(worldIn, pos, state, random); if(this.radiation > 0.0f && /* worldIn.getTime() % 5L == 0L && */ random.chance(Config.randomTick / 3)) this.affectEntities(worldIn, pos, state, this.radiation * 8.0f * 0.25f); } - private void affectEntities(WorldServer worldIn, BlockPos pos, State state, float rad) + private void affectEntities(AWorldServer worldIn, BlockPos pos, State state, float rad) { float r = ExtMath.clampf(rad * 2.0f, 0.0f, 25.0f); BoundingBox box = this.getCollisionBoundingBox(worldIn, pos, state); @@ -719,11 +719,11 @@ public class Block } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { } @@ -749,11 +749,11 @@ public class Block return 10; } - public void onBlockAdded(WorldServer world, BlockPos pos, State state) + public void onBlockAdded(AWorldServer world, BlockPos pos, State state) { } - public void onBlockRemoved(WorldServer world, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer world, BlockPos pos, State state) { } diff --git a/common/src/common/block/BlockBasePressurePlate.java b/common/src/common/block/BlockBasePressurePlate.java index d8e1366..b19329d 100755 --- a/common/src/common/block/BlockBasePressurePlate.java +++ b/common/src/common/block/BlockBasePressurePlate.java @@ -14,7 +14,7 @@ import common.world.IBlockAccess; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockBasePressurePlate extends Block { @@ -109,11 +109,11 @@ public abstract class BlockBasePressurePlate extends Block /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { @@ -183,7 +183,7 @@ public abstract class BlockBasePressurePlate extends Block return new BoundingBox((double)((float)pos.getX() + 0.125F), (double)pos.getY(), (double)((float)pos.getZ() + 0.125F), (double)((float)(pos.getX() + 1) - 0.125F), (double)pos.getY() + 0.25D, (double)((float)(pos.getZ() + 1) - 0.125F)); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { if (this.getRedstoneStrength(state) > 0) { diff --git a/common/src/common/block/BlockBedrock.java b/common/src/common/block/BlockBedrock.java index 0ea00ba..71ec977 100755 --- a/common/src/common/block/BlockBedrock.java +++ b/common/src/common/block/BlockBedrock.java @@ -4,15 +4,15 @@ import common.material.Material; import common.model.ParticleType; import common.rng.Random; import common.util.BlockPos; +import common.world.AWorldClient; import common.world.State; -import common.world.WorldClient; public class BlockBedrock extends Block { public BlockBedrock() { super(Material.rock); } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if(/* worldIn.canShowVoidParticles() && */ pos.getY() <= 5 && rand.chance(8)) { worldIn.spawnParticle(ParticleType.SUSPENDED_DEPTH, (double)pos.getX() + rand.floatv(), (double)(pos.getY()+1) + (rand.floatv() * 0.5f), diff --git a/common/src/common/block/BlockBlackenedDirt.java b/common/src/common/block/BlockBlackenedDirt.java index ac5909c..361c7cb 100644 --- a/common/src/common/block/BlockBlackenedDirt.java +++ b/common/src/common/block/BlockBlackenedDirt.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockBlackenedDirt extends Block { @@ -18,7 +18,7 @@ public class BlockBlackenedDirt extends Block this.setTab(CheatTab.tabNature); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.darkDirtSpread) { diff --git a/common/src/common/block/BlockBlackenedSoil.java b/common/src/common/block/BlockBlackenedSoil.java index a77664e..3e122f6 100644 --- a/common/src/common/block/BlockBlackenedSoil.java +++ b/common/src/common/block/BlockBlackenedSoil.java @@ -10,7 +10,7 @@ import common.model.ModelProvider; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockBlackenedSoil extends Block { @@ -21,7 +21,7 @@ public class BlockBlackenedSoil extends Block this.setTab(CheatTab.tabNature); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (worldIn.getLightFromNeighbors(pos.up()) < 2 && worldIn.getState(pos.up()).getBlock().getLightOpacity() > 6) { diff --git a/common/src/common/block/BlockBlueShroom.java b/common/src/common/block/BlockBlueShroom.java index d0097d9..648fadf 100755 --- a/common/src/common/block/BlockBlueShroom.java +++ b/common/src/common/block/BlockBlueShroom.java @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockBlueShroom extends BlockBush { @@ -19,7 +19,7 @@ public class BlockBlueShroom extends BlockBush this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.blueShroomGrowth > 0 && rand.chance(Config.blueShroomGrowth)) { diff --git a/common/src/common/block/BlockBrewingStand.java b/common/src/common/block/BlockBrewingStand.java index beb51cd..dcd6dc6 100755 --- a/common/src/common/block/BlockBrewingStand.java +++ b/common/src/common/block/BlockBrewingStand.java @@ -23,10 +23,10 @@ import common.tileentity.TileEntityBrewingStand; import common.util.BlockPos; import common.util.BoundingBox; import common.util.Facing; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockBrewingStand extends BlockContainer { @@ -447,7 +447,7 @@ public class BlockBrewingStand extends BlockContainer } } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { double d0 = (double)((float)pos.getX() + 0.4F + rand.floatv() * 0.2F); double d1 = (double)((float)pos.getY() + 0.7F + rand.floatv() * 0.3F); @@ -455,7 +455,7 @@ public class BlockBrewingStand extends BlockContainer worldIn.spawnParticle(ParticleType.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/common/src/common/block/BlockBush.java b/common/src/common/block/BlockBush.java index 94ff784..4ff09d6 100755 --- a/common/src/common/block/BlockBush.java +++ b/common/src/common/block/BlockBush.java @@ -9,7 +9,7 @@ import common.util.BlockPos; import common.util.BoundingBox; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockBush extends Block { @@ -49,7 +49,7 @@ public class BlockBush extends Block this.checkAndDropBlock(worldIn, pos, state); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { this.checkAndDropBlock(worldIn, pos, state); } diff --git a/common/src/common/block/BlockButton.java b/common/src/common/block/BlockButton.java index 4c655c0..28b690c 100755 --- a/common/src/common/block/BlockButton.java +++ b/common/src/common/block/BlockButton.java @@ -24,7 +24,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockButton extends Block { @@ -195,7 +195,7 @@ public class BlockButton extends Block } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { if (((Boolean)state.getValue(POWERED)).booleanValue()) { @@ -226,11 +226,11 @@ public class BlockButton extends Block /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { diff --git a/common/src/common/block/BlockCactus.java b/common/src/common/block/BlockCactus.java index 1ab3926..92db3ca 100755 --- a/common/src/common/block/BlockCactus.java +++ b/common/src/common/block/BlockCactus.java @@ -17,7 +17,7 @@ import common.util.BoundingBox; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockCactus extends Block { @@ -43,7 +43,7 @@ public class BlockCactus extends Block this.setTab(CheatTab.tabPlants); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { BlockPos blockpos = pos.up(); diff --git a/common/src/common/block/BlockChest.java b/common/src/common/block/BlockChest.java index 99af70f..a195e29 100755 --- a/common/src/common/block/BlockChest.java +++ b/common/src/common/block/BlockChest.java @@ -29,7 +29,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockChest extends BlockContainer { @@ -92,7 +92,7 @@ public class BlockChest extends BlockContainer } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.checkForSurroundingChests(worldIn, pos, state); @@ -416,7 +416,7 @@ public class BlockChest extends BlockContainer } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/common/src/common/block/BlockCocoa.java b/common/src/common/block/BlockCocoa.java index 2d5cff9..7eff652 100755 --- a/common/src/common/block/BlockCocoa.java +++ b/common/src/common/block/BlockCocoa.java @@ -21,7 +21,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockCocoa extends BlockDirectional implements IGrowable { @@ -34,7 +34,7 @@ public class BlockCocoa extends BlockDirectional implements IGrowable this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (!this.canBlockStay(worldIn, pos, state)) { @@ -197,7 +197,7 @@ public class BlockCocoa extends BlockDirectional implements IGrowable return true; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { worldIn.setState(pos, state.withProperty(AGE, Integer.valueOf(((Integer)state.getValue(AGE)).intValue() + 1)), 2); } diff --git a/common/src/common/block/BlockContainer.java b/common/src/common/block/BlockContainer.java index 8443549..78a927b 100755 --- a/common/src/common/block/BlockContainer.java +++ b/common/src/common/block/BlockContainer.java @@ -6,7 +6,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockContainer extends Block implements ITileEntityProvider { @@ -34,7 +34,7 @@ public abstract class BlockContainer extends Block implements ITileEntityProvide return -1; } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockRemoved(worldIn, pos, state); worldIn.removeTileEntity(pos); diff --git a/common/src/common/block/BlockCore.java b/common/src/common/block/BlockCore.java index 68bf08a..d23bada 100755 --- a/common/src/common/block/BlockCore.java +++ b/common/src/common/block/BlockCore.java @@ -5,7 +5,7 @@ import common.item.CheatTab; import common.material.Material; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockCore extends Block { public BlockCore() { @@ -13,13 +13,13 @@ public class BlockCore extends Block { this.setTab(CheatTab.tabTech); } - public void onBlockRemoved(WorldServer world, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer world, BlockPos pos, State state) { if(Config.loaders) world.removeLoader(pos); } - public void onBlockAdded(WorldServer world, BlockPos pos, State state) + public void onBlockAdded(AWorldServer world, BlockPos pos, State state) { if(Config.loaders) world.addLoader(pos); diff --git a/common/src/common/block/BlockCrops.java b/common/src/common/block/BlockCrops.java index a67fb61..fee8af4 100755 --- a/common/src/common/block/BlockCrops.java +++ b/common/src/common/block/BlockCrops.java @@ -14,7 +14,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockCrops extends BlockBush implements IGrowable { @@ -40,7 +40,7 @@ public class BlockCrops extends BlockBush implements IGrowable return ground == Blocks.farmland; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { super.updateTick(worldIn, pos, state, rand); @@ -194,7 +194,7 @@ public class BlockCrops extends BlockBush implements IGrowable return true; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { this.grow(worldIn, pos, state); } diff --git a/common/src/common/block/BlockDaylightDetector.java b/common/src/common/block/BlockDaylightDetector.java index 9e3110a..f213c1f 100755 --- a/common/src/common/block/BlockDaylightDetector.java +++ b/common/src/common/block/BlockDaylightDetector.java @@ -24,7 +24,7 @@ import common.world.IWorldAccess; import common.world.LightType; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockDaylightDetector extends BlockContainer { @@ -53,7 +53,7 @@ public class BlockDaylightDetector extends BlockContainer return ((Integer)state.getValue(POWER)).intValue(); } - public void updatePower(WorldServer worldIn, BlockPos pos) + public void updatePower(AWorldServer worldIn, BlockPos pos) { if (!worldIn.dimension.hasNoLight()) { @@ -90,12 +90,12 @@ public class BlockDaylightDetector extends BlockContainer if (this.inverted) { worldIn.setState(pos, Blocks.daylight_detector.getState().withProperty(POWER, state.getValue(POWER)), 4); - Blocks.daylight_detector.updatePower((WorldServer)worldIn, pos); + Blocks.daylight_detector.updatePower((AWorldServer)worldIn, pos); } else { worldIn.setState(pos, Blocks.daylight_detector_inverted.getState().withProperty(POWER, state.getValue(POWER)), 4); - Blocks.daylight_detector_inverted.updatePower((WorldServer)worldIn, pos); + Blocks.daylight_detector_inverted.updatePower((AWorldServer)worldIn, pos); } return true; diff --git a/common/src/common/block/BlockDispenser.java b/common/src/common/block/BlockDispenser.java index 6f0fd6c..98595fe 100755 --- a/common/src/common/block/BlockDispenser.java +++ b/common/src/common/block/BlockDispenser.java @@ -28,7 +28,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockDispenser extends BlockContainer { @@ -52,7 +52,7 @@ public class BlockDispenser extends BlockContainer return 4; } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockAdded(worldIn, pos, state); this.setDefaultDirection(worldIn, pos, state); @@ -172,7 +172,7 @@ public class BlockDispenser extends BlockContainer } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { @@ -215,7 +215,7 @@ public class BlockDispenser extends BlockContainer } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/common/src/common/block/BlockDoublePlant.java b/common/src/common/block/BlockDoublePlant.java index 3164ea6..2e835f5 100755 --- a/common/src/common/block/BlockDoublePlant.java +++ b/common/src/common/block/BlockDoublePlant.java @@ -27,7 +27,7 @@ import common.util.Facing.Axis; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockDoublePlant extends BlockBush implements IGrowable { @@ -45,7 +45,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable // this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.plantDry && worldIn.getTemperatureC(pos) >= 50.0f) { @@ -295,7 +295,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable return true; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { spawnAsEntity(worldIn, pos, new ItemStack(this, 1, this.getVariant(worldIn, pos).getMeta())); } diff --git a/common/src/common/block/BlockDragonEgg.java b/common/src/common/block/BlockDragonEgg.java index 15dc5e2..2d90ee8 100755 --- a/common/src/common/block/BlockDragonEgg.java +++ b/common/src/common/block/BlockDragonEgg.java @@ -13,7 +13,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockDragonEgg extends Block { @@ -82,7 +82,7 @@ public class BlockDragonEgg extends Block this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); } @@ -95,7 +95,7 @@ public class BlockDragonEgg extends Block worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.blockGravity) this.checkFall(worldIn, pos); diff --git a/common/src/common/block/BlockDynamicLiquid.java b/common/src/common/block/BlockDynamicLiquid.java index 48534b4..e9a1eda 100755 --- a/common/src/common/block/BlockDynamicLiquid.java +++ b/common/src/common/block/BlockDynamicLiquid.java @@ -11,7 +11,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockDynamicLiquid extends BlockLiquid { @@ -29,7 +29,7 @@ public class BlockDynamicLiquid extends BlockLiquid worldIn.setState(pos, getStaticBlock(this).getState().withProperty(LEVEL, currentState.getValue(LEVEL)), 2); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(!Config.liquidPhysics) return; @@ -293,7 +293,7 @@ public class BlockDynamicLiquid extends BlockLiquid return material != this.material && material != Material.lava && !this.isBlocked(worldIn, pos, state); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if (!this.checkForMixing(worldIn, pos, state)) { diff --git a/common/src/common/block/BlockEnchantmentTable.java b/common/src/common/block/BlockEnchantmentTable.java index 4dfc2d3..c27dbab 100755 --- a/common/src/common/block/BlockEnchantmentTable.java +++ b/common/src/common/block/BlockEnchantmentTable.java @@ -14,9 +14,9 @@ import common.tileentity.TileEntity; import common.tileentity.TileEntityEnchantmentTable; import common.util.BlockPos; import common.util.Facing; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; public class BlockEnchantmentTable extends BlockContainer { @@ -43,7 +43,7 @@ public class BlockEnchantmentTable extends BlockContainer return false; } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { super.randomDisplayTick(worldIn, pos, state, rand); diff --git a/common/src/common/block/BlockFalling.java b/common/src/common/block/BlockFalling.java index 6ce696b..e483126 100755 --- a/common/src/common/block/BlockFalling.java +++ b/common/src/common/block/BlockFalling.java @@ -9,7 +9,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockFalling extends Block { @@ -26,7 +26,7 @@ public class BlockFalling extends Block super(materialIn); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); } @@ -39,7 +39,7 @@ public class BlockFalling extends Block worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos)); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(/* !worldIn.client && */ Config.blockGravity) this.checkFallable(worldIn, pos); diff --git a/common/src/common/block/BlockFarmland.java b/common/src/common/block/BlockFarmland.java index 66cf24a..7367cf4 100755 --- a/common/src/common/block/BlockFarmland.java +++ b/common/src/common/block/BlockFarmland.java @@ -18,7 +18,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockFarmland extends Block { @@ -51,7 +51,7 @@ public class BlockFarmland extends Block return false; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { int i = ((Integer)state.getValue(MOISTURE)).intValue(); diff --git a/common/src/common/block/BlockFire.java b/common/src/common/block/BlockFire.java index b2afa60..e0bc2f7 100755 --- a/common/src/common/block/BlockFire.java +++ b/common/src/common/block/BlockFire.java @@ -21,10 +21,10 @@ import common.util.BoundingBox; import common.util.Facing; import common.world.IBlockAccess; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockFire extends Block { @@ -115,7 +115,7 @@ public class BlockFire extends Block return 30; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.fire) { @@ -350,7 +350,7 @@ public class BlockFire extends Block } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if ( // (worldIn.dimension.getDimensionId() < -1 || worldIn.dimension.getDimensionId() > 0) || !Blocks.portal.tryIgnitePortal(worldIn, pos, worldIn.rand.zrange(8))) @@ -366,7 +366,7 @@ public class BlockFire extends Block } } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if (rand.chance(24)) { diff --git a/common/src/common/block/BlockFloorPortal.java b/common/src/common/block/BlockFloorPortal.java index 18b87df..a365a47 100755 --- a/common/src/common/block/BlockFloorPortal.java +++ b/common/src/common/block/BlockFloorPortal.java @@ -16,9 +16,9 @@ import common.util.BlockPos; import common.util.BoundingBox; import common.util.Facing; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; public class BlockFloorPortal extends Block { @@ -90,7 +90,7 @@ public class BlockFloorPortal extends Block entityIn.setFlatPortal(); } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { double d0 = (double)((float)pos.getX() + rand.floatv()); double d1 = (double)((float)pos.getY() + 0.8F); diff --git a/common/src/common/block/BlockFlower.java b/common/src/common/block/BlockFlower.java index dcdebbb..2b2091f 100755 --- a/common/src/common/block/BlockFlower.java +++ b/common/src/common/block/BlockFlower.java @@ -19,7 +19,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Identifyable; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockFlower extends BlockBush { @@ -31,7 +31,7 @@ public abstract class BlockFlower extends BlockBush // this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.flowerDry && worldIn.getTemperatureC(pos) >= 50.0f) { diff --git a/common/src/common/block/BlockFlowerPot.java b/common/src/common/block/BlockFlowerPot.java index da6046a..d25970a 100755 --- a/common/src/common/block/BlockFlowerPot.java +++ b/common/src/common/block/BlockFlowerPot.java @@ -18,7 +18,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockFlowerPot extends Block // Container { @@ -242,7 +242,7 @@ public class BlockFlowerPot extends Block // Container } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { int type = state.getValue(CONTENTS); if(type > 0) diff --git a/common/src/common/block/BlockFurnace.java b/common/src/common/block/BlockFurnace.java index 8d4572d..73731a1 100755 --- a/common/src/common/block/BlockFurnace.java +++ b/common/src/common/block/BlockFurnace.java @@ -20,10 +20,10 @@ import common.tileentity.TileEntity; import common.tileentity.TileEntityFurnace; import common.util.BlockPos; import common.util.Facing; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockFurnace extends BlockContainer { @@ -46,7 +46,7 @@ public class BlockFurnace extends BlockContainer return ItemRegistry.getItemFromBlock(Blocks.furnace); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.setDefaultFacing(worldIn, pos, state); } @@ -83,7 +83,7 @@ public class BlockFurnace extends BlockContainer } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if (this.isBurning) { @@ -199,7 +199,7 @@ public class BlockFurnace extends BlockContainer } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { if (!keepInventory) { diff --git a/common/src/common/block/BlockGrass.java b/common/src/common/block/BlockGrass.java index dbf04d5..440a2b0 100755 --- a/common/src/common/block/BlockGrass.java +++ b/common/src/common/block/BlockGrass.java @@ -16,7 +16,7 @@ import common.util.BlockPos; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockGrass extends Block implements IGrowable { @@ -56,7 +56,7 @@ public class BlockGrass extends Block implements IGrowable return Colorizer.getGrassColor(worldIn, pos); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { @@ -111,7 +111,7 @@ public class BlockGrass extends Block implements IGrowable return true; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { BlockPos blockpos = pos.up(); diff --git a/common/src/common/block/BlockHopper.java b/common/src/common/block/BlockHopper.java index 70438d2..88832e8 100755 --- a/common/src/common/block/BlockHopper.java +++ b/common/src/common/block/BlockHopper.java @@ -26,7 +26,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockHopper extends BlockContainer { @@ -165,7 +165,7 @@ public class BlockHopper extends BlockContainer } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.updateState(worldIn, pos, state); } @@ -208,7 +208,7 @@ public class BlockHopper extends BlockContainer } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/common/src/common/block/BlockIce.java b/common/src/common/block/BlockIce.java index fae0c6c..a1e5981 100755 --- a/common/src/common/block/BlockIce.java +++ b/common/src/common/block/BlockIce.java @@ -14,7 +14,7 @@ import common.util.BlockPos; import common.world.LightType; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockIce extends BlockBreakable { @@ -71,7 +71,7 @@ public class BlockIce extends BlockBreakable return 0; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.iceMelt && ((worldIn.getLightFor(LightType.BLOCK, pos) > 11 - this.getLightOpacity()) || !worldIn.canFreezeAt(pos))) { diff --git a/common/src/common/block/BlockLeaves.java b/common/src/common/block/BlockLeaves.java index bfe3d39..8c2014a 100755 --- a/common/src/common/block/BlockLeaves.java +++ b/common/src/common/block/BlockLeaves.java @@ -24,10 +24,10 @@ import common.rng.Random; import common.tileentity.TileEntity; import common.util.BlockPos; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockLeaves extends BlockLeavesBase { @@ -67,7 +67,7 @@ public class BlockLeaves extends BlockLeavesBase // return BiomeColorHelper.getFoliageColorAtPos(worldIn, pos); // } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { int i = 1; int j = i + 1; @@ -96,7 +96,7 @@ public class BlockLeaves extends BlockLeavesBase } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.seasonLeaves && state.getValue(TYPE) != worldIn.getLeavesGen(pos)) { worldIn.setState(pos, state.withProperty(TYPE, worldIn.getLeavesGen(pos)), 2); @@ -213,7 +213,7 @@ public class BlockLeaves extends BlockLeavesBase // } } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if (worldIn.isRainingAt(pos.up(), true) && !worldIn.isBlockSolid(pos.down()) && rand.chance(15)) // == 1 { diff --git a/common/src/common/block/BlockLever.java b/common/src/common/block/BlockLever.java index a48cb6d..3e33154 100755 --- a/common/src/common/block/BlockLever.java +++ b/common/src/common/block/BlockLever.java @@ -18,7 +18,7 @@ import common.util.Identifyable; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockLever extends Block { @@ -215,7 +215,7 @@ public class BlockLever extends Block } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { if (((Boolean)state.getValue(POWERED)).booleanValue()) { diff --git a/common/src/common/block/BlockLiquid.java b/common/src/common/block/BlockLiquid.java index ef20f41..9f036fd 100755 --- a/common/src/common/block/BlockLiquid.java +++ b/common/src/common/block/BlockLiquid.java @@ -20,10 +20,10 @@ import common.util.Facing; import common.util.Vec3; import common.world.IBlockAccess; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockLiquid extends Block { @@ -234,7 +234,7 @@ public abstract class BlockLiquid extends Block return this.opaque ? BlockLayer.SOLID : BlockLayer.TRANSLUCENT; } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { double d0 = (double)pos.getX(); double d1 = (double)pos.getY(); @@ -302,7 +302,7 @@ public abstract class BlockLiquid extends Block return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D : ExtMath.atan2(vec3.zCoord, vec3.xCoord) - (Math.PI / 2D); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.checkForMixing(worldIn, pos, state); } diff --git a/common/src/common/block/BlockLog.java b/common/src/common/block/BlockLog.java index 234583e..1646cf3 100755 --- a/common/src/common/block/BlockLog.java +++ b/common/src/common/block/BlockLog.java @@ -13,7 +13,7 @@ import common.util.Facing; import common.util.Identifyable; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockLog extends BlockRotatedPillar { @@ -28,7 +28,7 @@ public class BlockLog extends BlockRotatedPillar this.setStepSound(SoundType.WOOD); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { int i = 4; int j = i + 1; diff --git a/common/src/common/block/BlockMachine.java b/common/src/common/block/BlockMachine.java index d65db95..782ab21 100755 --- a/common/src/common/block/BlockMachine.java +++ b/common/src/common/block/BlockMachine.java @@ -13,7 +13,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockMachine extends BlockDirectional implements ITileEntityProvider { public BlockMachine() { @@ -25,7 +25,7 @@ public abstract class BlockMachine extends BlockDirectional implements ITileEnti public abstract TileEntity createNewTileEntity(World worldIn, int meta); - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) { + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.updateState(worldIn, pos, state); } @@ -54,7 +54,7 @@ public abstract class BlockMachine extends BlockDirectional implements ITileEnti // } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) { + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); if(tileentity instanceof TileEntityMachine) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMachine)tileentity); diff --git a/common/src/common/block/BlockMushroom.java b/common/src/common/block/BlockMushroom.java index 3e45fab..0f11d22 100755 --- a/common/src/common/block/BlockMushroom.java +++ b/common/src/common/block/BlockMushroom.java @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.foliage.WorldGenBigMushroom; @@ -21,7 +21,7 @@ public class BlockMushroom extends BlockBush implements IGrowable this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.shroomGrowth > 0 && rand.chance(Config.shroomGrowth)) { @@ -86,7 +86,7 @@ public class BlockMushroom extends BlockBush implements IGrowable } } - public boolean generateBigMushroom(WorldServer worldIn, BlockPos pos, State state, Random rand) + public boolean generateBigMushroom(AWorldServer worldIn, BlockPos pos, State state, Random rand) { worldIn.setBlockToAir(pos); FeatureGenerator worldgenerator = null; @@ -124,7 +124,7 @@ public class BlockMushroom extends BlockBush implements IGrowable return (double)rand.floatv() < 0.4D; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { this.generateBigMushroom(worldIn, pos, state, rand); } diff --git a/common/src/common/block/BlockMycelium.java b/common/src/common/block/BlockMycelium.java index a883235..977c979 100755 --- a/common/src/common/block/BlockMycelium.java +++ b/common/src/common/block/BlockMycelium.java @@ -13,9 +13,9 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockMycelium extends Block { @@ -39,7 +39,7 @@ public class BlockMycelium extends Block return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { @@ -68,7 +68,7 @@ public class BlockMycelium extends Block // } } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { super.randomDisplayTick(worldIn, pos, state, rand); diff --git a/common/src/common/block/BlockNuke.java b/common/src/common/block/BlockNuke.java index 70e4c0e..7f70ced 100755 --- a/common/src/common/block/BlockNuke.java +++ b/common/src/common/block/BlockNuke.java @@ -11,7 +11,7 @@ import common.util.BlockPos; import common.world.Explosion; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockNuke extends Block { @@ -21,7 +21,7 @@ public class BlockNuke extends Block this.setTab(CheatTab.tabTech); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockAdded(worldIn, pos, state); diff --git a/common/src/common/block/BlockPistonBase.java b/common/src/common/block/BlockPistonBase.java index 5fe919c..e09a0e3 100755 --- a/common/src/common/block/BlockPistonBase.java +++ b/common/src/common/block/BlockPistonBase.java @@ -26,7 +26,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockPistonBase extends Block { @@ -291,7 +291,7 @@ public class BlockPistonBase extends Block } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if (!worldIn.client && worldIn.getTileEntity(pos) == null) { diff --git a/common/src/common/block/BlockPistonHead.java b/common/src/common/block/BlockPistonHead.java index 07c783e..fff8415 100755 --- a/common/src/common/block/BlockPistonHead.java +++ b/common/src/common/block/BlockPistonHead.java @@ -22,7 +22,7 @@ import common.util.Identifyable; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockPistonHead extends Block { @@ -59,7 +59,7 @@ public class BlockPistonHead extends Block // super.onBlockHarvested(worldIn, pos, state, player); // } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockRemoved(worldIn, pos, state); Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite(); diff --git a/common/src/common/block/BlockPistonMoving.java b/common/src/common/block/BlockPistonMoving.java index 50fddc2..8047a3c 100755 --- a/common/src/common/block/BlockPistonMoving.java +++ b/common/src/common/block/BlockPistonMoving.java @@ -18,7 +18,7 @@ import common.util.Vec3; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockPistonMoving extends BlockContainer { @@ -45,7 +45,7 @@ public class BlockPistonMoving extends BlockContainer return new TileEntityPiston(state, facing, extending, renderHead); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/common/src/common/block/BlockPortal.java b/common/src/common/block/BlockPortal.java index 14112ba..190f899 100755 --- a/common/src/common/block/BlockPortal.java +++ b/common/src/common/block/BlockPortal.java @@ -19,9 +19,9 @@ import common.util.BoundingBox; import common.util.Facing; import common.util.Facing.Axis; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; public class BlockPortal extends BlockBreakable { @@ -37,7 +37,7 @@ public class BlockPortal extends BlockBreakable // this.setTickRandomly(); } -// public void updateTick(WorldServer worldIn, BlockPos pos, IBlockState state, Random rand) +// public void updateTick(IWorldServer worldIn, BlockPos pos, IBlockState state, Random rand) // { //// super.updateTick(worldIn, pos, state, rand); // @@ -208,7 +208,7 @@ public class BlockPortal extends BlockBreakable } } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { // if (rand.chance(100)) // { diff --git a/common/src/common/block/BlockPumpkin.java b/common/src/common/block/BlockPumpkin.java index caf602a..53866ad 100755 --- a/common/src/common/block/BlockPumpkin.java +++ b/common/src/common/block/BlockPumpkin.java @@ -34,7 +34,7 @@ public class BlockPumpkin extends BlockDirectional this.setTab(CheatTab.tabPlants); } -// public void onBlockAdded(WorldServer worldIn, BlockPos pos, IBlockState state) +// public void onBlockAdded(IWorldServer worldIn, BlockPos pos, IBlockState state) // { // super.onBlockAdded(worldIn, pos, state); // this.trySpawnGolem(worldIn, pos); diff --git a/common/src/common/block/BlockRailBase.java b/common/src/common/block/BlockRailBase.java index ebcab36..01c0256 100755 --- a/common/src/common/block/BlockRailBase.java +++ b/common/src/common/block/BlockRailBase.java @@ -20,7 +20,7 @@ import common.util.Vec3; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockRailBase extends Block { @@ -92,7 +92,7 @@ public abstract class BlockRailBase extends Block return worldIn.isBlockSolid(pos.down()); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if (!worldIn.client) { @@ -168,7 +168,7 @@ public abstract class BlockRailBase extends Block return BlockLayer.CUTOUT; } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockRemoved(worldIn, pos, state); diff --git a/common/src/common/block/BlockRailDetector.java b/common/src/common/block/BlockRailDetector.java index 7579307..1c2fbd6 100755 --- a/common/src/common/block/BlockRailDetector.java +++ b/common/src/common/block/BlockRailDetector.java @@ -19,7 +19,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRailDetector extends BlockRailBase { @@ -72,11 +72,11 @@ public class BlockRailDetector extends BlockRailBase /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (/* !worldIn.client && */ ((Boolean)state.getValue(POWERED)).booleanValue()) { @@ -129,7 +129,7 @@ public class BlockRailDetector extends BlockRailBase worldIn.updateComparatorOutputLevel(pos, this); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockAdded(worldIn, pos, state); this.updatePoweredState(worldIn, pos, state); diff --git a/common/src/common/block/BlockRedstoneComparator.java b/common/src/common/block/BlockRedstoneComparator.java index 9f6b9d2..b44b3dc 100755 --- a/common/src/common/block/BlockRedstoneComparator.java +++ b/common/src/common/block/BlockRedstoneComparator.java @@ -21,7 +21,7 @@ import common.util.Identifyable; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider { @@ -176,7 +176,7 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile protected void updateState(World worldIn, BlockPos pos, State state) { - if (worldIn.client || !((WorldServer)worldIn).isBlockTickPending(pos, this)) + if (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this)) { int i = this.calculateOutput(worldIn, pos, state); TileEntity tileentity = worldIn.getTileEntity(pos); @@ -187,12 +187,12 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile if (this.isFacingTowardsRepeater(worldIn, pos, state)) { if(!worldIn.client) - ((WorldServer)worldIn).updateBlockTick(pos, this, 2, -1); + ((AWorldServer)worldIn).updateBlockTick(pos, this, 2, -1); } else { if(!worldIn.client) - ((WorldServer)worldIn).updateBlockTick(pos, this, 2, 0); + ((AWorldServer)worldIn).updateBlockTick(pos, this, 2, 0); } } } @@ -229,7 +229,7 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (this.isRepeaterPowered) { @@ -239,13 +239,13 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile this.onStateChange(worldIn, pos, state); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockAdded(worldIn, pos, state); worldIn.setTileEntity(pos, this.createNewTileEntity(worldIn, 0)); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockRemoved(worldIn, pos, state); worldIn.removeTileEntity(pos); diff --git a/common/src/common/block/BlockRedstoneDiode.java b/common/src/common/block/BlockRedstoneDiode.java index 4b0c3d3..7be2128 100755 --- a/common/src/common/block/BlockRedstoneDiode.java +++ b/common/src/common/block/BlockRedstoneDiode.java @@ -11,7 +11,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class BlockRedstoneDiode extends BlockDirectional { @@ -43,11 +43,11 @@ public abstract class BlockRedstoneDiode extends BlockDirectional /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (!this.isLocked(worldIn, pos, state)) { @@ -116,7 +116,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional { boolean flag = this.shouldBePowered(worldIn, pos, state); - if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && (worldIn.client || !((WorldServer)worldIn).isBlockTickPending(pos, this))) + if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this))) { int i = -1; @@ -130,7 +130,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional } if(!worldIn.client) - ((WorldServer)worldIn).updateBlockTick(pos, this, this.getDelay(state), i); + ((AWorldServer)worldIn).updateBlockTick(pos, this, this.getDelay(state), i); } } } @@ -205,7 +205,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.notifyNeighbors(worldIn, pos, state); } diff --git a/common/src/common/block/BlockRedstoneLight.java b/common/src/common/block/BlockRedstoneLight.java index 017346b..579156b 100755 --- a/common/src/common/block/BlockRedstoneLight.java +++ b/common/src/common/block/BlockRedstoneLight.java @@ -9,7 +9,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRedstoneLight extends Block { @@ -26,7 +26,7 @@ public class BlockRedstoneLight extends Block } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if (!worldIn.client) { @@ -59,7 +59,7 @@ public class BlockRedstoneLight extends Block } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { diff --git a/common/src/common/block/BlockRedstoneOre.java b/common/src/common/block/BlockRedstoneOre.java index 9d7f947..13eb609 100755 --- a/common/src/common/block/BlockRedstoneOre.java +++ b/common/src/common/block/BlockRedstoneOre.java @@ -14,10 +14,10 @@ import common.model.ParticleType; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRedstoneOre extends Block { @@ -74,7 +74,7 @@ public class BlockRedstoneOre extends Block } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (this == Blocks.lit_redstone_ore) { @@ -120,7 +120,7 @@ public class BlockRedstoneOre extends Block } } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if (this.isOn) { diff --git a/common/src/common/block/BlockRedstoneRepeater.java b/common/src/common/block/BlockRedstoneRepeater.java index 208e723..a98316f 100755 --- a/common/src/common/block/BlockRedstoneRepeater.java +++ b/common/src/common/block/BlockRedstoneRepeater.java @@ -15,10 +15,10 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRedstoneRepeater extends BlockRedstoneDiode { @@ -105,7 +105,7 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode return isRedstoneRepeaterBlockID(blockIn); } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if (this.isRepeaterPowered) { @@ -127,7 +127,7 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockRemoved(worldIn, pos, state); this.notifyNeighbors(worldIn, pos, state); diff --git a/common/src/common/block/BlockRedstoneTorch.java b/common/src/common/block/BlockRedstoneTorch.java index 5e6bbdc..1de1741 100755 --- a/common/src/common/block/BlockRedstoneTorch.java +++ b/common/src/common/block/BlockRedstoneTorch.java @@ -15,17 +15,17 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRedstoneTorch extends BlockTorch { private static Map> toggles = Maps.>newHashMap(); private final boolean isOn; - private boolean isBurnedOut(WorldServer worldIn, BlockPos pos, boolean turnOff) + private boolean isBurnedOut(AWorldServer worldIn, BlockPos pos, boolean turnOff) { if (!toggles.containsKey(worldIn)) { @@ -74,7 +74,7 @@ public class BlockRedstoneTorch extends BlockTorch return 2; } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if (this.isOn) { @@ -85,7 +85,7 @@ public class BlockRedstoneTorch extends BlockTorch } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { if (this.isOn) { @@ -110,11 +110,11 @@ public class BlockRedstoneTorch extends BlockTorch /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { boolean flag = this.shouldBeOff(worldIn, pos, state); List list = (List)toggles.get(worldIn); @@ -187,7 +187,7 @@ public class BlockRedstoneTorch extends BlockTorch return true; } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { if (this.isOn) { diff --git a/common/src/common/block/BlockRedstoneWire.java b/common/src/common/block/BlockRedstoneWire.java index e023983..a77e77a 100755 --- a/common/src/common/block/BlockRedstoneWire.java +++ b/common/src/common/block/BlockRedstoneWire.java @@ -26,10 +26,10 @@ import common.util.Facing; import common.util.Identifyable; import common.world.IBlockAccess; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockRedstoneWire extends Block { @@ -540,7 +540,7 @@ public class BlockRedstoneWire extends Block } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { if (!worldIn.client) { @@ -572,7 +572,7 @@ public class BlockRedstoneWire extends Block } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockRemoved(worldIn, pos, state); @@ -773,7 +773,7 @@ public class BlockRedstoneWire extends Block return -16777216 | i << 16 | j << 8 | k; } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { int i = ((Integer)state.getValue(POWER)).intValue(); diff --git a/common/src/common/block/BlockReed.java b/common/src/common/block/BlockReed.java index 8ac6c66..8d7b151 100755 --- a/common/src/common/block/BlockReed.java +++ b/common/src/common/block/BlockReed.java @@ -17,7 +17,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockReed extends Block { @@ -32,7 +32,7 @@ public class BlockReed extends Block this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.reedDry && worldIn.getTemperatureC(pos) >= 50.0f) { diff --git a/common/src/common/block/BlockSapling.java b/common/src/common/block/BlockSapling.java index 3a8edb1..d612805 100755 --- a/common/src/common/block/BlockSapling.java +++ b/common/src/common/block/BlockSapling.java @@ -15,7 +15,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.tree.WorldGenBaseTree; import common.worldgen.tree.WorldGenBigTree; @@ -52,7 +52,7 @@ public class BlockSapling extends BlockBush implements IGrowable // return I18n.translate(this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name"); // } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.saplingDry && worldIn.getTemperatureC(pos) >= 50.0f) { @@ -71,7 +71,7 @@ public class BlockSapling extends BlockBush implements IGrowable // } } - public void grow(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void grow(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (((Integer)state.getValue(STAGE)).intValue() == 0) { @@ -83,7 +83,7 @@ public class BlockSapling extends BlockBush implements IGrowable } } - public void generateTree(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void generateTree(AWorldServer worldIn, BlockPos pos, State state, Random rand) { WoodType type = state.getBlock() instanceof BlockSapling ? ((BlockSapling)state.getBlock()).type : WoodType.OAK; State log = type == WoodType.CHERRY ? Blocks.cherry_log.getState() : // .withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.CHERRY) : @@ -264,7 +264,7 @@ public class BlockSapling extends BlockBush implements IGrowable return (double)worldIn.rand.floatv() < 0.45D; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { this.grow(worldIn, pos, state, rand); } diff --git a/common/src/common/block/BlockSign.java b/common/src/common/block/BlockSign.java index a440937..70691aa 100755 --- a/common/src/common/block/BlockSign.java +++ b/common/src/common/block/BlockSign.java @@ -94,7 +94,7 @@ public class BlockSign extends BlockContainer // return true; // } -// public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) +// public void onBlockRemoved(IWorldServer worldIn, BlockPos pos, State state) // { // if(!worldIn.client) { // TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/common/src/common/block/BlockSkull.java b/common/src/common/block/BlockSkull.java index d73ccae..97d44ec 100755 --- a/common/src/common/block/BlockSkull.java +++ b/common/src/common/block/BlockSkull.java @@ -17,7 +17,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockSkull extends BlockContainer { @@ -102,7 +102,7 @@ public class BlockSkull extends BlockContainer // super.onBlockHarvested(worldIn, pos, state, player); // } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { if (!worldIn.client) { diff --git a/common/src/common/block/BlockSnow.java b/common/src/common/block/BlockSnow.java index 489585c..3647804 100755 --- a/common/src/common/block/BlockSnow.java +++ b/common/src/common/block/BlockSnow.java @@ -23,7 +23,7 @@ import common.world.IWorldAccess; import common.world.LightType; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockSnow extends Block { @@ -135,7 +135,7 @@ public class BlockSnow extends Block return 0; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.snowMelt && ((worldIn.getLightFor(LightType.BLOCK, pos) > 11) || !worldIn.canFreezeAt(pos))) { diff --git a/common/src/common/block/BlockSnowBlock.java b/common/src/common/block/BlockSnowBlock.java index a85f7cb..0e4a60e 100755 --- a/common/src/common/block/BlockSnowBlock.java +++ b/common/src/common/block/BlockSnowBlock.java @@ -9,7 +9,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.LightType; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockSnowBlock extends Block { @@ -36,7 +36,7 @@ public class BlockSnowBlock extends Block return 4; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.snowFullMelt && worldIn.getLightFor(LightType.BLOCK, pos) > 11) { diff --git a/common/src/common/block/BlockStainedGlass.java b/common/src/common/block/BlockStainedGlass.java index 47ae319..de0f6a2 100755 --- a/common/src/common/block/BlockStainedGlass.java +++ b/common/src/common/block/BlockStainedGlass.java @@ -85,7 +85,7 @@ public class BlockStainedGlass extends BlockBreakable return this.getState().withProperty(COLOR, DyeColor.byMetadata(meta)); } -// public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) +// public void onBlockAdded(IWorldServer worldIn, BlockPos pos, State state) // { // if (!worldIn.client) // { @@ -93,7 +93,7 @@ public class BlockStainedGlass extends BlockBreakable // } // } // -// public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) +// public void onBlockRemoved(IWorldServer worldIn, BlockPos pos, State state) // { // if (!worldIn.client) // { diff --git a/common/src/common/block/BlockStainedGlassPane.java b/common/src/common/block/BlockStainedGlassPane.java index eb50a9e..254d120 100755 --- a/common/src/common/block/BlockStainedGlassPane.java +++ b/common/src/common/block/BlockStainedGlassPane.java @@ -77,7 +77,7 @@ public class BlockStainedGlassPane extends BlockPane return new IProperty[] {NORTH, EAST, WEST, SOUTH, COLOR}; } -// public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) +// public void onBlockAdded(IWorldServer worldIn, BlockPos pos, State state) // { // if (!worldIn.client) // { @@ -85,7 +85,7 @@ public class BlockStainedGlassPane extends BlockPane // } // } // -// public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) +// public void onBlockRemoved(IWorldServer worldIn, BlockPos pos, State state) // { // if (!worldIn.client) // { diff --git a/common/src/common/block/BlockStairs.java b/common/src/common/block/BlockStairs.java index cb917cf..8c6f5d9 100755 --- a/common/src/common/block/BlockStairs.java +++ b/common/src/common/block/BlockStairs.java @@ -27,10 +27,10 @@ import common.util.Vec3; import common.world.Explosion; import common.world.IBlockAccess; import common.world.IWorldAccess; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockStairs extends Block { @@ -561,7 +561,7 @@ public class BlockStairs extends Block this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { this.modelBlock.randomDisplayTick(worldIn, pos, state, rand); } @@ -633,13 +633,13 @@ public class BlockStairs extends Block return this.modelBlock.canPlaceBlockAt(worldIn, pos); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.onNeighborBlockChange(worldIn, pos, this.modelState, Blocks.air); this.modelBlock.onBlockAdded(worldIn, pos, this.modelState); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { this.modelBlock.onBlockRemoved(worldIn, pos, this.modelState); } @@ -652,7 +652,7 @@ public class BlockStairs extends Block this.modelBlock.onEntityCollidedWithBlock(worldIn, pos, entityIn); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { this.modelBlock.updateTick(worldIn, pos, state, rand); } diff --git a/common/src/common/block/BlockStaticLiquid.java b/common/src/common/block/BlockStaticLiquid.java index b087f92..5b5b29f 100755 --- a/common/src/common/block/BlockStaticLiquid.java +++ b/common/src/common/block/BlockStaticLiquid.java @@ -8,7 +8,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockStaticLiquid extends BlockLiquid { @@ -41,7 +41,7 @@ public class BlockStaticLiquid extends BlockLiquid worldIn.scheduleUpdate(pos, blockdynamicliquid, this.tickRate(worldIn, pos)); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if (Config.lavaFire && this.material == Material.lava) { diff --git a/common/src/common/block/BlockStem.java b/common/src/common/block/BlockStem.java index 171047a..d42ae2b 100755 --- a/common/src/common/block/BlockStem.java +++ b/common/src/common/block/BlockStem.java @@ -21,7 +21,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockStem extends BlockBush implements IGrowable { @@ -73,7 +73,7 @@ public class BlockStem extends BlockBush implements IGrowable return ground == Blocks.farmland; } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { super.updateTick(worldIn, pos, state, rand); @@ -213,7 +213,7 @@ public class BlockStem extends BlockBush implements IGrowable return true; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { this.growStem(worldIn, pos, state); } diff --git a/common/src/common/block/BlockTNT.java b/common/src/common/block/BlockTNT.java index 7f121a1..1dfc2a3 100755 --- a/common/src/common/block/BlockTNT.java +++ b/common/src/common/block/BlockTNT.java @@ -23,7 +23,7 @@ import common.util.Facing; import common.world.Explosion; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockTNT extends Block { @@ -37,7 +37,7 @@ public class BlockTNT extends Block this.setTab(CheatTab.tabTech); } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { super.onBlockAdded(worldIn, pos, state); diff --git a/common/src/common/block/BlockTallGrass.java b/common/src/common/block/BlockTallGrass.java index aa2e686..a527f19 100755 --- a/common/src/common/block/BlockTallGrass.java +++ b/common/src/common/block/BlockTallGrass.java @@ -23,7 +23,7 @@ import common.util.Identifyable; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockTallGrass extends BlockBush implements IGrowable { @@ -38,7 +38,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable // this.setTickRandomly(); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.tallgrassDry && worldIn.getTemperatureC(pos) >= 50.0f && state.getValue(TYPE) != EnumType.DEAD_BUSH) { @@ -147,7 +147,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable return true; } - public void grow(WorldServer worldIn, Random rand, BlockPos pos, State state) + public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state) { BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.GRASS; diff --git a/common/src/common/block/BlockTorch.java b/common/src/common/block/BlockTorch.java index 53d5940..a249b7e 100755 --- a/common/src/common/block/BlockTorch.java +++ b/common/src/common/block/BlockTorch.java @@ -20,10 +20,10 @@ import common.util.Facing; import common.util.HitPosition; import common.util.Vec3; import common.world.Chunk; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockTorch extends Block { @@ -135,7 +135,7 @@ public class BlockTorch extends Block } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { this.checkForDrop(worldIn, pos, state); } @@ -234,7 +234,7 @@ public class BlockTorch extends Block return super.collisionRayTrace(worldIn, pos, start, end); } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { Facing enumfacing = (Facing)state.getValue(FACING); double d0 = (double)pos.getX() + 0.5D; diff --git a/common/src/common/block/BlockTripWire.java b/common/src/common/block/BlockTripWire.java index 7512125..e02e941 100755 --- a/common/src/common/block/BlockTripWire.java +++ b/common/src/common/block/BlockTripWire.java @@ -23,7 +23,7 @@ import common.world.IBlockAccess; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockTripWire extends Block { @@ -124,14 +124,14 @@ public class BlockTripWire extends Block } } - public void onBlockAdded(WorldServer worldIn, BlockPos pos, State state) + public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) { state = state.withProperty(SUSPENDED, Boolean.valueOf(!worldIn.isBlockSolid(pos.down()))); worldIn.setState(pos, state, 3); this.notifyHook(worldIn, pos, state); } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { this.notifyHook(worldIn, pos, state.withProperty(POWERED, Boolean.valueOf(true))); } @@ -191,11 +191,11 @@ public class BlockTripWire extends Block /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) // { diff --git a/common/src/common/block/BlockTripWireHook.java b/common/src/common/block/BlockTripWireHook.java index 0c8afda..778de6c 100755 --- a/common/src/common/block/BlockTripWireHook.java +++ b/common/src/common/block/BlockTripWireHook.java @@ -20,7 +20,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockTripWireHook extends Block { @@ -225,11 +225,11 @@ public class BlockTripWireHook extends Block /** * Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.) */ - public void randomTick(WorldServer worldIn, BlockPos pos, State state, Random random) + public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random) { } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { this.triggerHookAt(worldIn, pos, state, false, true, -1, (State)null); } @@ -298,7 +298,7 @@ public class BlockTripWireHook extends Block } } - public void onBlockRemoved(WorldServer worldIn, BlockPos pos, State state) + public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) { boolean flag = ((Boolean)state.getValue(ATTACHED)).booleanValue(); boolean flag1 = ((Boolean)state.getValue(POWERED)).booleanValue(); diff --git a/common/src/common/block/BlockVine.java b/common/src/common/block/BlockVine.java index 8e82dcc..ed6f33b 100755 --- a/common/src/common/block/BlockVine.java +++ b/common/src/common/block/BlockVine.java @@ -24,7 +24,7 @@ import common.util.Facing; import common.world.IWorldAccess; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockVine extends Block { @@ -241,7 +241,7 @@ public class BlockVine extends Block } } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.vineDry && worldIn.getTemperatureC(pos) >= 50.0f) { diff --git a/common/src/common/block/BlockWarpChest.java b/common/src/common/block/BlockWarpChest.java index 32b40c9..f3aab50 100755 --- a/common/src/common/block/BlockWarpChest.java +++ b/common/src/common/block/BlockWarpChest.java @@ -18,9 +18,9 @@ import common.properties.PropertyDirection; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; +import common.world.AWorldClient; import common.world.State; import common.world.World; -import common.world.WorldClient; public class BlockWarpChest extends Block { @@ -117,7 +117,7 @@ public class BlockWarpChest extends Block // return new TileEntityWarpChest(); // } - public void randomDisplayTick(WorldClient worldIn, BlockPos pos, State state, Random rand) + public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) { for (int i = 0; i < 3; ++i) { diff --git a/common/src/common/block/BlockWart.java b/common/src/common/block/BlockWart.java index 3c576a8..3937dbe 100755 --- a/common/src/common/block/BlockWart.java +++ b/common/src/common/block/BlockWart.java @@ -15,7 +15,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class BlockWart extends BlockBush { @@ -44,7 +44,7 @@ public class BlockWart extends BlockBush return this.canPlaceBlockOn(worldIn.getState(pos.down()).getBlock()); } - public void updateTick(WorldServer worldIn, BlockPos pos, State state, Random rand) + public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { if(Config.wartGrowth > 0) { int i = ((Integer)state.getValue(AGE)).intValue(); diff --git a/common/src/common/block/IGrowable.java b/common/src/common/block/IGrowable.java index a3c9ca0..9bb72c7 100755 --- a/common/src/common/block/IGrowable.java +++ b/common/src/common/block/IGrowable.java @@ -4,7 +4,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public interface IGrowable { @@ -12,5 +12,5 @@ public interface IGrowable boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, State state); - void grow(WorldServer worldIn, Random rand, BlockPos pos, State state); + void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state); } diff --git a/common/src/common/entity/Entity.java b/common/src/common/entity/Entity.java index b142d3d..59c59a1 100755 --- a/common/src/common/entity/Entity.java +++ b/common/src/common/entity/Entity.java @@ -43,7 +43,7 @@ import common.util.Vec3; import common.world.Explosion; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class Entity { @@ -2370,8 +2370,8 @@ public abstract class Entity // this.worldObj.profiler.start("changeDimension"); // Server server = Server.getServer(); // int oldDim = this.dimension; - WorldServer worldserver = (WorldServer)this.worldObj; // server.getWorld(oldDim); - WorldServer worldserver1 = worldserver.getServer().getWorld(dimensionId); + AWorldServer worldserver = (AWorldServer)this.worldObj; // server.getWorld(oldDim); + AWorldServer worldserver1 = worldserver.getOtherWorld(dimensionId); // this.dimension = dimensionId; // if (i == 1 && dimensionId == 1) @@ -2383,7 +2383,7 @@ public abstract class Entity this.worldObj.removeEntity(this); this.dead = false; // this.worldObj.profiler.start("reposition"); - worldserver.getServer().placeInDimension(this, worldserver, worldserver1, pos, portal); + worldserver.placeInDimension(this, worldserver, worldserver1, pos, portal); if(this.isEntityAlive()) worldserver1.updateEntity(this, false); // this.worldObj.profiler.next("reloading"); diff --git a/common/src/common/entity/animal/EntityDragon.java b/common/src/common/entity/animal/EntityDragon.java index 4b97778..b02ea8e 100755 --- a/common/src/common/entity/animal/EntityDragon.java +++ b/common/src/common/entity/animal/EntityDragon.java @@ -15,8 +15,8 @@ import common.init.SoundEvent; import common.model.ParticleType; import common.util.ExtMath; import common.util.Vec3; +import common.world.AWorldClient; import common.world.World; -import common.world.WorldClient; public class EntityDragon extends EntityLiving implements IEntityMultiPart { @@ -105,7 +105,7 @@ public class EntityDragon extends EntityLiving implements IEntityMultiPart if (f1 <= -0.3F && f >= -0.3F) // && !this.isSilent()) { - ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, SoundEvent.DRAGON_WINGS, 5.0F); + ((AWorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, SoundEvent.DRAGON_WINGS, 5.0F); } } diff --git a/common/src/common/entity/effect/EntityLightning.java b/common/src/common/entity/effect/EntityLightning.java index e966314..4de8d0f 100755 --- a/common/src/common/entity/effect/EntityLightning.java +++ b/common/src/common/entity/effect/EntityLightning.java @@ -11,8 +11,8 @@ import common.init.SoundEvent; import common.material.Material; import common.util.BlockPos; import common.util.BoundingBox; +import common.world.AWorldClient; import common.world.World; -import common.world.WorldClient; public class EntityLightning extends EntityWeatherEffect { @@ -77,7 +77,7 @@ public class EntityLightning extends EntityWeatherEffect { if (this.worldObj.client) { - ((WorldClient)this.worldObj).setLastLightning(2, this.color); + ((AWorldClient)this.worldObj).setLastLightning(2, this.color); } else // if(this.damage > 0) { diff --git a/common/src/common/entity/item/EntityFireworks.java b/common/src/common/entity/item/EntityFireworks.java index 1e1e2eb..56951a5 100755 --- a/common/src/common/entity/item/EntityFireworks.java +++ b/common/src/common/entity/item/EntityFireworks.java @@ -7,8 +7,8 @@ import common.item.ItemStack; import common.model.ParticleType; import common.nbt.NBTTagCompound; import common.util.ExtMath; +import common.world.AWorldClient; import common.world.World; -import common.world.WorldClient; public class EntityFireworks extends Entity { @@ -158,7 +158,7 @@ public class EntityFireworks extends Entity nbttagcompound = itemstack.getTagCompound().getCompoundTag("Fireworks"); } - ((WorldClient)this.worldObj).makeFireworks(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, nbttagcompound); + ((AWorldClient)this.worldObj).makeFireworks(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, nbttagcompound); } super.handleStatusUpdate(id); diff --git a/common/src/common/entity/item/EntityItem.java b/common/src/common/entity/item/EntityItem.java index 1647b97..6b7abf7 100755 --- a/common/src/common/entity/item/EntityItem.java +++ b/common/src/common/entity/item/EntityItem.java @@ -19,7 +19,7 @@ import common.util.BlockPos; import common.util.ExtMath; import common.util.PortalType; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityItem extends Entity { @@ -65,7 +65,7 @@ public class EntityItem extends Entity { if(!this.worldObj.client && Config.itemFallDamage && distance >= 1.0f && this.getEntityItem().getItem().isFragile()) { // for(int z = 0; z < 8; z++) { - ((WorldServer)this.worldObj).spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, + ((AWorldServer)this.worldObj).spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, 8, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, 0.1f, ItemRegistry.getIdFromItem(this.getEntityItem().getItem()), this.getEntityItem().getMetadata()); // } diff --git a/common/src/common/entity/npc/EntityArachnoid.java b/common/src/common/entity/npc/EntityArachnoid.java index becd804..990e649 100755 --- a/common/src/common/entity/npc/EntityArachnoid.java +++ b/common/src/common/entity/npc/EntityArachnoid.java @@ -69,7 +69,7 @@ public class EntityArachnoid extends EntityNPC public boolean isOnLadder() { - return super.isOnLadder() || (this.sendQueue != null ? this.collidedHorizontally && !this.noclip : this.isBesideClimbableBlock()); + return super.isOnLadder() || (this.client != null ? this.collidedHorizontally && !this.noclip : this.isBesideClimbableBlock()); } public void setInWeb() diff --git a/common/src/common/entity/npc/EntityDarkMage.java b/common/src/common/entity/npc/EntityDarkMage.java index 5d5712b..5f0476f 100755 --- a/common/src/common/entity/npc/EntityDarkMage.java +++ b/common/src/common/entity/npc/EntityDarkMage.java @@ -4,8 +4,8 @@ import common.ai.AISmallFireballAttack; import common.init.SoundEvent; import common.model.ParticleType; import common.rng.Random; +import common.world.AWorldClient; import common.world.World; -import common.world.WorldClient; public class EntityDarkMage extends EntityHoveringNPC { public EntityDarkMage(World worldIn) { @@ -85,7 +85,7 @@ public class EntityDarkMage extends EntityHoveringNPC { { if(this.worldObj.client && this.isAttacking()) { if(this.rand.chance(24)) { // && !this.isSilent()) { - ((WorldClient)this.worldObj).playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, SoundEvent.FIRE, + ((AWorldClient)this.worldObj).playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, SoundEvent.FIRE, 1.0F + this.rand.floatv()); } for(int i = 0; i < 2; ++i) { diff --git a/common/src/common/entity/npc/EntityHaunter.java b/common/src/common/entity/npc/EntityHaunter.java index e076393..4f5165d 100755 --- a/common/src/common/entity/npc/EntityHaunter.java +++ b/common/src/common/entity/npc/EntityHaunter.java @@ -12,7 +12,7 @@ import common.item.ItemStack; import common.nbt.NBTTagCompound; import common.rng.Random; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityHaunter extends EntityNPC { // private int lastActiveTime; @@ -346,7 +346,7 @@ public class EntityHaunter extends EntityNPC { } public boolean getCanSpawnHere() { - return !((WorldServer)this.worldObj).isDaytime(); + return !((AWorldServer)this.worldObj).isDaytime(); } // public boolean canAmbush(EntityLiving entity) { diff --git a/common/src/common/entity/npc/EntityHoveringNPC.java b/common/src/common/entity/npc/EntityHoveringNPC.java index 0d8390f..3c823c8 100755 --- a/common/src/common/entity/npc/EntityHoveringNPC.java +++ b/common/src/common/entity/npc/EntityHoveringNPC.java @@ -98,11 +98,11 @@ public abstract class EntityHoveringNPC extends EntityNPC { if (flag) { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.START_HOVER)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.START_HOVER)); } else { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_HOVER)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_HOVER)); } this.serverHoverState = flag; @@ -113,10 +113,10 @@ public abstract class EntityHoveringNPC extends EntityNPC public void onLivingUpdate() { - if(this.sendQueue != null) { - if(this.gm.isJumping() && this.gm.isSprinting() && this.gm.getMoveForward() == 0.0f && this.gm.getMoveStrafe() == 0.0f) + if(this.client != null) { + if(this.client.isJumping() && this.client.isSprinting() && this.client.getMoveForward() == 0.0f && this.client.getMoveStrafe() == 0.0f) this.setHovering(true); - if(this.isFlying() || (!this.gm.isJumping() && this.gm.isSneaking() && this.onGround)) + if(this.isFlying() || (!this.client.isJumping() && this.client.isSneaking() && this.onGround)) this.setHovering(false); } if (!this.onGround && this.motionY < 0.0D && (!this.isPlayer() || (!this.isFlying() && this.isHovering() && !this.jumping))) diff --git a/common/src/common/entity/npc/EntityHuman.java b/common/src/common/entity/npc/EntityHuman.java index cedc14b..77a4d3d 100755 --- a/common/src/common/entity/npc/EntityHuman.java +++ b/common/src/common/entity/npc/EntityHuman.java @@ -8,7 +8,7 @@ import common.util.BlockPos; import common.util.Identifyable; import common.village.Village; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityHuman extends EntityNPC { public static enum ClassType implements Identifyable { @@ -111,10 +111,10 @@ public class EntityHuman extends EntityNPC { protected void updateAITasks() { if(--this.checkTimer <= 0) { BlockPos blockpos = new BlockPos(this); -// if(((WorldServer)this.worldObj).isPrimary()) - ((WorldServer)this.worldObj).addToVillagerPositionList(blockpos); +// if(((IWorldServer)this.worldObj).isPrimary()) + ((AWorldServer)this.worldObj).addToVillagerPositionList(blockpos); this.checkTimer = this.rand.excl(70, 120); - this.village = ((WorldServer)this.worldObj).getNearestVillage(blockpos, 32); + this.village = ((AWorldServer)this.worldObj).getNearestVillage(blockpos, 32); if(this.village == null) { this.detachHome(); diff --git a/common/src/common/entity/npc/EntityNPC.java b/common/src/common/entity/npc/EntityNPC.java index cf4e573..9bd5118 100755 --- a/common/src/common/entity/npc/EntityNPC.java +++ b/common/src/common/entity/npc/EntityNPC.java @@ -4,7 +4,6 @@ import java.lang.reflect.InvocationTargetException; import java.util.List; import java.util.function.Predicate; -import common.IClient; import common.ai.AIRangedAttack; import common.ai.EntityAIAttackOnCollide; import common.ai.EntityAIAvoidEntity; @@ -94,9 +93,9 @@ import common.util.PortalType; import common.util.Vec3; import common.util.WorldPos; import common.village.MerchantRecipeList; +import common.world.AWorldClient; import common.world.World; -import common.world.WorldClient; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class EntityNPC extends EntityLiving { @@ -186,8 +185,8 @@ public abstract class EntityNPC extends EntityLiving private byte[] skin; public IPlayer connection; - public IClientPlayer sendQueue; - protected IClient gm; + public IClientPlayer client; + protected boolean slave; public InventoryPlayer inventory; protected InventoryWarpChest warpChest; @@ -392,22 +391,22 @@ public abstract class EntityNPC extends EntityLiving this.stepHeight = 0.0F; } - public final void setClientPlayer(IClient gm, IClientPlayer connection) { + public final void setClientPlayer(IClientPlayer connection) { this.initPlayer(); - this.gm = gm; - this.sendQueue = connection; + this.slave = true; + this.client = connection; } - public final void setOtherPlayer(IClient gm) { + public final void setOtherPlayer() { this.initPlayer(); - this.gm = gm; + this.slave = true; this.stepHeight = 0.0F; this.noClip = true; this.renderDistWeight = 10.0D; } public final boolean isPlayer() { - return this.connection != null || this.gm != null; + return this.connection != null || this.slave; } @@ -1275,14 +1274,14 @@ public abstract class EntityNPC extends EntityLiving } else { this.worldObj.playAuxSFX(1013, new BlockPos(ox, oy, oz), 0); - ((WorldServer)this.worldObj).spawnParticle(ParticleType.PORTAL, + ((AWorldServer)this.worldObj).spawnParticle(ParticleType.PORTAL, ox + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, oy + this.rand.doublev() * (double)this.height, oz + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, 8, (this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, 0.15D); this.worldObj.playAuxSFX(1005, this.getPosition(), 0); - ((WorldServer)this.worldObj).spawnParticle(ParticleType.PORTAL, + ((AWorldServer)this.worldObj).spawnParticle(ParticleType.PORTAL, this.posX + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, this.posY + this.rand.doublev() * (double)this.height, this.posZ + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, 8, @@ -1678,7 +1677,7 @@ public abstract class EntityNPC extends EntityLiving if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) { - ((WorldServer)this.worldObj).sendToAllTrackingEntity(this, new SPacketEntityEquipment(this.getId(), j, itemstack1)); + ((AWorldServer)this.worldObj).sendToAllTrackingEntity(this, new SPacketEntityEquipment(this.getId(), j, itemstack1)); if (itemstack != null) { @@ -1736,8 +1735,8 @@ public abstract class EntityNPC extends EntityLiving public boolean attackEntityFrom(DamageSource source, int amount) { - if(this.gm != null) - return this.sendQueue == null; + if(this.slave) + return this.client == null; // if(this.isEntityInvulnerable(source)) // return false; if(this.connection != null) { @@ -1760,13 +1759,13 @@ public abstract class EntityNPC extends EntityLiving */ public void heal(int healAmount) { - if(this.sendQueue == null) + if(this.client == null) super.heal(healAmount); } public void healMana(int amount) { - if(this.sendQueue == null) + if(this.client == null) super.healMana(amount); } @@ -1781,9 +1780,9 @@ public abstract class EntityNPC extends EntityLiving this.connection.mountEntity(entityIn); // super.mountEntity(entityIn); - if (this.sendQueue != null && entityIn instanceof EntityCart) + if (this.client != null && entityIn instanceof EntityCart) { - this.gm.playSound(new MovingSoundMinecartRiding(this, (EntityCart)entityIn)); + this.client.playSound(new MovingSoundMinecartRiding(this, (EntityCart)entityIn)); } } @@ -1792,7 +1791,7 @@ public abstract class EntityNPC extends EntityLiving */ public void onUpdate() { - if(this.sendQueue != null) { + if(this.client != null) { if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { // super.onUpdate(); @@ -1800,8 +1799,8 @@ public abstract class EntityNPC extends EntityLiving if (this.isRiding()) { - this.sendQueue.addToSendQueue(new CPacketPlayer.C05PacketPlayerLook(this.rotYaw, this.rotPitch, this.onGround)); - this.sendQueue.addToSendQueue(new CPacketInput(this.moveStrafe, this.moveForward, this.gm.isJumping(), this.gm.isSneaking())); + this.client.addToSendQueue(new CPacketPlayer.C05PacketPlayerLook(this.rotYaw, this.rotPitch, this.onGround)); + this.client.addToSendQueue(new CPacketInput(this.moveStrafe, this.moveForward, this.client.isJumping(), this.client.isSneaking())); } else { @@ -1816,7 +1815,7 @@ public abstract class EntityNPC extends EntityLiving return; } - if(this.gm != null) { + if(this.slave) { // this.renderOffsetY = 0.0F; // super.onUpdate(); this.updatePlayer(); @@ -1966,9 +1965,9 @@ public abstract class EntityNPC extends EntityLiving */ public EntityItem dropOneItem(boolean dropAll) { - if(this.sendQueue != null) { + if(this.client != null) { CPacketBreak.Action c07packetplayerdigging$action = dropAll ? CPacketBreak.Action.DROP_ALL_ITEMS : CPacketBreak.Action.DROP_ITEM; - this.sendQueue.addToSendQueue(new CPacketBreak(c07packetplayerdigging$action, BlockPos.ORIGIN, Facing.DOWN)); + this.client.addToSendQueue(new CPacketBreak(c07packetplayerdigging$action, BlockPos.ORIGIN, Facing.DOWN)); return null; } return this.dropItem(this.inventory.decrStackSize(this.inventory.currentItem, dropAll && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, true); @@ -1979,13 +1978,13 @@ public abstract class EntityNPC extends EntityLiving */ protected void joinEntityItemWithWorld(EntityItem itemIn) { - if(this.sendQueue == null) + if(this.client == null) this.worldObj.spawnEntityInWorld(itemIn); } protected void changeSize(float width, float height) { super.changeSize(width, height); - if(this.sendQueue != null) + if(this.client != null) this.stepHeight = height / 3.0f; } @@ -1995,8 +1994,8 @@ public abstract class EntityNPC extends EntityLiving public void swingItem() { super.swingItem(); - if(this.sendQueue != null) - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SWING_ARM)); + if(this.client != null) + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SWING_ARM)); } /** @@ -2005,7 +2004,7 @@ public abstract class EntityNPC extends EntityLiving */ protected void damageEntity(DamageSource damageSrc, int damageAmount) { - if(this.sendQueue != null) { + if(this.client != null) { // if(!this.isEntityInvulnerable(damageSrc)) this.setHealth(this.getHealth() - damageAmount); return; @@ -2050,19 +2049,19 @@ public abstract class EntityNPC extends EntityLiving { if(this.connection != null) this.connection.closeScreen(); - else if(this.sendQueue != null) { + else if(this.client != null) { // this.setScreenClosed(); // this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_CONTAINER)); // , this.openContainer.windowId)); // this.closeScreenAndDropStack(); - this.sendQueue.closeGui(); + this.client.closeGui(); } else this.openContainer = this.inventoryContainer; } public void setScreenClosed() { - if(this.sendQueue != null) { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_CONTAINER, this.openContainer.windowId)); + if(this.client != null) { + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_CONTAINER, this.openContainer.windowId)); this.inventory.setItemStack((ItemStack)null); this.openContainer = this.inventoryContainer; } @@ -2070,7 +2069,7 @@ public abstract class EntityNPC extends EntityLiving protected boolean pushOutOfBlocks(double x, double y, double z) { - if(this.sendQueue == null) + if(this.client == null) return super.pushOutOfBlocks(x, y, z); if (this.noClip) { @@ -2144,7 +2143,7 @@ public abstract class EntityNPC extends EntityLiving public void setSprinting(boolean sprinting) { super.setSprinting(sprinting); - if(this.sendQueue != null) + if(this.client != null) this.sprintingTicksLeft = sprinting ? 600 : 0; } @@ -2152,23 +2151,23 @@ public abstract class EntityNPC extends EntityLiving { if(this.connection != null) this.connection.playSound(name, volume); - else if(this.sendQueue != null) - ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, name, volume); - else if(this.gm == null) + else if(this.client != null) + ((AWorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, name, volume); + else if(!this.slave) super.playSound(name, volume); } public boolean isTicked() { - return (!this.worldObj.client && (Config.mobTick || this.connection != null)) || this.sendQueue != null; + return (!this.worldObj.client && (Config.mobTick || this.connection != null)) || this.client != null; } public void openEditSign(TileEntitySign signTile) { if(this.connection != null) this.connection.openEditSign(signTile); - else if(this.sendQueue != null) - this.sendQueue.displayGuiSign(signTile.getPos(), signTile.signText); + else if(this.client != null) + this.client.displayGuiSign(signTile.getPos(), signTile.signText); } /** @@ -2195,8 +2194,8 @@ public abstract class EntityNPC extends EntityLiving { if(this.connection != null) this.connection.displayGUIChest(chestInventory); - else if(this.sendQueue != null) { - this.sendQueue.displayGUIChest(chestInventory, this.inventory); + else if(this.client != null) { + this.client.displayGUIChest(chestInventory, this.inventory); } } @@ -2204,16 +2203,16 @@ public abstract class EntityNPC extends EntityLiving { if(this.connection != null) this.connection.displayGUIHorse(horse, horseInventory); - else if(this.sendQueue != null) - this.sendQueue.displayGuiHorse(horse, this.inventory, horseInventory); + else if(this.client != null) + this.client.displayGuiHorse(horse, this.inventory, horseInventory); } public void displayGui(IInteractionObject guiOwner) { if(this.connection != null) this.connection.displayGui(guiOwner); - else if(this.sendQueue != null) { - this.sendQueue.displayGui(guiOwner, this.inventory, this.worldObj); + else if(this.client != null) { + this.client.displayGui(guiOwner, this.inventory, this.worldObj); } } @@ -2224,16 +2223,16 @@ public abstract class EntityNPC extends EntityLiving { if(this.connection != null) this.connection.onCriticalHit(entityHit); - else if(this.sendQueue != null) - this.gm.emitParticleAtEntity(entityHit, ParticleType.CRIT); + else if(this.client != null) + this.client.emitParticleAtEntity(entityHit, ParticleType.CRIT); } public void onEnchantmentCritical(Entity entityHit) { if(this.connection != null) this.connection.onEnchantmentCritical(entityHit); - else if(this.sendQueue != null) - this.gm.emitParticleAtEntity(entityHit, ParticleType.CRIT_MAGIC); + else if(this.client != null) + this.client.emitParticleAtEntity(entityHit, ParticleType.CRIT_MAGIC); } /** @@ -2241,7 +2240,7 @@ public abstract class EntityNPC extends EntityLiving */ public boolean isSneaking() { - return this.sendQueue != null ? this.gm.isSneaking() : super.isSneaking(); + return this.client != null ? this.client.isSneaking() : super.isSneaking(); } public void updateEntityActionState() @@ -2254,11 +2253,11 @@ public abstract class EntityNPC extends EntityLiving this.headYaw = this.rotYaw; // super.updateEntityActionState(); - if (this.sendQueue != null && this.isCurrentViewEntity()) + if (this.client != null && this.client.isRenderViewEntity(this)) { - this.moveStrafe = this.gm.getMoveStrafe(); - this.moveForward = this.gm.getMoveForward(); - this.jumping = this.gm.isJumping(); + this.moveStrafe = this.client.getMoveStrafe(); + this.moveForward = this.client.getMoveForward(); + this.jumping = this.client.isJumping(); this.prevRenderArmYaw = this.renderArmYaw; this.prevRenderArmPitch = this.renderArmPitch; this.renderArmPitch = (float)((double)this.renderArmPitch + (double)(this.rotPitch - this.renderArmPitch) * 0.5D); @@ -2272,7 +2271,7 @@ public abstract class EntityNPC extends EntityLiving */ public void onLivingUpdate() { - if(this.sendQueue != null) { + if(this.client != null) { if (this.sprintingTicksLeft > 0) { --this.sprintingTicksLeft; @@ -2338,16 +2337,16 @@ public abstract class EntityNPC extends EntityLiving // --this.portalTimer; // } - boolean flag = this.gm.isJumping(); - boolean flag1 = this.gm.isSneaking(); + boolean flag = this.client.isJumping(); + boolean flag1 = this.client.isSneaking(); float f = 0.8F; - boolean flag2 = this.gm.getMoveForward() >= f; - this.gm.updatePlayerMoveState(); + boolean flag2 = this.client.getMoveForward() >= f; + this.client.updatePlayerMoveState(); if (this.isUsingItem() && !this.isRiding()) { - this.gm.setMoveStrafe(this.gm.getMoveStrafe() * 0.2F); - this.gm.setMoveForward(this.gm.getMoveForward() * 0.2F); + this.client.setMoveStrafe(this.client.getMoveStrafe() * 0.2F); + this.client.setMoveForward(this.client.getMoveForward() * 0.2F); this.sprintToggleTimer = 0; } @@ -2357,9 +2356,9 @@ public abstract class EntityNPC extends EntityLiving this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double)this.width * 0.35D); boolean canSprint = true; // (float)this.getFoodStats().getFoodLevel() > 6.0F || this.allowFlying; - if (this.onGround && !flag1 && !flag2 && this.gm.getMoveForward() >= f && !this.isSprinting() && canSprint && !this.isUsingItem() && !this.hasEffect(Potion.BLINDNESS)) + if (this.onGround && !flag1 && !flag2 && this.client.getMoveForward() >= f && !this.isSprinting() && canSprint && !this.isUsingItem() && !this.hasEffect(Potion.BLINDNESS)) { - if (this.sprintToggleTimer <= 0 && !this.gm.isSprinting()) + if (this.sprintToggleTimer <= 0 && !this.client.isSprinting()) { this.sprintToggleTimer = 7; } @@ -2369,12 +2368,12 @@ public abstract class EntityNPC extends EntityLiving } } - if (!this.isSprinting() && this.gm.getMoveForward() >= f && canSprint && !this.isUsingItem() && !this.hasEffect(Potion.BLINDNESS) && this.gm.isSprinting()) + if (!this.isSprinting() && this.client.getMoveForward() >= f && canSprint && !this.isUsingItem() && !this.hasEffect(Potion.BLINDNESS) && this.client.isSprinting()) { this.setSprinting(true); } - if (this.isSprinting() && (this.gm.getMoveForward() < f || this.collidedHorizontally || !canSprint)) + if (this.isSprinting() && (this.client.getMoveForward() < f || this.collidedHorizontally || !canSprint)) { this.setSprinting(false); } @@ -2386,10 +2385,10 @@ public abstract class EntityNPC extends EntityLiving if (!this.flying) { this.flying = true; - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.START_FLYING)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.START_FLYING)); } } - else if (!flag && this.gm.isJumping()) + else if (!flag && this.client.isJumping()) { if (this.flyToggleTimer == 0) { @@ -2398,7 +2397,7 @@ public abstract class EntityNPC extends EntityLiving else { this.flying = !this.flying; - this.sendQueue.addToSendQueue(new CPacketAction(this.flying ? + this.client.addToSendQueue(new CPacketAction(this.flying ? CPacketAction.Action.START_FLYING : CPacketAction.Action.STOP_FLYING)); this.flyToggleTimer = 0; } @@ -2409,15 +2408,15 @@ public abstract class EntityNPC extends EntityLiving } // this.firstEffectUpdate = false; - if (this.isFlying() && this.isCurrentViewEntity()) + if (this.isFlying() && this.client.isRenderViewEntity(this)) { - if (this.gm.isSneaking()) + if (this.client.isSneaking()) { this.motionY -= (double)( this.landMovement * 0.5f * (this.canFlyFullSpeed() ? 3.0F : 1.0F)); } - if (this.gm.isJumping()) + if (this.client.isJumping()) { this.motionY += (double)( this.landMovement * 0.5f * (this.canFlyFullSpeed() ? 3.0F : 1.0F)); @@ -2436,12 +2435,12 @@ public abstract class EntityNPC extends EntityLiving } } - if (flag && !this.gm.isJumping()) + if (flag && !this.client.isJumping()) { this.horseJumpPowerCounter = -10; this.sendHorseJump(); } - else if (!flag && this.gm.isJumping()) + else if (!flag && this.client.isJumping()) { this.horseJumpPowerCounter = 0; this.horseJumpPower = 0.0F; @@ -2471,12 +2470,12 @@ public abstract class EntityNPC extends EntityLiving if (this.onGround && this.flying && !this.noclip) { this.flying = false; - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_FLYING)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_FLYING)); } return; } - if(this.gm != null) { + if(this.slave) { if (this.otherPlayerMPPosRotationIncrements > 0) { double d0 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; @@ -2628,11 +2627,11 @@ public abstract class EntityNPC extends EntityLiving { if (flag) { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.START_SPRINTING)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.START_SPRINTING)); } else { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_SPRINTING)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_SPRINTING)); } this.serverSprintState = flag; @@ -2644,17 +2643,17 @@ public abstract class EntityNPC extends EntityLiving { if (flag1) { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.START_SNEAKING)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.START_SNEAKING)); } else { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_SNEAKING)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.STOP_SNEAKING)); } this.serverSneakState = flag1; } - if (this.isCurrentViewEntity()) + if (this.client.isRenderViewEntity(this)) { double d0 = this.posX - this.lastReportedPosX; double d1 = this.getEntityBoundingBox().minY - this.lastReportedPosY; @@ -2668,24 +2667,24 @@ public abstract class EntityNPC extends EntityLiving { if (flag2 && flag3) { - this.sendQueue.addToSendQueue(new CPacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotYaw, this.rotPitch, this.onGround)); + this.client.addToSendQueue(new CPacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotYaw, this.rotPitch, this.onGround)); } else if (flag2) { - this.sendQueue.addToSendQueue(new CPacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.onGround)); + this.client.addToSendQueue(new CPacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.onGround)); } else if (flag3) { - this.sendQueue.addToSendQueue(new CPacketPlayer.C05PacketPlayerLook(this.rotYaw, this.rotPitch, this.onGround)); + this.client.addToSendQueue(new CPacketPlayer.C05PacketPlayerLook(this.rotYaw, this.rotPitch, this.onGround)); } else { - this.sendQueue.addToSendQueue(new CPacketPlayer(this.onGround)); + this.client.addToSendQueue(new CPacketPlayer(this.onGround)); } } else { - this.sendQueue.addToSendQueue(new CPacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, this.rotYaw, this.rotPitch, this.onGround)); + this.client.addToSendQueue(new CPacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, this.rotYaw, this.rotPitch, this.onGround)); flag2 = false; } @@ -2709,7 +2708,7 @@ public abstract class EntityNPC extends EntityLiving public void respawnPlayer() { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.PERFORM_RESPAWN)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.PERFORM_RESPAWN)); } // public void closeScreenAndDropStack() @@ -2756,12 +2755,12 @@ public abstract class EntityNPC extends EntityLiving protected void sendHorseJump() { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.RIDING_JUMP, (int)(this.getHorseJumpPower() * 100.0F))); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.RIDING_JUMP, (int)(this.getHorseJumpPower() * 100.0F))); } public void sendHorseInventory() { - this.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.OPEN_INVENTORY)); + this.client.addToSendQueue(new CPacketAction(CPacketAction.Action.OPEN_INVENTORY)); } /** @@ -2794,13 +2793,10 @@ public abstract class EntityNPC extends EntityLiving public void displayTradeGui(String title) { - this.sendQueue.displayGuiMerchant(title, this.inventory, this.worldObj); + this.client.displayGuiMerchant(title, this.inventory, this.worldObj); } - protected boolean isCurrentViewEntity() - { - return this.gm.getRenderViewEntity() == this; - } + // END SP SPEC @@ -2808,7 +2804,7 @@ public abstract class EntityNPC extends EntityLiving public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) { - if(this.gm != null && this.sendQueue == null) { + if(this.slave && this.client == null) { this.otherPlayerMPX = x; this.otherPlayerMPY = y; this.otherPlayerMPZ = z; @@ -2823,7 +2819,7 @@ public abstract class EntityNPC extends EntityLiving public void setItem(int slot, ItemStack stack) { - if(this.gm != null && this.sendQueue == null) { + if(this.slave && this.client == null) { if (slot == 0) this.inventory.mainInventory[this.inventory.currentItem] = stack; else @@ -2893,7 +2889,7 @@ public abstract class EntityNPC extends EntityLiving this.noPickup = true; super.onDeath(cause); - if(this.gm != null) { + if(this.slave) { this.changeSize(0.2F, 0.2F); this.setPosition(this.posX, this.posY, this.posZ); this.motionY = 0.10000000149011612D; @@ -3010,8 +3006,8 @@ public abstract class EntityNPC extends EntityLiving this.connection.updateEffectMeta(); } - public final WorldServer getServerWorld() { - return (WorldServer)this.worldObj; + public final AWorldServer getServerWorld() { + return (AWorldServer)this.worldObj; } public void onUpdateEntity() { diff --git a/common/src/common/entity/npc/EntitySlime.java b/common/src/common/entity/npc/EntitySlime.java index ee08d9c..5a8dcf1 100755 --- a/common/src/common/entity/npc/EntitySlime.java +++ b/common/src/common/entity/npc/EntitySlime.java @@ -17,7 +17,7 @@ import common.util.BlockPos; import common.util.ExtMath; import common.world.Chunk; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntitySlime extends EntityNPC { @@ -373,7 +373,7 @@ public class EntitySlime extends EntityNPC // } - public static Random getRandomWithSeed(WorldServer world, int xPosition, int zPosition, long seed) + public static Random getRandomWithSeed(AWorldServer world, int xPosition, int zPosition, long seed) { return new Random(world.getSeed() + (long)(xPosition * xPosition * 4987142) + (long)(xPosition * 5947611) + @@ -403,7 +403,7 @@ public class EntitySlime extends EntityNPC return super.getCanSpawnHere(); } - if (this.rand.zrange(10) == 0 && getRandomWithSeed((WorldServer)this.worldObj, chunk.xPos, chunk.zPos, 987234911L).zrange(10) == 0 && this.posY < 40.0D) + if (this.rand.zrange(10) == 0 && getRandomWithSeed((AWorldServer)this.worldObj, chunk.xPos, chunk.zPos, 987234911L).zrange(10) == 0 && this.posY < 40.0D) { return super.getCanSpawnHere(); } diff --git a/common/src/common/entity/npc/EntityUndead.java b/common/src/common/entity/npc/EntityUndead.java index c87135b..af39d58 100755 --- a/common/src/common/entity/npc/EntityUndead.java +++ b/common/src/common/entity/npc/EntityUndead.java @@ -8,7 +8,7 @@ import common.init.Items; import common.item.ItemStack; import common.rng.Random; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityUndead extends EntityNPC { @@ -107,7 +107,7 @@ public class EntityUndead extends EntityNPC } public boolean getCanSpawnHere() { - return !((WorldServer)this.worldObj).isDaytime(); + return !((AWorldServer)this.worldObj).isDaytime(); } // public boolean canAmbush(EntityLiving entity) { diff --git a/common/src/common/entity/npc/EntityZombie.java b/common/src/common/entity/npc/EntityZombie.java index 5d8b152..a38a61f 100755 --- a/common/src/common/entity/npc/EntityZombie.java +++ b/common/src/common/entity/npc/EntityZombie.java @@ -14,7 +14,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class EntityZombie extends EntityNPC { @@ -325,7 +325,7 @@ public class EntityZombie extends EntityNPC } public boolean getCanSpawnHere() { - return !((WorldServer)this.worldObj).isDaytime(); + return !((AWorldServer)this.worldObj).isDaytime(); } // public boolean canAmbush(EntityLiving entity) { diff --git a/common/src/common/entity/projectile/EntityHook.java b/common/src/common/entity/projectile/EntityHook.java index 318976c..8c811aa 100755 --- a/common/src/common/entity/projectile/EntityHook.java +++ b/common/src/common/entity/projectile/EntityHook.java @@ -25,7 +25,7 @@ import common.util.ExtMath; import common.util.HitPosition; import common.util.Vec3; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.LootConstants; public class EntityHook extends Entity implements IObjectData @@ -385,7 +385,7 @@ public class EntityHook extends Entity implements IObjectData if (!this.worldObj.client && d10 > 0.0D) { - WorldServer worldserver = (WorldServer)this.worldObj; + AWorldServer worldserver = (AWorldServer)this.worldObj; int l = 1; BlockPos blockpos = (new BlockPos(this)).up(); diff --git a/common/src/common/entity/types/EntityLiving.java b/common/src/common/entity/types/EntityLiving.java index 58347ac..117a3fd 100755 --- a/common/src/common/entity/types/EntityLiving.java +++ b/common/src/common/entity/types/EntityLiving.java @@ -66,7 +66,7 @@ import common.util.ExtMath; import common.util.Vec3; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class EntityLiving extends Entity { @@ -234,7 +234,7 @@ public abstract class EntityLiving extends Entity } int i = (int)(150.0D * d0); - ((WorldServer)this.worldObj).spawnParticle(ParticleType.BLOCK_DUST, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, BlockRegistry.getStateId(iblockstate)); + ((AWorldServer)this.worldObj).spawnParticle(ParticleType.BLOCK_DUST, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, BlockRegistry.getStateId(iblockstate)); } } @@ -1433,9 +1433,9 @@ public abstract class EntityLiving extends Entity this.swingTimer = -1; this.swingingItem = true; - if (this.worldObj instanceof WorldServer) + if (this.worldObj instanceof AWorldServer) { - ((WorldServer)this.worldObj).sendToAllTrackingEntity(this, new SPacketAnimation(this, 0)); + ((AWorldServer)this.worldObj).sendToAllTrackingEntity(this, new SPacketAnimation(this, 0)); } } } @@ -1898,7 +1898,7 @@ public abstract class EntityLiving extends Entity // // if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) // { -// ((WorldServer)this.worldObj).sendToAllTrackingEntity(this, new SPacketEntityEquipment(this.getId(), j, itemstack1)); +// ((IWorldServer)this.worldObj).sendToAllTrackingEntity(this, new SPacketEntityEquipment(this.getId(), j, itemstack1)); // // if (itemstack != null) // { @@ -2219,7 +2219,7 @@ public abstract class EntityLiving extends Entity { if (!entity.dead && !this.worldObj.client) { - WorldServer world = ((WorldServer)this.worldObj); + AWorldServer world = ((AWorldServer)this.worldObj); if (entity instanceof EntityItem) { @@ -2551,7 +2551,7 @@ public abstract class EntityLiving extends Entity if(receiver != null) receiver.addFeed(kill); if(forAll) - for(IPlayer player : ((WorldServer)this.worldObj).getServer().getIPlayers()) { + for(IPlayer player : ((AWorldServer)this.worldObj).getAllPlayers()) { if(player != receiver) player.addFeed(msg); } @@ -3093,8 +3093,8 @@ public abstract class EntityLiving extends Entity this.dropItem(Items.lead, 1); } - if(!this.worldObj.client && pkt && this.worldObj instanceof WorldServer) { - ((WorldServer)this.worldObj).sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, (Entity)null)); + if(!this.worldObj.client && pkt && this.worldObj instanceof AWorldServer) { + ((AWorldServer)this.worldObj).sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, (Entity)null)); } } } @@ -3115,8 +3115,8 @@ public abstract class EntityLiving extends Entity this.leashed = true; this.leashedTo = entity; - if(!this.worldObj.client && pkt && this.worldObj instanceof WorldServer) { - ((WorldServer)this.worldObj).sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, this.leashedTo)); + if(!this.worldObj.client && pkt && this.worldObj instanceof AWorldServer) { + ((AWorldServer)this.worldObj).sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, this.leashedTo)); } } diff --git a/common/src/common/entity/types/EntityThrowable.java b/common/src/common/entity/types/EntityThrowable.java index 2833d82..e325a29 100755 --- a/common/src/common/entity/types/EntityThrowable.java +++ b/common/src/common/entity/types/EntityThrowable.java @@ -358,11 +358,11 @@ public abstract class EntityThrowable extends Entity implements IProjectile // { // this.thrower = this.worldObj.getPlayer(this.throwerName); -// if (this.thrower == null && this.worldObj instanceof WorldServer) +// if (this.thrower == null && this.worldObj instanceof IWorldServer) // { // try // { -// Entity entity = ((WorldServer)this.worldObj).getEntityFromUuid(UUID.fromString(this.throwerName)); +// Entity entity = ((IWorldServer)this.worldObj).getEntityFromUuid(UUID.fromString(this.throwerName)); // // if (entity instanceof EntityLivingBase) // { diff --git a/common/src/common/entity/types/IEntityFX.java b/common/src/common/entity/types/IEntityFX.java deleted file mode 100644 index 2676179..0000000 --- a/common/src/common/entity/types/IEntityFX.java +++ /dev/null @@ -1,9 +0,0 @@ -package common.entity.types; - -public interface IEntityFX { - - IEntityFX multiplyVelocity(float multiplier); - - void setRBGColorF(float particleRedIn, float particleGreenIn, float particleBlueIn); - -} \ No newline at end of file diff --git a/common/src/common/init/Config.java b/common/src/common/init/Config.java index ca82a82..3393db2 100755 --- a/common/src/common/init/Config.java +++ b/common/src/common/init/Config.java @@ -6,30 +6,21 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; import java.util.Map; import java.util.TreeMap; -import common.IServer; -import common.packet.SPacketWorld; import common.util.ExtMath; -import common.world.WorldServer; public abstract class Config { public static enum ValueType { STRING, BOOLEAN, INTEGER, FLOAT; } - private static interface Callback { - void run(IServer server); - } - @Target(FIELD) @Retention(value = RetentionPolicy.RUNTIME) private static @interface Var { String name(); - Class callback() default Callback.class; float min() default (float)Integer.MIN_VALUE; float max() default (float)Integer.MAX_VALUE; } @@ -40,7 +31,8 @@ public abstract class Config { private final Field field; private final float min; private final float max; - private final Callback callback; + + private Runnable callback; private Value(Field field, Var value) { this.type = field.getType() == int.class ? ValueType.INTEGER : (field.getType() == boolean.class ? ValueType.BOOLEAN : @@ -55,18 +47,18 @@ public abstract class Config { this.max = (this.type == ValueType.INTEGER || this.type == ValueType.FLOAT) ? value.max() : (this.type == ValueType.BOOLEAN ? 1 : 0); // Update update = this.field.getAnnotation(Update.class); - if(value.callback() == Callback.class) { - this.callback = null; - } - else { - try { - this.callback = value.callback().getConstructor().newInstance(); - } - catch(InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException - | NoSuchMethodException e) { - throw new RuntimeException(e); - } - } +// if(value.callback() == Callback.class) { +// this.callback = null; +// } +// else { +// try { +// this.callback = value.callback().getConstructor().newInstance(); +// } +// catch(InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException +// | NoSuchMethodException e) { +// throw new RuntimeException(e); +// } +// } this.setValue(this.def); } @@ -181,7 +173,7 @@ public abstract class Config { public static boolean objectDrop = true; @Var(name = "naturalRegeneration") public static boolean regeneration = true; - @Var(name = "daylightCycle", callback = WorldCallback.class) + @Var(name = "daylightCycle") public static boolean dayCycle = true; @Var(name = "weatherChanges") public static boolean weather = true; @@ -410,7 +402,7 @@ public abstract class Config { public static int pistonLimit = 16; @Var(name = "gravelFlintChance") public static int flintChance = 10; - @Var(name = "timeFlow", callback = WorldCallback.class) + @Var(name = "timeFlow") public static int timeFlow = 1; @Var(name = "emptyTicks") public static int unloadTicks = 1200; @@ -446,7 +438,7 @@ public abstract class Config { public static int orbDamageOther = 0; @Var(name = "weatherChance") public static int weatherChance = 48000; - @Var(name = "viewDistance", min = 2, max = 128, callback = DistanceCallback.class) + @Var(name = "viewDistance", min = 2, max = 128) public static int distance = 10; @Var(name = "healChance") public static int healChance = 5; @@ -472,7 +464,7 @@ public abstract class Config { // @Var(name = "spawnDim") // public static int spawnDim = 0; - @Var(name = "gravity", callback = WorldCallback.class) + @Var(name = "gravity") public static float gravity = 1.0f; @Var(name = "knockback") public static float knockback = 1.0f; @@ -505,29 +497,19 @@ public abstract class Config { value.setValue(value.def); } } + + public static void setCallback(Runnable callback, String ... vars) { + for(String key : vars) { + VARS.get(key).callback = callback; + } + } - public static void set(String key, String value, IServer server) { + public static void set(String key, String value, boolean update) { Config.Value vl = VARS.get(key); if(vl != null) { vl.setValue(value); - if(server != null && vl.callback != null) - vl.callback.run(server); - } - } - - public static class WorldCallback implements Callback { - public void run(IServer server) { - for(WorldServer world : server.getWorlds()) { - world.updatePhysics(); - } - server.sendPacket(new SPacketWorld(WorldServer.clampGravity(), Config.dayCycle, Config.timeFlow)); - } - } - public static class DistanceCallback implements Callback { - public void run(IServer server) { - for(WorldServer world : server.getWorlds()) { - world.updateViewRadius(); - } + if(update && vl.callback != null) + vl.callback.run(); } } } diff --git a/common/src/common/item/ItemBanHammer.java b/common/src/common/item/ItemBanHammer.java index e9c61ff..17d20c1 100755 --- a/common/src/common/item/ItemBanHammer.java +++ b/common/src/common/item/ItemBanHammer.java @@ -8,14 +8,14 @@ import common.entity.npc.EntityNPC; import common.entity.types.EntityLiving; import common.util.BoundingBox; import common.util.Vec3; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemBanHammer extends ItemWand { public ItemBanHammer() { this.setColor(TextColor.DRED); } - public void onUse(ItemStack stack, EntityNPC player, WorldServer world, Vec3 vec) { + public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec) { List list = world.getEntitiesWithinAABB(EntityLiving.class, new BoundingBox( vec.xCoord - 3.5, vec.yCoord - 3.5, vec.zCoord - 3.5, vec.xCoord + 3.5, vec.yCoord + 3.5, vec.zCoord + 3.5)); for(EntityLiving entity : list) { diff --git a/common/src/common/item/ItemBucket.java b/common/src/common/item/ItemBucket.java index b718e5b..2cd1821 100755 --- a/common/src/common/item/ItemBucket.java +++ b/common/src/common/item/ItemBucket.java @@ -28,14 +28,14 @@ import common.util.HitPosition; import common.util.Vec3i; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemBucket extends Item { private final boolean recursive; private final BlockDynamicLiquid liquid; - private static boolean test(WorldServer world, BlockPos pos, Set blocks, int max, BlockPos origin, int radius) { + private static boolean test(AWorldServer world, BlockPos pos, Set blocks, int max, BlockPos origin, int radius) { if(pos.getY() < 0 || pos.getY() > max) return false; if(pos.getX() < origin.getX() - radius || pos.getX() > origin.getX() + radius) @@ -48,7 +48,7 @@ public class ItemBucket extends Item return blocks == null ? block instanceof BlockLiquid : blocks.contains(block); } - private static void setRecursive(WorldServer world, BlockPos origin, int radius, BlockStaticLiquid liquid) { + private static void setRecursive(AWorldServer world, BlockPos origin, int radius, BlockStaticLiquid liquid) { Queue queue = new ArrayDeque(); Set visited = new HashSet(); List dirs = new ArrayList(); @@ -162,7 +162,7 @@ public class ItemBucket extends Item if(this.recursive) { if (material.isLiquid()) { if(!worldIn.client) - setRecursive((WorldServer)worldIn, blockpos, 4, null); + setRecursive((AWorldServer)worldIn, blockpos, 4, null); // playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]); // if(!playerIn.creative) --itemStackIn.stackSize; @@ -272,7 +272,7 @@ public class ItemBucket extends Item if(this.recursive) { if(!worldIn.client) - setRecursive((WorldServer)worldIn, pos, 4, FluidRegistry.getStaticBlock(this.liquid)); + setRecursive((AWorldServer)worldIn, pos, 4, FluidRegistry.getStaticBlock(this.liquid)); } else { worldIn.setState(pos, this.liquid.getState(), 3); diff --git a/common/src/common/item/ItemDye.java b/common/src/common/item/ItemDye.java index 0849a20..c42120e 100755 --- a/common/src/common/item/ItemDye.java +++ b/common/src/common/item/ItemDye.java @@ -21,7 +21,7 @@ import common.util.BlockPos; import common.util.Facing; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemDye extends Item { @@ -159,7 +159,7 @@ public class ItemDye extends Item { if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate)) { - igrowable.grow((WorldServer)worldIn, worldIn.rand, target, iblockstate); + igrowable.grow((AWorldServer)worldIn, worldIn.rand, target, iblockstate); } --stack.stackSize; diff --git a/common/src/common/item/ItemExterminator.java b/common/src/common/item/ItemExterminator.java index 6892a5d..cd5287d 100755 --- a/common/src/common/item/ItemExterminator.java +++ b/common/src/common/item/ItemExterminator.java @@ -5,7 +5,7 @@ import common.dimension.Space; import common.entity.npc.EntityNPC; import common.init.SoundEvent; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemExterminator extends ItemMagnetic { public ItemExterminator() { @@ -22,7 +22,7 @@ public class ItemExterminator extends ItemMagnetic { world.playSoundAtEntity(player, SoundEvent.CLICK, 1.0F); if(world.dimension == Space.INSTANCE) player.connection.addHotbar(TextColor.RED + "Der Weltraum kann nicht zerstört werden (lol)"); - else if(!((WorldServer)world).exterminate()) + else if(!((AWorldServer)world).exterminate()) player.connection.addHotbar(TextColor.YELLOW + "Die Welt %s ist bereits zerstört", world.dimension.getFormattedName(false)); else player.connection.addHotbar(TextColor.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getFormattedName(false)); diff --git a/common/src/common/item/ItemInfoWand.java b/common/src/common/item/ItemInfoWand.java index 8cf4c33..6370462 100755 --- a/common/src/common/item/ItemInfoWand.java +++ b/common/src/common/item/ItemInfoWand.java @@ -5,14 +5,14 @@ import common.color.TextColor; import common.entity.npc.EntityNPC; import common.util.BlockPos; import common.util.Vec3; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemInfoWand extends ItemWand { public ItemInfoWand() { this.setColor(TextColor.BLUE); } - public void onUse(ItemStack stack, EntityNPC player, WorldServer world, Vec3 vec) + public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec) { Biome biome = world.getBiomeGenForCoords(new BlockPos(vec.xCoord, 0, vec.zCoord)); player.connection.addHotbar(TextColor.NEON + "* Position bei Level %d: %.3f %.3f %.3f, %s [%d], %.2f °C", world.dimension.getDimensionId(), diff --git a/common/src/common/item/ItemLightning.java b/common/src/common/item/ItemLightning.java index 68a4779..5e2e23b 100755 --- a/common/src/common/item/ItemLightning.java +++ b/common/src/common/item/ItemLightning.java @@ -3,14 +3,14 @@ package common.item; import common.color.TextColor; import common.entity.npc.EntityNPC; import common.util.Vec3; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemLightning extends ItemWand { public ItemLightning() { this.setColor(TextColor.NEON); } - public void onUse(ItemStack stack, EntityNPC player, WorldServer world, Vec3 vec) + public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec) { if(player.useMana(5)) world.strikeLightning(vec.xCoord - 0.5, vec.yCoord, vec.zCoord - 0.5, 0x532380, 230, true, player); diff --git a/common/src/common/item/ItemWand.java b/common/src/common/item/ItemWand.java index 880f6c8..8b69b69 100755 --- a/common/src/common/item/ItemWand.java +++ b/common/src/common/item/ItemWand.java @@ -10,7 +10,7 @@ import common.util.ExtMath; import common.util.Facing; import common.util.Vec3; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class ItemWand extends Item { public ItemWand() { @@ -38,7 +38,7 @@ public abstract class ItemWand extends Item { // { // if(playerIn.worldObj.client) // return true; -// this.onUse(stack, (EntityNPCMP)playerIn, (WorldServer)playerIn.worldObj, new Vec3(target.posX, target.posY + target.height / 2.0, target.posZ)); +// this.onUse(stack, (EntityNPCMP)playerIn, (IWorldServer)playerIn.worldObj, new Vec3(target.posX, target.posY + target.height / 2.0, target.posZ)); // return true; // } @@ -46,7 +46,7 @@ public abstract class ItemWand extends Item { if(control == ItemControl.SECONDARY && !world.client && block == null) { BlockPos vec = world.getBlockTrace(player, this.getRange(stack, player)); if(vec != null) - this.onUse(stack, player, (WorldServer)world, new Vec3( + this.onUse(stack, player, (AWorldServer)world, new Vec3( ExtMath.floord(vec.getX()) + 0.5, ExtMath.floord(vec.getY()) + 1.0, ExtMath.floord(vec.getZ()) + 0.5)); } return control == ItemControl.SECONDARY; @@ -58,7 +58,7 @@ public abstract class ItemWand extends Item { // EntityNPCMP entity = (EntityNPCMP)player; if(pos != null) { // pos = side.getAxisDirection() == AxisDirection.NEGATIVE ? pos.offset(side) : pos; - this.onUse(stack, player, (WorldServer)world, new Vec3(pos.getX() + hitX, pos.getY() + hitY, pos.getZ() + hitZ)); + this.onUse(stack, player, (AWorldServer)world, new Vec3(pos.getX() + hitX, pos.getY() + hitY, pos.getZ() + hitZ)); } return true; } @@ -71,12 +71,12 @@ public abstract class ItemWand extends Item { // public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { // if(attacker.worldObj.client) // return true; -// this.onUse(stack, (EntityNPCMP)attacker, (WorldServer)attacker.worldObj, new Vec3(target.posX, target.posY + target.height / 2.0, target.posZ)); +// this.onUse(stack, (EntityNPCMP)attacker, (IWorldServer)attacker.worldObj, new Vec3(target.posX, target.posY + target.height / 2.0, target.posZ)); // return true; // } public abstract int getRange(ItemStack stack, EntityNPC player); - public abstract void onUse(ItemStack stack, EntityNPC player, WorldServer world, Vec3 vec); + public abstract void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec); public Transforms getTransform() { return Transforms.TOOL; diff --git a/common/src/common/item/ItemWeatherToken.java b/common/src/common/item/ItemWeatherToken.java index 50ddb53..ccb48e4 100755 --- a/common/src/common/item/ItemWeatherToken.java +++ b/common/src/common/item/ItemWeatherToken.java @@ -5,7 +5,7 @@ import common.entity.npc.EntityNPC; import common.init.SoundEvent; import common.world.Weather; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class ItemWeatherToken extends ItemMagnetic { private final Weather weather; @@ -24,7 +24,7 @@ public class ItemWeatherToken extends ItemMagnetic { worldIn.playSoundAtEntity(playerIn, SoundEvent.SPELL, 0.5F); if (!worldIn.client) { - WorldServer world = (WorldServer)worldIn; + AWorldServer world = (AWorldServer)worldIn; if(!world.isExterminated()) { world.setWeather(this.weather); world.resetWeather(); diff --git a/common/src/common/network/IClientPlayer.java b/common/src/common/network/IClientPlayer.java index c5ff27d..fc6ac1d 100644 --- a/common/src/common/network/IClientPlayer.java +++ b/common/src/common/network/IClientPlayer.java @@ -1,8 +1,10 @@ package common.network; +import common.entity.Entity; import common.entity.animal.EntityHorse; import common.inventory.IInventory; import common.inventory.InventoryPlayer; +import common.model.ParticleType; import common.packet.S14PacketEntity; import common.packet.S18PacketEntityTeleport; import common.packet.S19PacketEntityHeadLook; @@ -64,258 +66,85 @@ import common.packet.SPacketTimeUpdate; import common.packet.SPacketTrades; import common.packet.SPacketUpdateHealth; import common.packet.SPacketWorld; +import common.sound.Sound; import common.tileentity.IInteractionObject; import common.util.BlockPos; import common.world.World; public interface IClientPlayer { + void playSound(Sound sound); + boolean isRenderViewEntity(Entity entity); + void updatePlayerMoveState(); + void emitParticleAtEntity(Entity entityIn, ParticleType particleTypes); + boolean isJumping(); + boolean isSprinting(); + boolean isSneaking(); + float getMoveForward(); + float getMoveStrafe(); + void setMoveForward(float value); + void setMoveStrafe(float value); void addToSendQueue(Packet packet); void handleJoinGame(SPacketJoinGame packetIn); - - /** - * Spawns an instance of the objecttype indicated by the packet and sets its position and momentum - */ void handleSpawnObject(SPacketSpawnObject packetIn); - - /** - * Handles globally visible entities. Used in vanilla for lightning bolts - */ void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn); - - /** - * Sets the velocity of the specified entity to the specified value - */ void handleEntityVelocity(SPacketEntityVelocity packetIn); - - /** - * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have - * changed -> Registers any changes locally - */ void handleEntityMetadata(S1CPacketEntityMetadata packetIn); - - /** - * Handles the creation of a nearby player entity, sets the position and held item - */ void handleSpawnPlayer(SPacketSpawnPlayer packetIn); - - /** - * Updates an entity's position and rotation as specified by the packet - */ void handleEntityTeleport(S18PacketEntityTeleport packetIn); - - /** - * Updates which hotbar slot of the player is currently selected - */ void handleHeldItemChange(SPacketHeldItemChange packetIn); - - /** - * Updates the specified entity's position by the specified relative moment and absolute rotation. Note that - * subclassing of the packet allows for the specification of a subset of this data (e.g. only rel. position, abs. - * rotation or both). - */ void handleEntityMovement(S14PacketEntity packetIn); - - /** - * Updates the direction in which the specified entity is looking, normally this head rotation is independent of the - * rotation of the entity itself - */ void handleEntityHeadLook(S19PacketEntityHeadLook packetIn); - - /** - * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no - * longer registered as required to monitor them. The latter happens when distance between the player and item - * increases beyond a certain treshold (typically the viewing distance) - */ void handleDestroyEntities(SPacketDestroyEntities packetIn); - - /** - * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning, - * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the - * player positioning - */ void handlePlayerPosLook(SPacketPlayerPosLook packetIn); - - /** - * Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block - * requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends - * S21PacketChunkData - */ void handleMultiBlockChange(SPacketMultiBlockChange packetIn); - - /** - * Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation - */ void handleChunkData(SPacketChunkData packetIn); - void handleBiomes(SPacketBiomes packetIn); - - /** - * Updates the block and metadata and generates a blockupdate (and notify the clients) - */ void handleBlockChange(SPacketBlockChange packetIn); - - /** - * Closes the network channel - */ void handleDisconnect(SPacketDisconnect packetIn); - void handleCollectItem(SPacketCollectItem packetIn); - - /** - * Prints a chatmessage in the chat GUI - */ void handleMessage(SPacketMessage packetIn); - void handleLoading(SPacketLoading packet); - - /** - * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt - * or receiving a critical hit by normal or magical means - */ void handleAnimation(SPacketAnimation packetIn); - - /** - * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the - * entities Datawatchers with the entity metadata specified in the packet - */ void handleSpawnMob(SPacketSpawnMob packetIn); - void handleTimeUpdate(SPacketTimeUpdate packetIn); - void handleServerTick(SPacketServerTick packet); - void handleEntityAttach(S1BPacketEntityAttach packetIn); - - /** - * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), - * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch - * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke - * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) - */ void handleEntityStatus(S1APacketEntityStatus packetIn); - void handleUpdateHealth(SPacketUpdateHealth packetIn); - void handleSetExperience(SPacketSetExperience packetIn); - void handleRespawn(SPacketRespawn packetIn); - - /** - * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. - */ void handleExplosion(S27PacketExplosion packetIn); - - /** - * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table, - * Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse - */ void handleOpenWindow(S2DPacketOpenWindow packetIn); - - /** - * Handles pickin up an ItemStack or dropping one in your inventory or an open container - */ void handleSetSlot(S2FPacketSetSlot packetIn); - - /** - * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player - * and confirms if it is the case. - */ void handleConfirmTransaction(S32PacketConfirmTransaction packetIn); - - /** - * Handles the placement of a specified ItemStack in a specified container/inventory slot - */ void handleWindowItems(S30PacketWindowItems packetIn); - - /** - * Creates a sign in the specified location if it didn't exist and opens the GUI to edit its text - */ void handleSignEditorOpen(S36PacketSignEditorOpen packetIn); - - /** - * Updates a specified sign with the specified text lines - */ void handleUpdateSign(S33PacketUpdateSign packetIn); - - /** - * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks, - * beacons, skulls, flowerpot - */ void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn); - - /** - * Sets the progressbar of the opened window to the specified value - */ void handleWindowProperty(S31PacketWindowProperty packetIn); - void handleEntityEquipment(SPacketEntityEquipment packetIn); - - /** - * Resets the ItemStack held in hand and closes the window that is opened - */ void handleCloseWindow(S2EPacketCloseWindow packetIn); - - /** - * Triggers Block.onBlockEventReceived, which is implemented in BlockPistonBase for extension/retraction, BlockNote - * for setting the instrument (including audiovisual feedback) and in BlockContainer to set the number of players - * accessing a (Ender)Chest - */ void handleBlockAction(SPacketBlockAction packetIn); - - /** - * Updates all registered IWorldAccess instances with destroyBlockInWorldPartially - */ void handleBlockBreakAnim(SPacketBlockBreakAnim packetIn); - void handleMapChunkBulk(SPacketMapChunkBulk packetIn); - void handleChangeGameState(S2BPacketChangeGameState packetIn); - void handleEffect(S28PacketEffect packetIn); - void handleEntityEffect(S1DPacketEntityEffect packetIn); - void handleCamera(SPacketCamera packetIn); - void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn); - void handlePlayerListItem(S38PacketPlayerListItem packetIn); - void handleCharacterList(SPacketCharacterList packet); - void handleKeepAlive(SPacketKeepAlive packetIn); - void handlePlayerAbilities(S39PacketPlayerAbilities packetIn); - - /** - * Displays the available command-completion options the server knows of - */ void handleTabComplete(S3APacketTabComplete packetIn); - void handleSoundEffect(S29PacketSoundEffect packetIn); - void handleEntityNBT(S43PacketUpdateEntityNBT packetIn); - - /** - * Spawns a specified number of particles at the specified location with a randomized displacement according to - * specified bounds - */ void handleParticles(S2APacketParticles packetIn); - - /** - * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player - * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie - * maxHealth and knockback resistance as well as reinforcement spawning chance. - */ void handleEntityProperties(S20PacketEntityProperties packetIn); - void handleSkin(SPacketSkin packetIn); - void handleTrades(SPacketTrades packetIn); - void handleWorld(SPacketWorld packetIn); - void handleDimName(SPacketDimensionName packetIn); void displayGUIChest(IInventory chestInventory, InventoryPlayer inventory); diff --git a/common/src/common/packet/APacketEmpty.java b/common/src/common/packet/APacketEmpty.java deleted file mode 100755 index dfc7ceb..0000000 --- a/common/src/common/packet/APacketEmpty.java +++ /dev/null @@ -1,14 +0,0 @@ -package common.packet; - -import java.io.IOException; - -import common.network.Packet; -import common.network.PacketBuffer; - -public abstract class APacketEmpty implements Packet { - public final void readPacketData(PacketBuffer buf) throws IOException { - } - - public final void writePacketData(PacketBuffer buf) throws IOException { - } -} diff --git a/common/src/common/packet/RPacketLoginSuccess.java b/common/src/common/packet/RPacketLoginSuccess.java index 6e46fa0..a8b7837 100755 --- a/common/src/common/packet/RPacketLoginSuccess.java +++ b/common/src/common/packet/RPacketLoginSuccess.java @@ -1,11 +1,34 @@ package common.packet; -import common.network.IClientLoginHandler; +import java.io.IOException; -public class RPacketLoginSuccess extends APacketEmpty -{ - public void processPacket(IClientLoginHandler handler) - { - handler.handleLoginSuccess(this); - } +import common.network.IClientLoginHandler; +import common.network.Packet; +import common.network.PacketBuffer; + +public class RPacketLoginSuccess implements Packet { + private boolean debug; + + public RPacketLoginSuccess() { + } + + public RPacketLoginSuccess(boolean debug) { + this.debug = debug; + } + + public final void readPacketData(PacketBuffer buf) throws IOException { + this.debug = buf.readBoolean(); + } + + public final void writePacketData(PacketBuffer buf) throws IOException { + buf.writeBoolean(this.debug); + } + + public void processPacket(IClientLoginHandler handler) { + handler.handleLoginSuccess(this); + } + + public boolean isDebug() { + return this.debug; + } } diff --git a/common/src/common/tileentity/TileEntityBeacon.java b/common/src/common/tileentity/TileEntityBeacon.java index 97ffe57..e8dc19f 100755 --- a/common/src/common/tileentity/TileEntityBeacon.java +++ b/common/src/common/tileentity/TileEntityBeacon.java @@ -15,7 +15,7 @@ import common.util.BlockPos; import common.util.BoundingBox; import common.world.State; import common.world.World; -import common.world.WorldServer; +import common.world.AWorldServer; public class TileEntityBeacon extends TileEntity implements ITickable { @@ -45,7 +45,7 @@ public class TileEntityBeacon extends TileEntity implements ITickable */ public void update() { - if (!this.worldObj.client && ((WorldServer)this.worldObj).getTime() % 80L == 0L) + if (!this.worldObj.client && ((AWorldServer)this.worldObj).getTime() % 80L == 0L) { this.updateBeacon(); } diff --git a/common/src/common/tileentity/TileEntityDaylightDetector.java b/common/src/common/tileentity/TileEntityDaylightDetector.java index 02ca54d..a3518e2 100755 --- a/common/src/common/tileentity/TileEntityDaylightDetector.java +++ b/common/src/common/tileentity/TileEntityDaylightDetector.java @@ -1,7 +1,7 @@ package common.tileentity; import common.block.BlockDaylightDetector; -import common.world.WorldServer; +import common.world.AWorldServer; public class TileEntityDaylightDetector extends TileEntity implements ITickable { @@ -10,13 +10,13 @@ public class TileEntityDaylightDetector extends TileEntity implements ITickable */ public void update() { - if (this.worldObj != null && !this.worldObj.client && ((WorldServer)this.worldObj).getTime() % 20L == 0L) + if (this.worldObj != null && !this.worldObj.client && ((AWorldServer)this.worldObj).getTime() % 20L == 0L) { this.blockType = this.getBlockType(); if (this.blockType instanceof BlockDaylightDetector) { - ((BlockDaylightDetector)this.blockType).updatePower((WorldServer)this.worldObj, this.pos); + ((BlockDaylightDetector)this.blockType).updatePower((AWorldServer)this.worldObj, this.pos); } } } diff --git a/common/src/common/village/Village.java b/common/src/common/village/Village.java index adc573f..7ecc458 100755 --- a/common/src/common/village/Village.java +++ b/common/src/common/village/Village.java @@ -10,7 +10,7 @@ import common.material.Material; import common.nbt.NBTTagCompound; import common.nbt.NBTTagList; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; public class Village { @@ -24,17 +24,17 @@ public class Village // { // } // -// public Village(WorldServer worldIn) +// public Village(IWorldServer worldIn) // { // this.worldObj = worldIn; // } // -// public void setWorld(WorldServer worldIn) +// public void setWorld(IWorldServer worldIn) // { // this.worldObj = worldIn; // } - public void tick(WorldServer world, int counter) + public void tick(AWorldServer world, int counter) { // this.tickCounter = counter; boolean mod = false; @@ -180,7 +180,7 @@ public class Village return this.doors.isEmpty(); } - private boolean isWoodDoor(WorldServer world, BlockPos pos) + private boolean isWoodDoor(AWorldServer world, BlockPos pos) { Block block = world.getState(pos).getBlock(); return block instanceof BlockDoor ? block.getMaterial() == Material.wood : false; diff --git a/common/src/common/world/AWorldClient.java b/common/src/common/world/AWorldClient.java new file mode 100644 index 0000000..c7189f0 --- /dev/null +++ b/common/src/common/world/AWorldClient.java @@ -0,0 +1,15 @@ +package common.world; + +import common.dimension.Dimension; +import common.init.SoundEvent; +import common.nbt.NBTTagCompound; + +public abstract class AWorldClient extends World { + protected AWorldClient(Dimension dim, boolean debug) { + super(dim, true, debug); + } + + public abstract void playSound(double x, double y, double z, SoundEvent sound, float volume); + public abstract void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund); + public abstract void setLastLightning(int last, int color); +} diff --git a/common/src/common/world/AWorldServer.java b/common/src/common/world/AWorldServer.java new file mode 100644 index 0000000..5135f32 --- /dev/null +++ b/common/src/common/world/AWorldServer.java @@ -0,0 +1,62 @@ +package common.world; + +import java.util.List; + +import common.block.Block; +import common.dimension.Dimension; +import common.entity.Entity; +import common.entity.npc.EntityNPC; +import common.entity.types.EntityLiving; +import common.model.ParticleType; +import common.network.IPlayer; +import common.network.Packet; +import common.rng.Random; +import common.util.BlockPos; +import common.util.BoundingBox; +import common.util.PortalType; +import common.village.Village; +import common.worldgen.BiomeGenerator; + +public abstract class AWorldServer extends World { + protected AWorldServer(Dimension dim, boolean debug) { + super(dim, false, debug); + } + + public abstract List getAllPlayers(); + public abstract AWorldServer getOtherWorld(int dimension); + public abstract void placeInDimension(Entity entity, AWorldServer oldWorld, AWorldServer world, BlockPos pos, PortalType portal); + public abstract State getSurfaceLiquid(); + public abstract boolean addLoader(BlockPos pos); + public abstract boolean removeLoader(BlockPos pos); + public abstract BiomeGenerator getBiomeGenerator(); + public abstract boolean isBlockTickPending(BlockPos pos, Block blockType); + public abstract void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority); + public abstract void resetUpdateEntityTick(); + public abstract void strikeLightning(double x, double y, double z, int color, int damage, boolean fire, EntityLiving summoner); + public abstract void resetWeather(); + public abstract void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, + double zOffset, double particleSpeed, int... particleArguments); + public abstract long getSeed(); + public abstract boolean isExterminated(); + public abstract boolean exterminate(); + public abstract void forceBlockUpdateTick(Block blockType, BlockPos pos, Random random); + public abstract Village getNearestVillage(BlockPos doorBlock, int radius); + public abstract void addToVillagerPositionList(BlockPos blockpos); + public abstract void removePlayer(EntityNPC player); + public abstract void updateMountedMovingPlayer(EntityNPC player); + public abstract boolean isPlayerWatchingChunk(EntityNPC player, int chunkX, int chunkZ); + public abstract void untrackEntity(Entity entityIn); + public abstract void updateTrackedPlayer(EntityNPC player); + public abstract void sendToAllTrackingEntity(Entity entityIn, Packet packet); + public abstract void sendToAllTrackingAndSelf(Entity entityIn, Packet packet); + public abstract void removePlayerFromTrackers(EntityNPC player); + public abstract void updateChunksForPlayer(EntityNPC player, Chunk chunk); + public abstract boolean isDaytime(); + public abstract int getSkylightSubtracted(); + public abstract boolean isBlockinHighHumidity(BlockPos pos); + public abstract T findNearestEntityWithinAABB(Class entityType, BoundingBox aabb, T closestTo); + public abstract boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj); + public abstract BlockPos getTopSolidOrLiquidBlock(BlockPos pos); + public abstract void removePlayerEntityDangerously(Entity entityIn); + public abstract long getTime(); +} diff --git a/common/src/common/world/Chunk.java b/common/src/common/world/Chunk.java index 68f14f5..484292c 100755 --- a/common/src/common/world/Chunk.java +++ b/common/src/common/world/Chunk.java @@ -482,7 +482,7 @@ public class Chunk { if(oldb != block) { if(!this.world.client) { - oldb.onBlockRemoved((WorldServer)this.world, pos, old); + oldb.onBlockRemoved((AWorldServer)this.world, pos, old); } else if(oldb instanceof ITileEntityProvider) { this.world.removeTileEntity(pos); @@ -523,7 +523,7 @@ public class Chunk { } if(!this.world.client && oldb != block) { - block.onBlockAdded((WorldServer)this.world, pos, state); + block.onBlockAdded((AWorldServer)this.world, pos, state); } if(block instanceof ITileEntityProvider) { diff --git a/common/src/common/world/Explosion.java b/common/src/common/world/Explosion.java index c2830a2..f3c1e2f 100755 --- a/common/src/common/world/Explosion.java +++ b/common/src/common/world/Explosion.java @@ -172,7 +172,7 @@ public class Explosion worldObj.setState(blockpos, Blocks.air.getState(), 3); if(rand.chance(1000)) { worldObj.playSound(SoundEvent.EXPLODE, explosionX + x, explosionY + y, explosionZ + z, 4.0F); - ((WorldServer)worldObj).spawnParticle(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z, 0, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, 1.0); + ((AWorldServer)worldObj).spawnParticle(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z, 0, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, 1.0); } } } diff --git a/common/src/common/world/IWorld.java b/common/src/common/world/IWorld.java new file mode 100644 index 0000000..ef161f4 --- /dev/null +++ b/common/src/common/world/IWorld.java @@ -0,0 +1,279 @@ +package common.world; + +import java.util.Collection; +import java.util.List; +import java.util.function.Predicate; + +import common.biome.Biome; +import common.block.Block; +import common.block.LeavesType; +import common.entity.Entity; +import common.entity.item.EntityExplosion; +import common.entity.npc.EntityNPC; +import common.init.SoundEvent; +import common.item.ItemStack; +import common.model.ParticleType; +import common.tileentity.TileEntity; +import common.util.BlockPos; +import common.util.BoundingBox; +import common.util.Facing; +import common.util.HitPosition; +import common.util.Vec3; + +public interface IWorld { + + boolean isBlockSolid(BlockPos pos); + + void setGravity(float gravity); + + Biome getBiomeGenForCoords(BlockPos pos); + + boolean isAirBlock(BlockPos pos); + + boolean isBlockLoaded(BlockPos pos); + + boolean isBlockLoaded(BlockPos pos, boolean allowEmpty); + + boolean isAreaLoaded(BlockPos center, int radius); + + boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty); + + boolean isAreaLoaded(BlockPos from, BlockPos to); + + boolean isAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty); + + Chunk getChunk(BlockPos pos); + + boolean setState(BlockPos pos, State newState, int flags); + + boolean setState(BlockPos pos, State state); + + boolean setBlockToAir(BlockPos pos); + + boolean destroyBlock(BlockPos pos, boolean dropBlock); + + void notifyNeighborsRespectDebug(BlockPos pos, Block blockType); + + void markBlocksDirtyVertical(int x1, int z1, int x2, int z2); + + void markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax); + + void notifyNeighborsOfStateChange(BlockPos pos, Block blockType); + + void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, Facing skipSide); + + void notifyBlockOfStateChange(BlockPos pos, Block blockIn); + + boolean canSeeSky(BlockPos pos); + + int getLight(BlockPos pos); + + int getLightFromNeighbors(BlockPos pos); + + BlockPos getHeight(BlockPos pos); + + int getChunksLowestHorizon(int x, int z); + + int getLightFromNeighborsFor(LightType type, BlockPos pos); + + int getLightFor(LightType type, BlockPos pos); + + void setLightFor(LightType type, BlockPos pos, int lightValue); + + int getCombinedLight(BlockPos pos, int lightValue); + + float getLightBrightness(BlockPos pos); + + State getState(BlockPos pos); + + BlockPos getBlockTrace(Entity entity, int distance); + + HitPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_); + + HitPosition rayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid); + + HitPosition rayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, + boolean returnLastUncollidableBlock); + + void playSoundAtEntity(Entity entityIn, SoundEvent name, float volume); + + boolean spawnEntityInWorld(Entity entityIn); + + void removeEntity(Entity entityIn); + + List getCollidingBoundingBoxes(Entity entityIn, BoundingBox bb); + + List getCollisionBoxes(BoundingBox bb); + + int calculateSkylightSubtracted(boolean current); + + float getCelestialAngle(float partialTicks); + + int getMoonPhase(); + + float getCurrentMoonPhaseFactor(); + + float getCelestialAngleRadians(float partialTicks); + + BlockPos getPrecipitationHeight(BlockPos pos); + + void updateEntities(); + + boolean addTileEntity(TileEntity tile); + + void addTileEntities(Collection tileEntityCollection); + + void updateEntity(Entity entityIn, boolean forceUpdate); + + boolean checkNoEntityCollision(BoundingBox bb); + + boolean checkNoEntityCollision(BoundingBox bb, Entity entityIn); + + boolean isAnyLiquid(BoundingBox bb); + + boolean isFlammableWithin(BoundingBox bb); + + boolean handleLiquidAcceleration(BoundingBox bb, Entity entityIn); + + boolean isMaterialInMolten(BoundingBox bb); + + boolean isAABBInLiquid(BoundingBox bb); + + Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking); + + Explosion createAltExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking); + + Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking, boolean altSound); + + EntityExplosion newExplosion(double x, double y, double z, int strength); + + float getBlockDensity(Vec3 vec, BoundingBox bb); + + boolean extinguishFire(EntityNPC player, BlockPos pos, Facing side); + + TileEntity getTileEntity(BlockPos pos); + + void setTileEntity(BlockPos pos, TileEntity tileEntityIn); + + void removeTileEntity(BlockPos pos); + + void markTileEntityForRemoval(TileEntity tileEntityIn); + + float getTempOffset(); + + LeavesType getLeavesGen(BlockPos pos); + + float getTemperatureK(BlockPos pos); + + float getTemperatureC(BlockPos pos); + + boolean canFreezeAt(BlockPos pos); + + boolean canBurnAt(BlockPos pos); + + boolean doesWaterVaporize(BlockPos pos); + + boolean isLavaFaster(BlockPos pos); + + boolean canSnowAt(BlockPos pos, boolean checkLight, boolean allowLayers); + + boolean checkLight(BlockPos pos); + + boolean checkLightFor(LightType lightType, BlockPos pos); + + List getEntitiesWithinAABBExcludingEntity(Entity entityIn, BoundingBox bb); + + List getEntitiesInAABBexcluding(Entity entityIn, BoundingBox boundingBox, Predicate predicate); + + List getEntitiesWithinAABB(Class classEntity, BoundingBox bb); + + List getEntitiesWithinAABB(Class clazz, BoundingBox aabb, Predicate filter); + + Entity getEntityByID(int id); + + void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity); + + void loadEntities(Collection entityCollection); + + void unloadEntities(Collection entityCollection); + + boolean canBlockBePlaced(Block blockIn, BlockPos pos, boolean p_175716_3_, Facing side, Entity entityIn, ItemStack itemStackIn); + + int getSeaLevel(); + + int getStrongPower(BlockPos pos); + + boolean isSidePowered(BlockPos pos, Facing side); + + int getRedstonePower(BlockPos pos, Facing facing); + + boolean isBlockPowered(BlockPos pos); + + int isBlockIndirectlyGettingPowered(BlockPos pos); + + EntityNPC getClosestPlayerToEntity(Entity entityIn, double distance); + + EntityNPC getClosestPlayer(double x, double y, double z, double distance); + + boolean isAnyPlayerWithinRangeAt(double x, double y, double z, double range); + + void setTimeFactor(int factor); + + void setEntityState(Entity entityIn, byte state); + + void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam); + + Weather getWeather(); + + long getDayTime(); + + void setWeather(Weather weather); + + void setDayTime(long time); + + float getDarkness(); + + void setDarkness(float dark); + + float getRainStrength(); + + void setRainStrength(float strength); + + float getFogStrength(); + + void setFogStrength(float strength); + + void setTemperature(float temp); + + boolean isDark(); + + boolean isThundering(); + + boolean hasDownfall(); + + boolean isRaining(); + + boolean isRainingAt(BlockPos strikePosition, boolean wet); + + void playAuxSFX(int type, BlockPos pos, int data); + + void updateComparatorOutputLevel(BlockPos pos, Block blockIn); + + void scheduleUpdate(BlockPos pos, Block blockIn, int delay); + + void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, + int... data); + + Chunk getChunk(int x, int z); + + void markBlockForUpdate(BlockPos pos); + + void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2); + + void playSound(SoundEvent sound, double x, double y, double z, float volume); + + void playAuxSFX(EntityNPC player, int sfxType, BlockPos blockPosIn, int data); + + void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress); + +} \ No newline at end of file diff --git a/common/src/common/world/World.java b/common/src/common/world/World.java index 519dc36..7b66e16 100755 --- a/common/src/common/world/World.java +++ b/common/src/common/world/World.java @@ -38,7 +38,7 @@ import common.util.HitPosition; import common.util.IntHashMap; import common.util.Vec3; -public abstract class World implements IWorldAccess { +public abstract class World implements IWorldAccess, IWorld { public static final float[][] BRIGHTNESS = new float[16][16]; static { for(int l = 0; l < 16; l++) { diff --git a/common/src/common/worldgen/BlockReplacer.java b/common/src/common/worldgen/BlockReplacer.java index e45c63b..f94bab7 100755 --- a/common/src/common/worldgen/BlockReplacer.java +++ b/common/src/common/worldgen/BlockReplacer.java @@ -2,8 +2,8 @@ package common.worldgen; import common.biome.Biome; import common.rng.Random; -import common.world.WorldServer; +import common.world.AWorldServer; public interface BlockReplacer { - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes); + public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes); } diff --git a/common/src/common/worldgen/ChunkGenerator.java b/common/src/common/worldgen/ChunkGenerator.java index df3ae2d..6e149f1 100755 --- a/common/src/common/worldgen/ChunkGenerator.java +++ b/common/src/common/worldgen/ChunkGenerator.java @@ -1,8 +1,8 @@ package common.worldgen; -import common.world.WorldServer; +import common.world.AWorldServer; public interface ChunkGenerator { - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer); + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer); public int getMaximumHeight(); } diff --git a/common/src/common/worldgen/FeatureDungeons.java b/common/src/common/worldgen/FeatureDungeons.java index 5e01ee4..cb04f19 100755 --- a/common/src/common/worldgen/FeatureDungeons.java +++ b/common/src/common/worldgen/FeatureDungeons.java @@ -12,7 +12,7 @@ import common.tileentity.TileEntityChest; import common.tileentity.TileEntityMobSpawner; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; +import common.world.AWorldServer; public class FeatureDungeons { @@ -25,7 +25,7 @@ public class FeatureDungeons } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) { + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { boolean flag = false; for(int z = 0; z < this.chance; z++) { flag |= this.generateDungeon(worldIn, rand, position.add(rand.chOffset(), rand.zrange(256), rand.chOffset())); @@ -33,7 +33,7 @@ public class FeatureDungeons return flag; } - private boolean generateDungeon(WorldServer worldIn, Random rand, BlockPos position) + private boolean generateDungeon(AWorldServer worldIn, Random rand, BlockPos position) { int i = 3; int j = rand.zrange(2) + 2; diff --git a/common/src/common/worldgen/FeatureGenerator.java b/common/src/common/worldgen/FeatureGenerator.java index 19beb30..6854bce 100755 --- a/common/src/common/worldgen/FeatureGenerator.java +++ b/common/src/common/worldgen/FeatureGenerator.java @@ -3,7 +3,7 @@ package common.worldgen; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class FeatureGenerator { @@ -19,9 +19,9 @@ public abstract class FeatureGenerator this.doBlockNotify = notify; } - public abstract boolean generate(WorldServer worldIn, Random rand, BlockPos position); + public abstract boolean generate(AWorldServer worldIn, Random rand, BlockPos position); - protected void setBlockAndNotifyAdequately(WorldServer worldIn, BlockPos pos, State state) + protected void setBlockAndNotifyAdequately(AWorldServer worldIn, BlockPos pos, State state) { if (this.doBlockNotify) { diff --git a/common/src/common/worldgen/FeatureLakes.java b/common/src/common/worldgen/FeatureLakes.java index 658d7d0..47f5f97 100755 --- a/common/src/common/worldgen/FeatureLakes.java +++ b/common/src/common/worldgen/FeatureLakes.java @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import common.world.LightType; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class FeatureLakes { @@ -47,7 +47,7 @@ public class FeatureLakes // this(block, block == Blocks.lava ? Blocks.stone.getDefaultState() : null, Blocks.dirt, Blocks.grass.getDefaultState()); // } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) { + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if(this.ratiod) { if(this.chance >= 1 && rand.chance(this.chance)) { int y = rand.range(this.minHeight, this.maxHeight); // rand.zrange(rand.zrange(248) + 8); @@ -63,7 +63,7 @@ public class FeatureLakes return false; } - private boolean generateLake(WorldServer worldIn, Random rand, BlockPos position) + private boolean generateLake(AWorldServer worldIn, Random rand, BlockPos position) { for (position = position.add(-8, 0, -8); position.getY() > 5 && worldIn.isAirBlock(position); position = position.down()) { diff --git a/common/src/common/worldgen/FeatureLiquids.java b/common/src/common/worldgen/FeatureLiquids.java index 900c594..e0c0e26 100755 --- a/common/src/common/worldgen/FeatureLiquids.java +++ b/common/src/common/worldgen/FeatureLiquids.java @@ -5,7 +5,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class FeatureLiquids { @@ -40,7 +40,7 @@ public class FeatureLiquids } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) { + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { Block replace = worldIn.dimension.getFiller().getBlock(); boolean flag = false; for(int z = 0; z < this.chance; z++) { @@ -56,7 +56,7 @@ public class FeatureLiquids return flag; } - private boolean generateLiquid(WorldServer worldIn, Random rand, BlockPos position, Block replace) + private boolean generateLiquid(AWorldServer worldIn, Random rand, BlockPos position, Block replace) { if (worldIn.getState(position.up()).getBlock() != replace) { diff --git a/common/src/common/worldgen/FeatureOres.java b/common/src/common/worldgen/FeatureOres.java index 091d34b..0786e0c 100755 --- a/common/src/common/worldgen/FeatureOres.java +++ b/common/src/common/worldgen/FeatureOres.java @@ -5,7 +5,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class FeatureOres { @@ -80,7 +80,7 @@ public class FeatureOres // this.replace = replace; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) { + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { Block replace = /* this.replace != null ? this.replace : */ worldIn.dimension.getFiller().getBlock(); int tries = this.spawnTries == 0 ? (rand.zrange(this.moreTries) == 0 ? 1 : 0) : @@ -106,7 +106,7 @@ public class FeatureOres return true; } - private void generateVein(WorldServer worldIn, Random rand, BlockPos position, Block replace) + private void generateVein(AWorldServer worldIn, Random rand, BlockPos position, Block replace) { float f = rand.floatv() * (float)Math.PI; double d0 = (double)(/* (float)(position.getX() + 8) */ 8.0f + ExtMath.sin(f) * (float)this.numberOfBlocks / 8.0F); diff --git a/common/src/common/worldgen/GeneratorCavern.java b/common/src/common/worldgen/GeneratorCavern.java index 0aed076..a3e164e 100755 --- a/common/src/common/worldgen/GeneratorCavern.java +++ b/common/src/common/worldgen/GeneratorCavern.java @@ -4,7 +4,7 @@ import common.rng.OctaveGen; import common.rng.Random; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorCavern implements ChunkGenerator { @@ -43,7 +43,7 @@ public class GeneratorCavern implements ChunkGenerator return 128; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { int range = 4; int lh = world.getSeaLevel() / 2 + 1; diff --git a/common/src/common/worldgen/GeneratorDebug.java b/common/src/common/worldgen/GeneratorDebug.java index 58ca6c1..5833d49 100755 --- a/common/src/common/worldgen/GeneratorDebug.java +++ b/common/src/common/worldgen/GeneratorDebug.java @@ -7,7 +7,7 @@ import common.collect.Lists; import common.init.BlockRegistry; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorDebug implements ChunkGenerator { @@ -42,7 +42,7 @@ public class GeneratorDebug implements ChunkGenerator return 72; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { for(int bx = 0; bx < 16; ++bx) { for(int bz = 0; bz < 16; ++bz) { diff --git a/common/src/common/worldgen/GeneratorDestroyed.java b/common/src/common/worldgen/GeneratorDestroyed.java index 5eea1c5..2d7b188 100755 --- a/common/src/common/worldgen/GeneratorDestroyed.java +++ b/common/src/common/worldgen/GeneratorDestroyed.java @@ -3,7 +3,7 @@ package common.worldgen; import common.init.Blocks; import common.rng.Random; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorDestroyed implements ChunkGenerator { @@ -23,7 +23,7 @@ public class GeneratorDestroyed implements ChunkGenerator return this.height; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { for(int by = 0; by < this.height; ++by) { for(int bx = 0; bx < 16; ++bx) { diff --git a/common/src/common/worldgen/GeneratorFlat.java b/common/src/common/worldgen/GeneratorFlat.java index 2c0071b..bb97868 100755 --- a/common/src/common/worldgen/GeneratorFlat.java +++ b/common/src/common/worldgen/GeneratorFlat.java @@ -3,7 +3,7 @@ package common.worldgen; import java.util.Arrays; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorFlat implements ChunkGenerator { private final State[] layers; @@ -37,7 +37,7 @@ public class GeneratorFlat implements ChunkGenerator { return this.layers.length; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) { + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { for(int by = 0; by < this.layers.length; by++) { State state = this.layers[by]; for(int bx = 0; bx < 16; bx++) { diff --git a/common/src/common/worldgen/GeneratorIsland.java b/common/src/common/worldgen/GeneratorIsland.java index 14c3b81..ffb42f9 100755 --- a/common/src/common/worldgen/GeneratorIsland.java +++ b/common/src/common/worldgen/GeneratorIsland.java @@ -4,7 +4,7 @@ import common.rng.OctaveGen; import common.rng.Random; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorIsland implements ChunkGenerator { @@ -41,7 +41,7 @@ public class GeneratorIsland implements ChunkGenerator return 128; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { int range = 2; int xr = range + 1; diff --git a/common/src/common/worldgen/GeneratorPerlin.java b/common/src/common/worldgen/GeneratorPerlin.java index f9156a9..7269142 100755 --- a/common/src/common/worldgen/GeneratorPerlin.java +++ b/common/src/common/worldgen/GeneratorPerlin.java @@ -7,7 +7,7 @@ import common.rng.OctaveGen; import common.rng.Random; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorPerlin implements ChunkGenerator { @@ -105,7 +105,7 @@ public class GeneratorPerlin implements ChunkGenerator return 256; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { int sea = world.getSeaLevel(); world.getBiomeGenerator().getGenBiomes(this.biomes, x * 4 - 2, z * 4 - 2, 10, 10); diff --git a/common/src/common/worldgen/GeneratorSimple.java b/common/src/common/worldgen/GeneratorSimple.java index 3ba0303..fb940fc 100755 --- a/common/src/common/worldgen/GeneratorSimple.java +++ b/common/src/common/worldgen/GeneratorSimple.java @@ -4,7 +4,7 @@ import common.rng.NoiseGen; import common.rng.OctaveGen; import common.rng.Random; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class GeneratorSimple implements ChunkGenerator { @@ -54,7 +54,7 @@ public class GeneratorSimple implements ChunkGenerator return 128; } - public void generateChunk(WorldServer world, int x, int z, ChunkPrimer primer) + public void generateChunk(AWorldServer world, int x, int z, ChunkPrimer primer) { if(this.biomeGen == null) world.getBiomeGenerator().genFactors(this.factors, x * 16, z * 16, 16, 16); diff --git a/common/src/common/worldgen/ReplacerAltBiome.java b/common/src/common/worldgen/ReplacerAltBiome.java index 549d8c9..f312858 100755 --- a/common/src/common/worldgen/ReplacerAltBiome.java +++ b/common/src/common/worldgen/ReplacerAltBiome.java @@ -7,7 +7,7 @@ import common.rng.NoiseGen; import common.rng.OctaveGen; import common.rng.Random; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class ReplacerAltBiome implements BlockReplacer { @@ -46,7 +46,7 @@ public class ReplacerAltBiome implements BlockReplacer this.block = filler.getBlock(); } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) + public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { int seaLevel = world.getSeaLevel(); double scale = 0.03125D; diff --git a/common/src/common/worldgen/ReplacerAltSurface.java b/common/src/common/worldgen/ReplacerAltSurface.java index 3dc3c58..1911633 100755 --- a/common/src/common/worldgen/ReplacerAltSurface.java +++ b/common/src/common/worldgen/ReplacerAltSurface.java @@ -6,7 +6,7 @@ import common.material.Material; import common.rng.OctaveGen; import common.rng.Random; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class ReplacerAltSurface implements BlockReplacer { @@ -38,7 +38,7 @@ public class ReplacerAltSurface implements BlockReplacer this.fillerBlock = filler.getBlock(); } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) + public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { int i = world.getSeaLevel() + 1; double d0 = 0.03125D; diff --git a/common/src/common/worldgen/ReplacerBiome.java b/common/src/common/worldgen/ReplacerBiome.java index aa3d70a..c483418 100755 --- a/common/src/common/worldgen/ReplacerBiome.java +++ b/common/src/common/worldgen/ReplacerBiome.java @@ -3,7 +3,7 @@ package common.worldgen; import common.biome.Biome; import common.rng.PerlinGen; import common.rng.Random; -import common.world.WorldServer; +import common.world.AWorldServer; public class ReplacerBiome implements BlockReplacer { @@ -15,7 +15,7 @@ public class ReplacerBiome implements BlockReplacer this.stoneNoiseGen = new PerlinGen(rand, 4); } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) + public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { double d0 = 0.03125D; this.stoneNoiseGen.generate(this.stoneNoise, (double)(x * 16), (double)(z * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); diff --git a/common/src/common/worldgen/ReplacerTopLayer.java b/common/src/common/worldgen/ReplacerTopLayer.java index d27dc7e..2a1804e 100755 --- a/common/src/common/worldgen/ReplacerTopLayer.java +++ b/common/src/common/worldgen/ReplacerTopLayer.java @@ -6,7 +6,7 @@ import common.init.Blocks; import common.material.Material; import common.rng.Random; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class ReplacerTopLayer implements BlockReplacer { @@ -22,7 +22,7 @@ public class ReplacerTopLayer implements BlockReplacer this.replace = replace; } - public void replaceBlocks(WorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) + public void replaceBlocks(AWorldServer world, int x, int z, ChunkPrimer primer, Random rand, Biome[] biomes) { for (int i = 0; i < 16; ++i) { diff --git a/common/src/common/worldgen/caves/MapGenBase.java b/common/src/common/worldgen/caves/MapGenBase.java index 82fb296..f2c9b08 100755 --- a/common/src/common/worldgen/caves/MapGenBase.java +++ b/common/src/common/worldgen/caves/MapGenBase.java @@ -1,7 +1,7 @@ package common.worldgen.caves; import common.rng.Random; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; public class MapGenBase @@ -13,9 +13,9 @@ public class MapGenBase protected Random rand = new Random(); /** This world object. */ - protected WorldServer worldObj; + protected AWorldServer worldObj; - public void generate(WorldServer worldIn, int x, int z, ChunkPrimer chunkPrimerIn) + public void generate(AWorldServer worldIn, int x, int z, ChunkPrimer chunkPrimerIn) { int i = this.range; this.worldObj = worldIn; @@ -38,7 +38,7 @@ public class MapGenBase /** * Recursively called by generate() */ - protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) { } } diff --git a/common/src/common/worldgen/caves/MapGenBigCaves.java b/common/src/common/worldgen/caves/MapGenBigCaves.java index c04c80b..9fb133e 100755 --- a/common/src/common/worldgen/caves/MapGenBigCaves.java +++ b/common/src/common/worldgen/caves/MapGenBigCaves.java @@ -5,7 +5,7 @@ import common.init.Blocks; import common.rng.Random; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; public class MapGenBigCaves extends MapGenBase @@ -199,7 +199,7 @@ public class MapGenBigCaves extends MapGenBase /** * Recursively called by generate() */ - protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) { int i = this.rand.zrange(this.rand.zrange(this.rand.zrange(10) + 1) + 1); diff --git a/common/src/common/worldgen/caves/MapGenCaves.java b/common/src/common/worldgen/caves/MapGenCaves.java index 405603b..ec0d0c7 100755 --- a/common/src/common/worldgen/caves/MapGenCaves.java +++ b/common/src/common/worldgen/caves/MapGenCaves.java @@ -9,7 +9,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; public class MapGenCaves extends MapGenBase @@ -245,7 +245,7 @@ public class MapGenCaves extends MapGenBase /** * Recursively called by generate() */ - protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) { int i = this.rand.zrange(this.rand.zrange(this.rand.zrange(15) + 1) + 1); diff --git a/common/src/common/worldgen/caves/MapGenRavine.java b/common/src/common/worldgen/caves/MapGenRavine.java index 02646d1..cbe9256 100755 --- a/common/src/common/worldgen/caves/MapGenRavine.java +++ b/common/src/common/worldgen/caves/MapGenRavine.java @@ -6,7 +6,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.ChunkPrimer; public class MapGenRavine extends MapGenBase @@ -219,7 +219,7 @@ public class MapGenRavine extends MapGenBase /** * Recursively called by generate() */ - protected void recursiveGenerate(WorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + protected void recursiveGenerate(AWorldServer worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) { if (this.rand.zrange(50) == 0) { diff --git a/common/src/common/worldgen/feature/WorldGenAbandonedChest.java b/common/src/common/worldgen/feature/WorldGenAbandonedChest.java index c724150..61d7574 100755 --- a/common/src/common/worldgen/feature/WorldGenAbandonedChest.java +++ b/common/src/common/worldgen/feature/WorldGenAbandonedChest.java @@ -9,7 +9,7 @@ import common.rng.WeightedList; import common.tileentity.TileEntity; import common.tileentity.TileEntityChest; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; import common.worldgen.LootConstants; @@ -30,7 +30,7 @@ public class WorldGenAbandonedChest extends FeatureGenerator this(LootConstants.ABANDONED_ITEMS, 10); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { Block block; while (((block = worldIn.getState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 1) diff --git a/common/src/common/worldgen/feature/WorldGenAsteroid.java b/common/src/common/worldgen/feature/WorldGenAsteroid.java index fdc1eef..c1459c6 100755 --- a/common/src/common/worldgen/feature/WorldGenAsteroid.java +++ b/common/src/common/worldgen/feature/WorldGenAsteroid.java @@ -3,7 +3,7 @@ package common.worldgen.feature; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenAsteroid extends FeatureGenerator { @@ -13,7 +13,7 @@ public class WorldGenAsteroid extends FeatureGenerator { this.blocks = blocks; } - public boolean generate(WorldServer world, Random rand, BlockPos pos) { + public boolean generate(AWorldServer world, Random rand, BlockPos pos) { for(pos = pos.add(-8, 0, -8); pos.getY() > 9 && !world.isAirBlock(pos); pos = pos.down()) { ; } diff --git a/common/src/common/worldgen/feature/WorldGenBlockBlob.java b/common/src/common/worldgen/feature/WorldGenBlockBlob.java index 06929da..5de76f4 100755 --- a/common/src/common/worldgen/feature/WorldGenBlockBlob.java +++ b/common/src/common/worldgen/feature/WorldGenBlockBlob.java @@ -4,7 +4,7 @@ import common.block.Block; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenBlockBlob extends FeatureGenerator @@ -19,7 +19,7 @@ public class WorldGenBlockBlob extends FeatureGenerator this.field_150544_b = p_i45450_2_; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { while (true) { diff --git a/common/src/common/worldgen/feature/WorldGenClay.java b/common/src/common/worldgen/feature/WorldGenClay.java index 9888fbc..6dc622f 100755 --- a/common/src/common/worldgen/feature/WorldGenClay.java +++ b/common/src/common/worldgen/feature/WorldGenClay.java @@ -4,7 +4,7 @@ import common.block.Block; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenClay extends FeatureGenerator @@ -19,7 +19,7 @@ public class WorldGenClay extends FeatureGenerator this.numberOfBlocks = blocks; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if (!worldIn.getState(position).getBlock().getMaterial().isColdLiquid()) { diff --git a/common/src/common/worldgen/feature/WorldGenClayExt.java b/common/src/common/worldgen/feature/WorldGenClayExt.java index c7fc80e..c9e5ce0 100755 --- a/common/src/common/worldgen/feature/WorldGenClayExt.java +++ b/common/src/common/worldgen/feature/WorldGenClayExt.java @@ -5,14 +5,14 @@ import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenClayExt extends WorldGenClay { public WorldGenClayExt(int blocks) { super(blocks); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) { + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if(!worldIn.getState(position).getBlock().getMaterial().isColdLiquid()) { return false; } diff --git a/common/src/common/worldgen/feature/WorldGenDesertWells.java b/common/src/common/worldgen/feature/WorldGenDesertWells.java index 75fab6b..55a49c8 100755 --- a/common/src/common/worldgen/feature/WorldGenDesertWells.java +++ b/common/src/common/worldgen/feature/WorldGenDesertWells.java @@ -9,7 +9,7 @@ import common.util.BlockPos; import common.util.Facing; import common.util.Predicates; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenDesertWells extends FeatureGenerator @@ -19,7 +19,7 @@ public class WorldGenDesertWells extends FeatureGenerator private final State field_175912_c = Blocks.sandstone.getState(); private final State field_175910_d = Blocks.flowing_water.getState(); - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { while (worldIn.isAirBlock(position) && position.getY() > 2) { diff --git a/common/src/common/worldgen/feature/WorldGenFire.java b/common/src/common/worldgen/feature/WorldGenFire.java index 4623f68..d5ffd52 100755 --- a/common/src/common/worldgen/feature/WorldGenFire.java +++ b/common/src/common/worldgen/feature/WorldGenFire.java @@ -3,12 +3,12 @@ package common.worldgen.feature; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenFire extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 64; ++i) { diff --git a/common/src/common/worldgen/feature/WorldGenGlowStone.java b/common/src/common/worldgen/feature/WorldGenGlowStone.java index a87146c..7f8e92b 100755 --- a/common/src/common/worldgen/feature/WorldGenGlowStone.java +++ b/common/src/common/worldgen/feature/WorldGenGlowStone.java @@ -5,12 +5,12 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenGlowStone extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if (!worldIn.isAirBlock(position)) { diff --git a/common/src/common/worldgen/feature/WorldGenHellLava.java b/common/src/common/worldgen/feature/WorldGenHellLava.java index 7aee1b8..202ab9f 100755 --- a/common/src/common/worldgen/feature/WorldGenHellLava.java +++ b/common/src/common/worldgen/feature/WorldGenHellLava.java @@ -5,7 +5,7 @@ import common.init.Blocks; import common.material.Material; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenHellLava extends FeatureGenerator @@ -19,7 +19,7 @@ public class WorldGenHellLava extends FeatureGenerator this.field_94524_b = p_i45453_2_; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if (worldIn.getState(position.up()).getBlock() != Blocks.hellrock) { diff --git a/common/src/common/worldgen/feature/WorldGenIcePath.java b/common/src/common/worldgen/feature/WorldGenIcePath.java index 69b9aac..b06b13d 100755 --- a/common/src/common/worldgen/feature/WorldGenIcePath.java +++ b/common/src/common/worldgen/feature/WorldGenIcePath.java @@ -4,7 +4,7 @@ import common.block.Block; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenIcePath extends FeatureGenerator @@ -17,7 +17,7 @@ public class WorldGenIcePath extends FeatureGenerator this.basePathWidth = p_i45454_1_; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { while (worldIn.isAirBlock(position) && position.getY() > 2) { diff --git a/common/src/common/worldgen/feature/WorldGenIceSpike.java b/common/src/common/worldgen/feature/WorldGenIceSpike.java index 8d7aaf1..03f5388 100755 --- a/common/src/common/worldgen/feature/WorldGenIceSpike.java +++ b/common/src/common/worldgen/feature/WorldGenIceSpike.java @@ -6,12 +6,12 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenIceSpike extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { while (worldIn.isAirBlock(position) && position.getY() > 2) { diff --git a/common/src/common/worldgen/feature/WorldGenSand.java b/common/src/common/worldgen/feature/WorldGenSand.java index 657a276..1e750bf 100755 --- a/common/src/common/worldgen/feature/WorldGenSand.java +++ b/common/src/common/worldgen/feature/WorldGenSand.java @@ -4,7 +4,7 @@ import common.block.Block; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenSand extends FeatureGenerator @@ -20,7 +20,7 @@ public class WorldGenSand extends FeatureGenerator this.radius = p_i45462_2_; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if (!worldIn.getState(position).getBlock().getMaterial().isColdLiquid()) { diff --git a/common/src/common/worldgen/feature/WorldGenSpikes.java b/common/src/common/worldgen/feature/WorldGenSpikes.java index 76b6f07..736f13b 100755 --- a/common/src/common/worldgen/feature/WorldGenSpikes.java +++ b/common/src/common/worldgen/feature/WorldGenSpikes.java @@ -6,7 +6,7 @@ import common.entity.item.EntityCrystal; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenSpikes extends FeatureGenerator @@ -28,7 +28,7 @@ public class WorldGenSpikes extends FeatureGenerator this.crystals = crystals; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { if (worldIn.isAirBlock(position) && worldIn.getState(position.down()).getBlock() == this.base) { diff --git a/common/src/common/worldgen/foliage/FeatureDoublePlant.java b/common/src/common/worldgen/foliage/FeatureDoublePlant.java index 2e00419..7dbfdcb 100755 --- a/common/src/common/worldgen/foliage/FeatureDoublePlant.java +++ b/common/src/common/worldgen/foliage/FeatureDoublePlant.java @@ -4,7 +4,7 @@ import common.block.BlockDoublePlant; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; public class FeatureDoublePlant { @@ -15,7 +15,7 @@ public class FeatureDoublePlant this.type = type; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { boolean flag = false; diff --git a/common/src/common/worldgen/foliage/WorldGenBigMushroom.java b/common/src/common/worldgen/foliage/WorldGenBigMushroom.java index 96005ec..dac6cef 100755 --- a/common/src/common/worldgen/foliage/WorldGenBigMushroom.java +++ b/common/src/common/worldgen/foliage/WorldGenBigMushroom.java @@ -6,7 +6,7 @@ import common.init.Blocks; import common.material.Material; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenBigMushroom extends FeatureGenerator @@ -25,7 +25,7 @@ public class WorldGenBigMushroom extends FeatureGenerator super(false); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { // if (this.mushroomType == null) // { diff --git a/common/src/common/worldgen/foliage/WorldGenCactus.java b/common/src/common/worldgen/foliage/WorldGenCactus.java index 500a5ea..f14ef17 100755 --- a/common/src/common/worldgen/foliage/WorldGenCactus.java +++ b/common/src/common/worldgen/foliage/WorldGenCactus.java @@ -3,12 +3,12 @@ package common.worldgen.foliage; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenCactus extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 10; ++i) { diff --git a/common/src/common/worldgen/foliage/WorldGenDeadBush.java b/common/src/common/worldgen/foliage/WorldGenDeadBush.java index 6e7bb2d..5b84123 100755 --- a/common/src/common/worldgen/foliage/WorldGenDeadBush.java +++ b/common/src/common/worldgen/foliage/WorldGenDeadBush.java @@ -5,12 +5,12 @@ import common.init.Blocks; import common.material.Material; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenDeadBush extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { Block block; diff --git a/common/src/common/worldgen/foliage/WorldGenFlowers.java b/common/src/common/worldgen/foliage/WorldGenFlowers.java index 9adc8b2..f29cbb7 100755 --- a/common/src/common/worldgen/foliage/WorldGenFlowers.java +++ b/common/src/common/worldgen/foliage/WorldGenFlowers.java @@ -4,7 +4,7 @@ import common.block.BlockFlower; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenFlowers extends FeatureGenerator @@ -23,7 +23,7 @@ public class WorldGenFlowers extends FeatureGenerator this.field_175915_b = p_175914_1_.getState().withProperty(p_175914_1_.getTypeProperty(), p_175914_2_); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 64; ++i) { diff --git a/common/src/common/worldgen/foliage/WorldGenMelon.java b/common/src/common/worldgen/foliage/WorldGenMelon.java index fff25dc..7ae8427 100755 --- a/common/src/common/worldgen/foliage/WorldGenMelon.java +++ b/common/src/common/worldgen/foliage/WorldGenMelon.java @@ -3,12 +3,12 @@ package common.worldgen.foliage; import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenMelon extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 64; ++i) { diff --git a/common/src/common/worldgen/foliage/WorldGenMushroom.java b/common/src/common/worldgen/foliage/WorldGenMushroom.java index 00d38a8..f989bb2 100755 --- a/common/src/common/worldgen/foliage/WorldGenMushroom.java +++ b/common/src/common/worldgen/foliage/WorldGenMushroom.java @@ -3,7 +3,7 @@ package common.worldgen.foliage; import common.block.BlockBush; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenMushroom extends FeatureGenerator @@ -15,7 +15,7 @@ public class WorldGenMushroom extends FeatureGenerator this.field_175908_a = p_i45633_1_; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 64; ++i) { diff --git a/common/src/common/worldgen/foliage/WorldGenPumpkin.java b/common/src/common/worldgen/foliage/WorldGenPumpkin.java index 45f3daf..8a9c2e6 100755 --- a/common/src/common/worldgen/foliage/WorldGenPumpkin.java +++ b/common/src/common/worldgen/foliage/WorldGenPumpkin.java @@ -5,12 +5,12 @@ import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenPumpkin extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 64; ++i) { diff --git a/common/src/common/worldgen/foliage/WorldGenReed.java b/common/src/common/worldgen/foliage/WorldGenReed.java index f85469c..1c55cbd 100755 --- a/common/src/common/worldgen/foliage/WorldGenReed.java +++ b/common/src/common/worldgen/foliage/WorldGenReed.java @@ -4,12 +4,12 @@ import common.init.Blocks; import common.material.Material; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenReed extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 20; ++i) { diff --git a/common/src/common/worldgen/foliage/WorldGenShrub.java b/common/src/common/worldgen/foliage/WorldGenShrub.java index 00b7d71..860c885 100755 --- a/common/src/common/worldgen/foliage/WorldGenShrub.java +++ b/common/src/common/worldgen/foliage/WorldGenShrub.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.tree.WorldGenBaseTree; public class WorldGenShrub extends WorldGenBaseTree @@ -22,7 +22,7 @@ public class WorldGenShrub extends WorldGenBaseTree this.leavesMetadata = leaves.withProperty(BlockLeaves.DECAY, Boolean.valueOf(false)); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { Block block; diff --git a/common/src/common/worldgen/foliage/WorldGenTallGrass.java b/common/src/common/worldgen/foliage/WorldGenTallGrass.java index 52bf305..9adca0d 100755 --- a/common/src/common/worldgen/foliage/WorldGenTallGrass.java +++ b/common/src/common/worldgen/foliage/WorldGenTallGrass.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenTallGrass extends FeatureGenerator @@ -19,7 +19,7 @@ public class WorldGenTallGrass extends FeatureGenerator this.tallGrassState = Blocks.tallgrass.getState().withProperty(BlockTallGrass.TYPE, p_i45629_1_); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { Block block; diff --git a/common/src/common/worldgen/foliage/WorldGenVines.java b/common/src/common/worldgen/foliage/WorldGenVines.java index eaf09b1..dfeb2bd 100755 --- a/common/src/common/worldgen/foliage/WorldGenVines.java +++ b/common/src/common/worldgen/foliage/WorldGenVines.java @@ -6,12 +6,12 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenVines extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (; position.getY() < 128; position = position.up()) { diff --git a/common/src/common/worldgen/foliage/WorldGenWaterlily.java b/common/src/common/worldgen/foliage/WorldGenWaterlily.java index c7496c9..a60117b 100755 --- a/common/src/common/worldgen/foliage/WorldGenWaterlily.java +++ b/common/src/common/worldgen/foliage/WorldGenWaterlily.java @@ -5,12 +5,12 @@ import common.init.Blocks; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public class WorldGenWaterlily extends FeatureGenerator { - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { for (int i = 0; i < 10; ++i) { diff --git a/common/src/common/worldgen/tree/WorldGenBaseTree.java b/common/src/common/worldgen/tree/WorldGenBaseTree.java index e3653c9..83768cc 100755 --- a/common/src/common/worldgen/tree/WorldGenBaseTree.java +++ b/common/src/common/worldgen/tree/WorldGenBaseTree.java @@ -11,7 +11,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenBaseTree extends WorldGenTree { @@ -42,7 +42,7 @@ public class WorldGenBaseTree extends WorldGenTree this.vinesGrow = vines; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = rand.zrange(3) + this.minTreeHeight; boolean flag = true; @@ -233,17 +233,17 @@ public class WorldGenBaseTree extends WorldGenTree } } - private void func_181652_a(WorldServer p_181652_1_, int p_181652_2_, BlockPos p_181652_3_, Facing p_181652_4_) + private void func_181652_a(AWorldServer p_181652_1_, int p_181652_2_, BlockPos p_181652_3_, Facing p_181652_4_) { this.setBlockAndNotifyAdequately(p_181652_1_, p_181652_3_, Blocks.cocoa.getState().withProperty(BlockCocoa.AGE, p_181652_2_).withProperty(BlockCocoa.FACING, p_181652_4_)); } - private void func_181651_a(WorldServer p_181651_1_, BlockPos p_181651_2_, PropertyBool p_181651_3_) + private void func_181651_a(AWorldServer p_181651_1_, BlockPos p_181651_2_, PropertyBool p_181651_3_) { this.setBlockAndNotifyAdequately(p_181651_1_, p_181651_2_, Blocks.vine.getState().withProperty(p_181651_3_, Boolean.valueOf(true))); } - private void func_181650_b(WorldServer p_181650_1_, BlockPos p_181650_2_, PropertyBool p_181650_3_) + private void func_181650_b(AWorldServer p_181650_1_, BlockPos p_181650_2_, PropertyBool p_181650_3_) { this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); int i = 4; diff --git a/common/src/common/worldgen/tree/WorldGenBigTree.java b/common/src/common/worldgen/tree/WorldGenBigTree.java index 8f16b8a..91f5588 100755 --- a/common/src/common/worldgen/tree/WorldGenBigTree.java +++ b/common/src/common/worldgen/tree/WorldGenBigTree.java @@ -12,7 +12,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenBigTree extends WorldGenTree { @@ -20,7 +20,7 @@ public class WorldGenBigTree extends WorldGenTree private final State logBase; private Random rand; - private WorldServer world; + private AWorldServer world; private BlockPos basePos = BlockPos.ORIGIN; private int heightLimit; private int height; @@ -322,7 +322,7 @@ public class WorldGenBigTree extends WorldGenTree this.leafDistanceLimit = 5; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { this.world = worldIn; this.basePos = position; diff --git a/common/src/common/worldgen/tree/WorldGenBirch.java b/common/src/common/worldgen/tree/WorldGenBirch.java index 9c4cebb..eb4da07 100755 --- a/common/src/common/worldgen/tree/WorldGenBirch.java +++ b/common/src/common/worldgen/tree/WorldGenBirch.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenBirch extends WorldGenTree { @@ -23,7 +23,7 @@ public class WorldGenBirch extends WorldGenTree this.useExtraRandomHeight = extra; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = rand.zrange(3) + 5; diff --git a/common/src/common/worldgen/tree/WorldGenDarkOak.java b/common/src/common/worldgen/tree/WorldGenDarkOak.java index 75e40a9..27d5298 100755 --- a/common/src/common/worldgen/tree/WorldGenDarkOak.java +++ b/common/src/common/worldgen/tree/WorldGenDarkOak.java @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenDarkOak extends WorldGenTree { @@ -22,7 +22,7 @@ public class WorldGenDarkOak extends WorldGenTree super(notify); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = rand.zrange(3) + rand.zrange(2) + 6; int j = position.getX(); @@ -161,7 +161,7 @@ public class WorldGenDarkOak extends WorldGenTree } } - private boolean func_181638_a(WorldServer p_181638_1_, BlockPos p_181638_2_, int p_181638_3_) + private boolean func_181638_a(AWorldServer p_181638_1_, BlockPos p_181638_2_, int p_181638_3_) { int i = p_181638_2_.getX(); int j = p_181638_2_.getY(); @@ -197,7 +197,7 @@ public class WorldGenDarkOak extends WorldGenTree return true; } - private void func_181639_b(WorldServer p_181639_1_, BlockPos p_181639_2_) + private void func_181639_b(AWorldServer p_181639_1_, BlockPos p_181639_2_) { if (this.canBeReplaced(p_181639_1_.getState(p_181639_2_).getBlock())) { @@ -205,7 +205,7 @@ public class WorldGenDarkOak extends WorldGenTree } } - private void func_150526_a(WorldServer worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_) + private void func_150526_a(AWorldServer worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_) { BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_); Block block = worldIn.getState(blockpos).getBlock(); diff --git a/common/src/common/worldgen/tree/WorldGenHugeTree.java b/common/src/common/worldgen/tree/WorldGenHugeTree.java index 2830025..d13cdf6 100755 --- a/common/src/common/worldgen/tree/WorldGenHugeTree.java +++ b/common/src/common/worldgen/tree/WorldGenHugeTree.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public abstract class WorldGenHugeTree extends WorldGenTree { @@ -42,7 +42,7 @@ public abstract class WorldGenHugeTree extends WorldGenTree return i; } - private boolean func_175926_c(WorldServer worldIn, BlockPos p_175926_2_, int p_175926_3_) + private boolean func_175926_c(AWorldServer worldIn, BlockPos p_175926_2_, int p_175926_3_) { boolean flag = true; @@ -81,7 +81,7 @@ public abstract class WorldGenHugeTree extends WorldGenTree } } - private boolean func_175927_a(BlockPos p_175927_1_, WorldServer worldIn) + private boolean func_175927_a(BlockPos p_175927_1_, AWorldServer worldIn) { BlockPos blockpos = p_175927_1_.down(); Block block = worldIn.getState(blockpos).getBlock(); @@ -100,12 +100,12 @@ public abstract class WorldGenHugeTree extends WorldGenTree } } - protected boolean func_175929_a(WorldServer worldIn, Random p_175929_2_, BlockPos p_175929_3_, int p_175929_4_) + protected boolean func_175929_a(AWorldServer worldIn, Random p_175929_2_, BlockPos p_175929_3_, int p_175929_4_) { return this.func_175926_c(worldIn, p_175929_3_, p_175929_4_) && this.func_175927_a(p_175929_3_, worldIn); } - protected void func_175925_a(WorldServer worldIn, BlockPos p_175925_2_, int p_175925_3_) + protected void func_175925_a(AWorldServer worldIn, BlockPos p_175925_2_, int p_175925_3_) { int i = p_175925_3_ * p_175925_3_; @@ -130,7 +130,7 @@ public abstract class WorldGenHugeTree extends WorldGenTree } } - protected void func_175928_b(WorldServer worldIn, BlockPos p_175928_2_, int p_175928_3_) + protected void func_175928_b(AWorldServer worldIn, BlockPos p_175928_2_, int p_175928_3_) { int i = p_175928_3_ * p_175928_3_; diff --git a/common/src/common/worldgen/tree/WorldGenJungle.java b/common/src/common/worldgen/tree/WorldGenJungle.java index b034df5..cd68e7a 100755 --- a/common/src/common/worldgen/tree/WorldGenJungle.java +++ b/common/src/common/worldgen/tree/WorldGenJungle.java @@ -7,7 +7,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenJungle extends WorldGenHugeTree { @@ -16,7 +16,7 @@ public class WorldGenJungle extends WorldGenHugeTree super(p_i46448_1_, p_i46448_2_, p_i46448_3_, p_i46448_4_, p_i46448_5_); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = this.func_150533_a(rand); @@ -113,7 +113,7 @@ public class WorldGenJungle extends WorldGenHugeTree } } - private void func_181632_a(WorldServer p_181632_1_, Random p_181632_2_, BlockPos p_181632_3_, PropertyBool p_181632_4_) + private void func_181632_a(AWorldServer p_181632_1_, Random p_181632_2_, BlockPos p_181632_3_, PropertyBool p_181632_4_) { if (p_181632_2_.zrange(3) > 0 && p_181632_1_.isAirBlock(p_181632_3_)) { @@ -121,7 +121,7 @@ public class WorldGenJungle extends WorldGenHugeTree } } - private void func_175930_c(WorldServer worldIn, BlockPos p_175930_2_, int p_175930_3_) + private void func_175930_c(AWorldServer worldIn, BlockPos p_175930_2_, int p_175930_3_) { int i = 2; diff --git a/common/src/common/worldgen/tree/WorldGenPine.java b/common/src/common/worldgen/tree/WorldGenPine.java index 84552a5..b4ffb5c 100755 --- a/common/src/common/worldgen/tree/WorldGenPine.java +++ b/common/src/common/worldgen/tree/WorldGenPine.java @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenPine extends WorldGenHugeTree { @@ -23,7 +23,7 @@ public class WorldGenPine extends WorldGenHugeTree this.useBaseHeight = p_i45457_2_; } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = this.func_150533_a(rand); @@ -73,7 +73,7 @@ public class WorldGenPine extends WorldGenHugeTree } } - private void func_150541_c(WorldServer worldIn, int p_150541_2_, int p_150541_3_, int p_150541_4_, int p_150541_5_, Random p_150541_6_) + private void func_150541_c(AWorldServer worldIn, int p_150541_2_, int p_150541_3_, int p_150541_4_, int p_150541_5_, Random p_150541_6_) { int i = p_150541_6_.zrange(5) + (this.useBaseHeight ? this.baseHeight : 3); int j = 0; @@ -87,7 +87,7 @@ public class WorldGenPine extends WorldGenHugeTree } } - public void finish(WorldServer worldIn, Random p_180711_2_, BlockPos p_180711_3_) + public void finish(AWorldServer worldIn, Random p_180711_2_, BlockPos p_180711_3_) { this.func_175933_b(worldIn, p_180711_3_.west().north()); this.func_175933_b(worldIn, p_180711_3_.east(2).north()); @@ -107,7 +107,7 @@ public class WorldGenPine extends WorldGenHugeTree } } - private void func_175933_b(WorldServer worldIn, BlockPos p_175933_2_) + private void func_175933_b(AWorldServer worldIn, BlockPos p_175933_2_) { for (int i = -2; i <= 2; ++i) { @@ -121,7 +121,7 @@ public class WorldGenPine extends WorldGenHugeTree } } - private void func_175934_c(WorldServer worldIn, BlockPos p_175934_2_) + private void func_175934_c(AWorldServer worldIn, BlockPos p_175934_2_) { for (int i = 2; i >= -3; --i) { diff --git a/common/src/common/worldgen/tree/WorldGenSavanna.java b/common/src/common/worldgen/tree/WorldGenSavanna.java index 068b0d7..c9f37cd 100755 --- a/common/src/common/worldgen/tree/WorldGenSavanna.java +++ b/common/src/common/worldgen/tree/WorldGenSavanna.java @@ -8,7 +8,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenSavanna extends WorldGenTree { @@ -23,7 +23,7 @@ public class WorldGenSavanna extends WorldGenTree super(p_i45463_1_); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = rand.zrange(3) + rand.zrange(3) + 5; boolean flag = true; @@ -202,12 +202,12 @@ public class WorldGenSavanna extends WorldGenTree } } - private void func_181642_b(WorldServer p_181642_1_, BlockPos p_181642_2_) + private void func_181642_b(AWorldServer p_181642_1_, BlockPos p_181642_2_) { this.setBlockAndNotifyAdequately(p_181642_1_, p_181642_2_, field_181643_a); } - private void func_175924_b(WorldServer worldIn, BlockPos p_175924_2_) + private void func_175924_b(AWorldServer worldIn, BlockPos p_175924_2_) { Material material = worldIn.getState(p_175924_2_).getBlock().getMaterial(); diff --git a/common/src/common/worldgen/tree/WorldGenSwamp.java b/common/src/common/worldgen/tree/WorldGenSwamp.java index cb4ebcb..ea77f4c 100755 --- a/common/src/common/worldgen/tree/WorldGenSwamp.java +++ b/common/src/common/worldgen/tree/WorldGenSwamp.java @@ -9,7 +9,7 @@ import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenSwamp extends WorldGenTree { @@ -24,7 +24,7 @@ public class WorldGenSwamp extends WorldGenTree super(false); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i; @@ -186,7 +186,7 @@ public class WorldGenSwamp extends WorldGenTree } } - private void func_181647_a(WorldServer p_181647_1_, BlockPos p_181647_2_, PropertyBool p_181647_3_) + private void func_181647_a(AWorldServer p_181647_1_, BlockPos p_181647_2_, PropertyBool p_181647_3_) { State iblockstate = Blocks.vine.getState().withProperty(p_181647_3_, Boolean.valueOf(true)); this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate); diff --git a/common/src/common/worldgen/tree/WorldGenTaiga1.java b/common/src/common/worldgen/tree/WorldGenTaiga1.java index f940439..c9a2b45 100755 --- a/common/src/common/worldgen/tree/WorldGenTaiga1.java +++ b/common/src/common/worldgen/tree/WorldGenTaiga1.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenTaiga1 extends WorldGenTree { @@ -22,7 +22,7 @@ public class WorldGenTaiga1 extends WorldGenTree super(false); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = rand.zrange(5) + 7; int j = i - rand.zrange(2) - 3; diff --git a/common/src/common/worldgen/tree/WorldGenTaiga2.java b/common/src/common/worldgen/tree/WorldGenTaiga2.java index 014bda7..10f3ec1 100755 --- a/common/src/common/worldgen/tree/WorldGenTaiga2.java +++ b/common/src/common/worldgen/tree/WorldGenTaiga2.java @@ -7,7 +7,7 @@ import common.material.Material; import common.rng.Random; import common.util.BlockPos; import common.world.State; -import common.world.WorldServer; +import common.world.AWorldServer; public class WorldGenTaiga2 extends WorldGenTree { @@ -22,7 +22,7 @@ public class WorldGenTaiga2 extends WorldGenTree super(p_i2025_1_); } - public boolean generate(WorldServer worldIn, Random rand, BlockPos position) + public boolean generate(AWorldServer worldIn, Random rand, BlockPos position) { int i = rand.zrange(4) + 6; int j = 1 + rand.zrange(2); diff --git a/common/src/common/worldgen/tree/WorldGenTree.java b/common/src/common/worldgen/tree/WorldGenTree.java index 82bf0fc..4ea8b65 100755 --- a/common/src/common/worldgen/tree/WorldGenTree.java +++ b/common/src/common/worldgen/tree/WorldGenTree.java @@ -7,7 +7,7 @@ import common.init.Blocks; import common.material.Material; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import common.world.AWorldServer; import common.worldgen.FeatureGenerator; public abstract class WorldGenTree extends FeatureGenerator @@ -27,11 +27,11 @@ public abstract class WorldGenTree extends FeatureGenerator { } - public void finish(WorldServer worldIn, Random random, BlockPos pos) + public void finish(AWorldServer worldIn, Random random, BlockPos pos) { } - protected void setBaseBlock(WorldServer worldIn, BlockPos pos) + protected void setBaseBlock(AWorldServer worldIn, BlockPos pos) { if (worldIn.getState(pos) != worldIn.dimension.getTop()) { diff --git a/server/src/server/Server.java b/server/src/server/Server.java index 52675ce..8cd6b84 100755 --- a/server/src/server/Server.java +++ b/server/src/server/Server.java @@ -20,7 +20,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.concurrent.FutureTask; -import common.IServer; import common.collect.Lists; import common.collect.Maps; import common.color.TextColor; @@ -73,9 +72,7 @@ import common.util.Position; import common.util.Tuple; import common.util.Util; import common.util.WorldPos; -import common.world.Region; import common.world.World; -import common.world.WorldServer; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelException; @@ -94,8 +91,10 @@ import server.command.FixedExecutor; import server.network.HandshakeHandler; import server.network.Player; import server.world.Converter; +import server.world.Region; +import server.world.WorldServer; -public final class Server implements IThreadListener, IServer { +public final class Server implements IThreadListener { private static final LazyLoadBase SERVER_NIO_EVENTLOOP = new LazyLoadBase() { protected NioEventLoopGroup load() { return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Server IO #%d").setDaemon(true).build()); @@ -144,7 +143,7 @@ public final class Server implements IThreadListener, IServer { Util.checkOs(); Registry.setup("Server thread"); boolean debug = System.getProperty("server.debug", null) != null; - boolean ipc = debug || System.getProperty("server.pipe", null) != null; + boolean ipc = System.getProperty("server.pipe", null) != null; int port = Integer.parseInt(System.getProperty("server.port", "" + Config.PORT)); final Server server = new Server(debug, ipc); Registry.addShutdownHook(new Runnable() { @@ -192,7 +191,7 @@ public final class Server implements IThreadListener, IServer { NBTTagCompound tag = NBTLoader.readGZip(file); NBTTagCompound cfg = tag.getCompoundTag("Config"); for(String key : cfg.getKeySet()) { - Config.set(key, cfg.getString(key), null); + Config.set(key, cfg.getString(key), false); } UniverseRegistry.loadNbt(tag.getCompoundTag("Universe")); long lastPlayed = tag.getLong("LastAccess"); @@ -217,6 +216,21 @@ public final class Server implements IThreadListener, IServer { private Server(boolean debug, boolean ipc) { this.debug = debug; this.ipcpipe = ipc; + Config.setCallback(new Runnable() { + public void run() { + for(WorldServer world : Server.this.getWorlds()) { + world.updatePhysics(); + } + Server.this.sendPacket(new SPacketWorld(WorldServer.clampGravity(), Config.dayCycle, Config.timeFlow)); + } + }, "daylightCycle", "timeFlow", "gravity"); + Config.setCallback(new Runnable() { + public void run() { + for(WorldServer world : Server.this.getWorlds()) { + world.updateViewRadius(); + } + } + }, "viewDistance"); } public CommandEnvironment getScriptEnvironment() { @@ -353,10 +367,10 @@ public final class Server implements IThreadListener, IServer { else { Config.clear(); UniverseRegistry.clear(); - Config.set("daylightCycle", "false", null); - Config.set("weatherChanges", "false", null); - Config.set("mobSpawning", "false", null); - Config.set("spawnRadius", "0", null); + Config.set("daylightCycle", "false", false); + Config.set("weatherChanges", "false", false); + Config.set("mobSpawning", "false", false); + Config.set("spawnRadius", "0", false); this.worlds.add(this.space = new WorldServer(this, World.START_TIME, Space.INSTANCE, true)); this.dimensions.put(this.space.dimension.getDimensionId(), this.space); @@ -565,7 +579,7 @@ public final class Server implements IThreadListener, IServer { } this.networkTick(); if(++this.pingTimer > 600) { - this.sendPacket(new S38PacketPlayerListItem(this.getIPlayers())); + this.sendPacket(new S38PacketPlayerListItem((List)this.getPlayers())); this.pingTimer = 0; } if(Config.saveInterval > 0 && ++this.saveTimer >= Config.saveInterval) { @@ -653,10 +667,6 @@ public final class Server implements IThreadListener, IServer { return this.players; } - public List getIPlayers() { - return (List)this.players; - } - public Player getPlayer(String user) { return this.usermap.get(user); } @@ -676,7 +686,7 @@ public final class Server implements IThreadListener, IServer { public void setVar(String cv, String value) { this.schedule(new Runnable() { public void run() { - Config.set(cv, value, Server.this); + Config.set(cv, value, true); } }); } @@ -773,7 +783,7 @@ public final class Server implements IThreadListener, IServer { } }); } - connection.sendPacket(new RPacketLoginSuccess()); + connection.sendPacket(new RPacketLoginSuccess(this.debug)); connection.setNetHandler(conn); this.players.add(conn); this.usermap.put(loginUser, conn); @@ -827,7 +837,7 @@ public final class Server implements IThreadListener, IServer { EntityNPC player = conn.getEntity(); player.unmount(); this.writePlayer(conn); - WorldServer world = player.getServerWorld(); + WorldServer world = (WorldServer)player.getServerWorld(); world.removeEntity(player); world.removePlayer(player); this.players.remove(conn); @@ -836,7 +846,7 @@ public final class Server implements IThreadListener, IServer { } private void preparePlayer(EntityNPC player, WorldServer oldWorld) { - WorldServer newWorld = player.getServerWorld(); + WorldServer newWorld = (WorldServer)player.getServerWorld(); if(oldWorld != null) { oldWorld.removePlayer(player); } @@ -1000,7 +1010,7 @@ public final class Server implements IThreadListener, IServer { } public void transferToDimension(EntityNPC player, int dimension, BlockPos pos, float yaw, float pitch, PortalType portal) { - WorldServer oldWorld = player.getServerWorld(); // this.getWorld(player.dimension); + WorldServer oldWorld = (WorldServer)player.getServerWorld(); // this.getWorld(player.dimension); // player.dimension = dimension; WorldServer newWorld = this.getWorld(dimension); player.connection.sendPacket(new SPacketRespawn(newWorld.dimension, EntityRegistry.getEntityID(player), player.connection.isInEditor())); diff --git a/common/src/common/clipboard/ClipboardPlacer.java b/server/src/server/clipboard/ClipboardPlacer.java similarity index 98% rename from common/src/common/clipboard/ClipboardPlacer.java rename to server/src/server/clipboard/ClipboardPlacer.java index b2dc5a7..a6e93e5 100755 --- a/common/src/common/clipboard/ClipboardPlacer.java +++ b/server/src/server/clipboard/ClipboardPlacer.java @@ -1,4 +1,4 @@ -package common.clipboard; +package server.clipboard; import java.util.Deque; import java.util.HashMap; @@ -12,6 +12,7 @@ import common.block.Block; import common.block.BlockDoor; import common.block.BlockRailBase; import common.block.ITileEntityProvider; +import common.clipboard.ClipboardBlock; import common.collect.Lists; import common.init.Blocks; import common.init.ReorderRegistry; @@ -19,7 +20,7 @@ import common.inventory.IInventory; import common.tileentity.TileEntity; import common.util.BlockPos; import common.util.Vec3i; -import common.world.WorldServer; +import server.world.WorldServer; public class ClipboardPlacer { private static class BlockEntry { diff --git a/server/src/server/command/EntityListParser.java b/server/src/server/command/EntityListParser.java index c62aeaf..130ebbb 100644 --- a/server/src/server/command/EntityListParser.java +++ b/server/src/server/command/EntityListParser.java @@ -11,8 +11,8 @@ import common.entity.Entity; import common.entity.EntityType; import common.entity.types.EntityLiving; import common.init.EntityRegistry; -import common.world.WorldServer; import server.network.Player; +import server.world.WorldServer; public class EntityListParser extends EntityParser { public EntityListParser(String name, boolean useSender, boolean livingOnly) { diff --git a/server/src/server/command/EntityParser.java b/server/src/server/command/EntityParser.java index 3b5ff7a..09a88dd 100644 --- a/server/src/server/command/EntityParser.java +++ b/server/src/server/command/EntityParser.java @@ -6,7 +6,7 @@ import java.util.List; import common.collect.Lists; import common.entity.Entity; import common.entity.types.EntityLiving; -import common.world.WorldServer; +import server.world.WorldServer; public class EntityParser extends PlayerEntityParser { protected final boolean livingOnly; diff --git a/server/src/server/command/WorldParser.java b/server/src/server/command/WorldParser.java index 87c9d43..c76e27c 100644 --- a/server/src/server/command/WorldParser.java +++ b/server/src/server/command/WorldParser.java @@ -5,7 +5,7 @@ import java.util.List; import common.collect.Lists; import common.dimension.Dimension; -import common.world.WorldServer; +import server.world.WorldServer; public class WorldParser extends DimensionParser { private final boolean loadedOnly; diff --git a/server/src/server/command/commands/CommandSpawn.java b/server/src/server/command/commands/CommandSpawn.java index 2534793..053ff75 100644 --- a/server/src/server/command/commands/CommandSpawn.java +++ b/server/src/server/command/commands/CommandSpawn.java @@ -11,12 +11,12 @@ import common.init.EntityRegistry; import common.nbt.NBTTagCompound; import common.util.Util; import common.util.Vec3; -import common.world.WorldServer; import server.command.Command; import server.command.CommandEnvironment; import server.command.Executor; import server.command.RunException; import server.network.Player; +import server.world.WorldServer; public class CommandSpawn extends Command { public CommandSpawn() { diff --git a/server/src/server/command/commands/CommandTime.java b/server/src/server/command/commands/CommandTime.java index 1f3561f..97f59d2 100644 --- a/server/src/server/command/commands/CommandTime.java +++ b/server/src/server/command/commands/CommandTime.java @@ -3,11 +3,11 @@ package server.command.commands; import common.dimension.Dimension; import common.item.ItemSpaceNavigator; import common.util.Position; -import common.world.WorldServer; import server.command.Command; import server.command.CommandEnvironment; import server.command.Executor; import server.command.RunException; +import server.world.WorldServer; public class CommandTime extends Command { public CommandTime() { diff --git a/server/src/server/command/commands/CommandWeather.java b/server/src/server/command/commands/CommandWeather.java index ea62180..2a45a62 100644 --- a/server/src/server/command/commands/CommandWeather.java +++ b/server/src/server/command/commands/CommandWeather.java @@ -1,11 +1,11 @@ package server.command.commands; import common.world.Weather; -import common.world.WorldServer; import server.command.Command; import server.command.CommandEnvironment; import server.command.Executor; import server.command.RunException; +import server.world.WorldServer; public class CommandWeather extends Command { public CommandWeather() { diff --git a/server/src/server/command/commands/CommandWorld.java b/server/src/server/command/commands/CommandWorld.java index 6257e46..5ce211c 100644 --- a/server/src/server/command/commands/CommandWorld.java +++ b/server/src/server/command/commands/CommandWorld.java @@ -4,10 +4,10 @@ import java.util.List; import common.entity.Entity; import common.util.BlockPos; -import common.world.WorldServer; import server.command.Command; import server.command.CommandEnvironment; import server.command.Executor; +import server.world.WorldServer; public class CommandWorld extends Command { public CommandWorld() { diff --git a/server/src/server/network/Player.java b/server/src/server/network/Player.java index 6a418d3..97c6f93 100755 --- a/server/src/server/network/Player.java +++ b/server/src/server/network/Player.java @@ -14,7 +14,6 @@ import common.block.BlockFenceGate; import common.block.BlockWall; import common.clipboard.BlockTransform; import common.clipboard.ClipboardBlock; -import common.clipboard.ClipboardPlacer; import common.clipboard.Rotation; import common.clipboard.RotationValue; import common.clipboard.Vector; @@ -126,14 +125,15 @@ import common.util.Vec3i; import common.util.WorldPos; import common.village.MerchantRecipeList; import common.world.Chunk; -import common.world.Region; import common.world.State; import common.world.World; -import common.world.WorldServer; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import server.Server; +import server.clipboard.ClipboardPlacer; import server.command.Executor; +import server.world.Region; +import server.world.WorldServer; public class Player extends NetHandler implements ICrafting, Executor, IPlayer { @@ -580,6 +580,10 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer this.sendPacket(new SPacketMessage(String.format(format, args), Type.HOTBAR)); } + private WorldServer getEntityWorld() { + return (WorldServer)this.entity.getServerWorld(); + } + public void sendPickupMessage(Entity entity, int amount) { if(entity instanceof EntityItem) if(amount == 1) @@ -1363,7 +1367,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer int ny = this.clipboard[0].length; int nz = this.clipboard[0][0].length; BlockPos to = this.entity.getPosition(); - ClipboardPlacer placer = new ClipboardPlacer(this.entity.getServerWorld()); + ClipboardPlacer placer = new ClipboardPlacer((WorldServer)this.entity.getServerWorld()); BlockTransform transform = null; if(this.rotation != 0 || this.flipX || this.flipZ) { transform = new BlockTransform(); @@ -1448,7 +1452,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer if(this.selectionDim == Integer.MIN_VALUE || this.selectionDim != this.entity.worldObj.dimension.getDimensionId() || this.selPos1 == null || this.selPos2 == null) return false; - WorldServer source = this.entity.getServerWorld(); + WorldServer source = this.getEntityWorld(); int mx = Math.min(this.selPos1.getX(), this.selPos2.getX()); int my = Math.min(this.selPos1.getY(), this.selPos2.getY()); int mz = Math.min(this.selPos1.getZ(), this.selPos2.getZ()); @@ -1749,7 +1753,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer return true; } } - Config.set(args[0], value, this.server); + Config.set(args[0], value, true); this.addConsole(TextColor.YELLOW + "%s" + TextColor.GRAY + " -> " + ((cv.type == ValueType.BOOLEAN ? (cv.getValue().equals("true") ? TextColor.GREEN : TextColor.RED) : (cv.type == ValueType.STRING ? TextColor.NEON : TextColor.BLUE))) + "%s", args[0], cv.type == ValueType.STRING ? ("'" + cv.getValue() + "'") : cv.getValue()); } return true; @@ -2071,7 +2075,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer } else { - WorldServer worldserver = this.entity.getServerWorld(); // this.serverController.getWorld(this.playerEntity.dimension); + WorldServer worldserver = this.getEntityWorld(); // this.serverController.getWorld(this.playerEntity.dimension); // this.updated = true; double d0 = this.entity.posX; @@ -2308,7 +2312,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer NetHandler.checkThread(packetIn, this, this.server); if(this.charEditor) return; - WorldServer worldserver = this.entity.getServerWorld(); // this.serverController.getWorld(this.playerEntity.dimension); + WorldServer worldserver = this.getEntityWorld(); // this.serverController.getWorld(this.playerEntity.dimension); BlockPos blockpos = packetIn.getPosition(); switch (packetIn.getStatus()) @@ -2394,7 +2398,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer NetHandler.checkThread(packetIn, this, this.server); if(this.charEditor) return; - WorldServer worldserver = this.entity.getServerWorld(); // this.serverController.getWorld(this.playerEntity.dimension); + WorldServer worldserver = this.getEntityWorld(); // this.serverController.getWorld(this.playerEntity.dimension); ItemStack itemstack = this.entity.inventory.getCurrentItem(); boolean flag = false; BlockPos blockpos = packetIn.getPosition(); @@ -2461,7 +2465,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer private void useEntity(int entityId, boolean interact) { - WorldServer worldserver = this.entity.getServerWorld(); // this.serverController.getWorld(this.playerEntity.dimension); + WorldServer worldserver = this.getEntityWorld(); // this.serverController.getWorld(this.playerEntity.dimension); Entity entity = worldserver.getEntityByID(entityId); if (entity != null) { @@ -3041,7 +3045,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer if(this.charEditor) return; - WorldServer worldserver = this.entity.getServerWorld(); // this.serverController.getWorld(this.playerEntity.dimension); + WorldServer worldserver = this.getEntityWorld(); // this.serverController.getWorld(this.playerEntity.dimension); BlockPos blockpos = packetIn.getPosition(); if (worldserver.isBlockLoaded(blockpos)) diff --git a/common/src/common/village/VillageCollection.java b/server/src/server/village/VillageCollection.java similarity index 98% rename from common/src/common/village/VillageCollection.java rename to server/src/server/village/VillageCollection.java index ecc2d9f..53ad125 100755 --- a/common/src/common/village/VillageCollection.java +++ b/server/src/server/village/VillageCollection.java @@ -1,4 +1,4 @@ -package common.village; +package server.village; import java.util.Iterator; import java.util.List; @@ -11,7 +11,9 @@ import common.nbt.NBTTagCompound; import common.nbt.NBTTagList; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; +import common.village.Village; +import common.village.VillageDoorInfo; +import server.world.WorldServer; public class VillageCollection { diff --git a/server/src/server/world/Converter.java b/server/src/server/world/Converter.java index 5bc9269..34001e7 100644 --- a/server/src/server/world/Converter.java +++ b/server/src/server/world/Converter.java @@ -86,7 +86,6 @@ import common.tileentity.TileEntitySign; import common.tileentity.TileEntitySkull; import common.util.Facing; import common.util.NibbleArray; -import common.world.Region; import common.world.State; import common.world.Weather; import common.world.World; @@ -1148,7 +1147,7 @@ public abstract class Converter { NBTTagCompound rules = nbt.getCompoundTag("GameRules"); for(Entry rule : OLD_GAMERULES.entrySet()) { if(rules.hasKey(rule.getKey(), 8)) - Config.set(rule.getValue(), rules.getString(rule.getKey()), null); + Config.set(rule.getValue(), rules.getString(rule.getKey()), false); } } Log.JNI.info("Speichere neue server.nbt ..."); diff --git a/common/src/common/world/Region.java b/server/src/server/world/Region.java similarity index 99% rename from common/src/common/world/Region.java rename to server/src/server/world/Region.java index ea0a6ae..fcf1367 100755 --- a/common/src/common/world/Region.java +++ b/server/src/server/world/Region.java @@ -1,4 +1,4 @@ -package common.world; +package server.world; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -32,6 +32,8 @@ import common.util.BlockPos; import common.util.NextTickListEntry; import common.util.NibbleArray; import common.util.Util; +import common.world.BlockArray; +import common.world.Chunk; public class Region { private static class ChunkBuffer extends ByteArrayOutputStream { diff --git a/common/src/common/world/Spawner.java b/server/src/server/world/Spawner.java similarity index 98% rename from common/src/common/world/Spawner.java rename to server/src/server/world/Spawner.java index b4a5468..5a4255b 100755 --- a/common/src/common/world/Spawner.java +++ b/server/src/server/world/Spawner.java @@ -1,4 +1,4 @@ -package common.world; +package server.world; import java.util.Set; @@ -16,6 +16,8 @@ import common.rng.WeightedList; import common.util.BlockPos; import common.util.ChunkPos; import common.util.ExtMath; +import common.world.Chunk; +import common.world.World; public abstract class Spawner { private static final int MOB_COUNT_DIV = (int)Math.pow(17.0D, 2.0D); diff --git a/common/src/common/world/WorldServer.java b/server/src/server/world/WorldServer.java similarity index 98% rename from common/src/common/world/WorldServer.java rename to server/src/server/world/WorldServer.java index 934b9ee..494458d 100755 --- a/common/src/common/world/WorldServer.java +++ b/server/src/server/world/WorldServer.java @@ -1,4 +1,4 @@ -package common.world; +package server.world; import java.io.File; import java.io.FileFilter; @@ -13,7 +13,6 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; -import common.IServer; import common.biome.Biome; import common.biome.RngSpawn; import common.block.Block; @@ -75,7 +74,14 @@ import common.util.PortalType; import common.util.Position; import common.util.Vec3; import common.village.Village; -import common.village.VillageCollection; +import common.world.BlockArray; +import common.world.Chunk; +import common.world.Explosion; +import common.world.AWorldServer; +import common.world.LightType; +import common.world.State; +import common.world.Weather; +import common.world.World; import common.worldgen.BiomeGenSingle; import common.worldgen.BiomeGenerator; import common.worldgen.BlockReplacer; @@ -91,16 +97,19 @@ import common.worldgen.LootConstants; import common.worldgen.caves.MapGenBigCaves; import common.worldgen.caves.MapGenCaves; import common.worldgen.caves.MapGenRavine; -import common.worldgen.structure.MapGenBridge; -import common.worldgen.structure.MapGenMineshaft; -import common.worldgen.structure.MapGenScatteredFeature; -import common.worldgen.structure.MapGenStronghold; -import common.worldgen.structure.MapGenVillage; +import server.Server; +import server.network.Player; +import server.village.VillageCollection; +import server.worldgen.structure.MapGenBridge; +import server.worldgen.structure.MapGenMineshaft; +import server.worldgen.structure.MapGenScatteredFeature; +import server.worldgen.structure.MapGenStronghold; +import server.worldgen.structure.MapGenVillage; -public final class WorldServer extends World { +public final class WorldServer extends AWorldServer { private static final int[][] XZ_DIRS = new int[][] {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; - private final IServer server; + private final Server server; private final File chunkDir; private final Random grng; private final Set ticks = Sets.newHashSet(); @@ -162,9 +171,13 @@ public final class WorldServer extends World { private int updateLCG = this.rand.intv(); private long prevUpdate; private long time; + + public static float clampGravity() { + return ExtMath.clampf(Config.gravity, -10.0f, 10.0f); + } - public WorldServer(IServer server, long dtime, Dimension dim, boolean debug) { - super(dim, false, debug); + public WorldServer(Server server, long dtime, Dimension dim, boolean debug) { + super(dim, debug); this.server = server; // this.time = time; this.daytime = dtime; @@ -366,11 +379,7 @@ public final class WorldServer extends World { } } - public static float clampGravity() { - return ExtMath.clampf(Config.gravity, -10.0f, 10.0f); - } - - public IServer getServer() { + public Server getServer() { return this.server; } @@ -1632,7 +1641,7 @@ public final class WorldServer extends World { this.dungeons = null; } - public static String getLoadedInfo(IServer server) { + public static String getLoadedInfo(Server server) { int chunks = 0; int entities = 0; int tiles = 0; @@ -1698,7 +1707,7 @@ public final class WorldServer extends World { public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) { - for (IPlayer conn : this.server.getIPlayers()) + for (Player conn : this.server.getPlayers()) { EntityNPC player = conn.getPresentEntity(); if (player != null && player.worldObj == this && player.getId() != breakerId) @@ -2643,6 +2652,18 @@ public final class WorldServer extends World { // return true; } + public List getAllPlayers() { + return (List)this.server.getPlayers(); + } + + public void placeInDimension(Entity entity, AWorldServer oldWorld, AWorldServer world, BlockPos pos, PortalType portal) { + this.server.placeInDimension(entity, (WorldServer)oldWorld, (WorldServer)world, pos, portal); + } + + public AWorldServer getOtherWorld(int dimension) { + return this.server.getWorld(dimension); + } + private static class EventList extends ArrayList { private EventList() { } diff --git a/common/src/common/worldgen/structure/MapGenBridge.java b/server/src/server/worldgen/structure/MapGenBridge.java similarity index 96% rename from common/src/common/worldgen/structure/MapGenBridge.java rename to server/src/server/worldgen/structure/MapGenBridge.java index 3a428b4..0a998ba 100755 --- a/common/src/common/worldgen/structure/MapGenBridge.java +++ b/server/src/server/worldgen/structure/MapGenBridge.java @@ -1,9 +1,9 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.List; import common.rng.Random; -import common.world.WorldServer; +import server.world.WorldServer; public class MapGenBridge extends MapGenStructure { diff --git a/common/src/common/worldgen/structure/MapGenMineshaft.java b/server/src/server/worldgen/structure/MapGenMineshaft.java similarity index 96% rename from common/src/common/worldgen/structure/MapGenMineshaft.java rename to server/src/server/worldgen/structure/MapGenMineshaft.java index e464c18..2fee1e7 100755 --- a/common/src/common/worldgen/structure/MapGenMineshaft.java +++ b/server/src/server/worldgen/structure/MapGenMineshaft.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; public class MapGenMineshaft extends MapGenStructure { diff --git a/common/src/common/worldgen/structure/MapGenScatteredFeature.java b/server/src/server/worldgen/structure/MapGenScatteredFeature.java similarity index 98% rename from common/src/common/worldgen/structure/MapGenScatteredFeature.java rename to server/src/server/worldgen/structure/MapGenScatteredFeature.java index 8de6711..e8caba9 100755 --- a/common/src/common/worldgen/structure/MapGenScatteredFeature.java +++ b/server/src/server/worldgen/structure/MapGenScatteredFeature.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.Arrays; import java.util.List; @@ -6,7 +6,7 @@ import java.util.List; import common.biome.Biome; import common.rng.Random; import common.util.BlockPos; -import common.world.WorldServer; +import server.world.WorldServer; public class MapGenScatteredFeature extends MapGenStructure { diff --git a/common/src/common/worldgen/structure/MapGenStronghold.java b/server/src/server/worldgen/structure/MapGenStronghold.java similarity index 98% rename from common/src/common/worldgen/structure/MapGenStronghold.java rename to server/src/server/worldgen/structure/MapGenStronghold.java index 10d7f64..cefc2f3 100755 --- a/common/src/common/worldgen/structure/MapGenStronghold.java +++ b/server/src/server/worldgen/structure/MapGenStronghold.java @@ -1,9 +1,9 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.List; import common.rng.Random; -import common.world.WorldServer; +import server.world.WorldServer; public class MapGenStronghold extends MapGenStructure { diff --git a/common/src/common/worldgen/structure/MapGenStructure.java b/server/src/server/worldgen/structure/MapGenStructure.java similarity index 95% rename from common/src/common/worldgen/structure/MapGenStructure.java rename to server/src/server/worldgen/structure/MapGenStructure.java index d339850..82aca60 100755 --- a/common/src/common/worldgen/structure/MapGenStructure.java +++ b/server/src/server/worldgen/structure/MapGenStructure.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.Iterator; import java.util.Map; @@ -10,16 +10,24 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ChunkPos; import common.util.LongHashMap; +import common.world.AWorldServer; import common.world.World; -import common.world.WorldServer; -import common.world.WorldServer.WorldSavedData; import common.worldgen.ChunkPrimer; import common.worldgen.caves.MapGenBase; +import server.world.WorldServer; +import server.world.WorldServer.WorldSavedData; public abstract class MapGenStructure extends MapGenBase { private WorldSavedData structureData; protected Map structureMap = Maps.newHashMap(); + protected WorldServer worldObj; + + public void generate(AWorldServer worldIn, int x, int z, ChunkPrimer chunkPrimerIn) + { + this.worldObj = (WorldServer)worldIn; + super.generate(worldIn, x, z, chunkPrimerIn); + } public abstract String getStructureName(); diff --git a/common/src/common/worldgen/structure/MapGenStructureIO.java b/server/src/server/worldgen/structure/MapGenStructureIO.java similarity index 98% rename from common/src/common/worldgen/structure/MapGenStructureIO.java rename to server/src/server/worldgen/structure/MapGenStructureIO.java index 2556af7..7418618 100755 --- a/common/src/common/worldgen/structure/MapGenStructureIO.java +++ b/server/src/server/worldgen/structure/MapGenStructureIO.java @@ -1,11 +1,11 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.Map; import common.collect.Maps; import common.log.Log; import common.nbt.NBTTagCompound; -import common.world.WorldServer; +import server.world.WorldServer; public class MapGenStructureIO { diff --git a/common/src/common/worldgen/structure/MapGenVillage.java b/server/src/server/worldgen/structure/MapGenVillage.java similarity index 98% rename from common/src/common/worldgen/structure/MapGenVillage.java rename to server/src/server/worldgen/structure/MapGenVillage.java index b907379..e6119f8 100755 --- a/common/src/common/worldgen/structure/MapGenVillage.java +++ b/server/src/server/worldgen/structure/MapGenVillage.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.List; import java.util.Set; @@ -7,7 +7,7 @@ import common.biome.Biome; import common.collect.Sets; import common.nbt.NBTTagCompound; import common.rng.Random; -import common.world.WorldServer; +import server.world.WorldServer; public class MapGenVillage extends MapGenStructure { diff --git a/common/src/common/worldgen/structure/StructureBoundingBox.java b/server/src/server/worldgen/structure/StructureBoundingBox.java similarity index 99% rename from common/src/common/worldgen/structure/StructureBoundingBox.java rename to server/src/server/worldgen/structure/StructureBoundingBox.java index 482873c..70ddf56 100755 --- a/common/src/common/worldgen/structure/StructureBoundingBox.java +++ b/server/src/server/worldgen/structure/StructureBoundingBox.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import common.nbt.NBTTagIntArray; import common.util.BlockPos; diff --git a/common/src/common/worldgen/structure/StructureBridge.java b/server/src/server/worldgen/structure/StructureBridge.java similarity index 99% rename from common/src/common/worldgen/structure/StructureBridge.java rename to server/src/server/worldgen/structure/StructureBridge.java index 0970247..4dc4aa8 100755 --- a/common/src/common/worldgen/structure/StructureBridge.java +++ b/server/src/server/worldgen/structure/StructureBridge.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.List; @@ -10,8 +10,8 @@ import common.tileentity.TileEntity; import common.tileentity.TileEntityMobSpawner; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; import common.worldgen.LootConstants; +import server.world.WorldServer; public class StructureBridge diff --git a/common/src/common/worldgen/structure/StructureComponent.java b/server/src/server/worldgen/structure/StructureComponent.java similarity index 99% rename from common/src/common/worldgen/structure/StructureComponent.java rename to server/src/server/worldgen/structure/StructureComponent.java index bd76ec3..54d9af1 100755 --- a/common/src/common/worldgen/structure/StructureComponent.java +++ b/server/src/server/worldgen/structure/StructureComponent.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.List; @@ -18,7 +18,7 @@ import common.tileentity.TileEntityDispenser; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; +import server.world.WorldServer; public abstract class StructureComponent { diff --git a/common/src/common/worldgen/structure/StructureMineshaft.java b/server/src/server/worldgen/structure/StructureMineshaft.java similarity index 99% rename from common/src/common/worldgen/structure/StructureMineshaft.java rename to server/src/server/worldgen/structure/StructureMineshaft.java index 21f5335..e3a08d5 100755 --- a/common/src/common/worldgen/structure/StructureMineshaft.java +++ b/server/src/server/worldgen/structure/StructureMineshaft.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.LinkedList; import java.util.List; @@ -17,8 +17,8 @@ import common.tileentity.TileEntityMobSpawner; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; import common.worldgen.LootConstants; +import server.world.WorldServer; public class StructureMineshaft diff --git a/common/src/common/worldgen/structure/StructureMineshaftStart.java b/server/src/server/worldgen/structure/StructureMineshaftStart.java similarity index 90% rename from common/src/common/worldgen/structure/StructureMineshaftStart.java rename to server/src/server/worldgen/structure/StructureMineshaftStart.java index 72dc9b0..789b500 100755 --- a/common/src/common/worldgen/structure/StructureMineshaftStart.java +++ b/server/src/server/worldgen/structure/StructureMineshaftStart.java @@ -1,7 +1,7 @@ -package common.worldgen.structure; +package server.worldgen.structure; import common.rng.Random; -import common.world.WorldServer; +import server.world.WorldServer; public class StructureMineshaftStart extends StructureStart { diff --git a/common/src/common/worldgen/structure/StructureScattered.java b/server/src/server/worldgen/structure/StructureScattered.java similarity index 99% rename from common/src/common/worldgen/structure/StructureScattered.java rename to server/src/server/worldgen/structure/StructureScattered.java index e3b3bd4..6a667d2 100755 --- a/common/src/common/worldgen/structure/StructureScattered.java +++ b/server/src/server/worldgen/structure/StructureScattered.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import common.block.BlockFlower; import common.block.BlockFlowerPot; @@ -17,8 +17,8 @@ import common.nbt.NBTTagCompound; import common.rng.Random; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; import common.worldgen.LootConstants; +import server.world.WorldServer; public class StructureScattered { diff --git a/common/src/common/worldgen/structure/StructureStart.java b/server/src/server/worldgen/structure/StructureStart.java similarity index 98% rename from common/src/common/worldgen/structure/StructureStart.java rename to server/src/server/worldgen/structure/StructureStart.java index bbf98f0..bc06008 100755 --- a/common/src/common/worldgen/structure/StructureStart.java +++ b/server/src/server/worldgen/structure/StructureStart.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.Iterator; import java.util.LinkedList; @@ -7,7 +7,7 @@ import common.nbt.NBTTagCompound; import common.nbt.NBTTagList; import common.rng.Random; import common.util.ChunkPos; -import common.world.WorldServer; +import server.world.WorldServer; public abstract class StructureStart { diff --git a/common/src/common/worldgen/structure/StructureStronghold.java b/server/src/server/worldgen/structure/StructureStronghold.java similarity index 99% rename from common/src/common/worldgen/structure/StructureStronghold.java rename to server/src/server/worldgen/structure/StructureStronghold.java index 75f87c0..ad13933 100755 --- a/common/src/common/worldgen/structure/StructureStronghold.java +++ b/server/src/server/worldgen/structure/StructureStronghold.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.List; import java.util.Map; @@ -16,8 +16,8 @@ import common.tileentity.TileEntity; import common.tileentity.TileEntityMobSpawner; import common.util.BlockPos; import common.util.Facing; -import common.world.WorldServer; import common.worldgen.LootConstants; +import server.world.WorldServer; public class StructureStronghold diff --git a/common/src/common/worldgen/structure/StructureVillage.java b/server/src/server/worldgen/structure/StructureVillage.java similarity index 99% rename from common/src/common/worldgen/structure/StructureVillage.java rename to server/src/server/worldgen/structure/StructureVillage.java index 5d25145..810a4f6 100755 --- a/common/src/common/worldgen/structure/StructureVillage.java +++ b/server/src/server/worldgen/structure/StructureVillage.java @@ -1,4 +1,4 @@ -package common.worldgen.structure; +package server.worldgen.structure; import java.util.Iterator; import java.util.List; @@ -22,9 +22,9 @@ import common.rng.Random; import common.util.BlockPos; import common.util.Facing; import common.world.State; -import common.world.WorldServer; import common.worldgen.BiomeGenerator; import common.worldgen.LootConstants; +import server.world.WorldServer; public class StructureVillage