summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-02 19:36:14 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-02 19:36:14 +0200
commit42dcd534df8b41ba24650c2ab6003303b5ae54ce (patch)
tree37b6dc369524037e20602e3d4c43fec10e875741
parentAdded CustomName saving. (diff)
parentRe-added alternate spellings of darkgraywool. (diff)
downloadcuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.tar
cuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.tar.gz
cuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.tar.bz2
cuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.tar.lz
cuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.tar.xz
cuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.tar.zst
cuberite-42dcd534df8b41ba24650c2ab6003303b5ae54ce.zip
-rw-r--r--MCServer/crafting.txt116
-rw-r--r--MCServer/furnace.txt68
-rw-r--r--MCServer/items.ini84
-rw-r--r--src/ChunkDef.h16
-rw-r--r--src/Entities/Pickup.cpp8
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp30
-rw-r--r--tests/ChunkData/CopyBlocks.cpp4
7 files changed, 252 insertions, 74 deletions
diff --git a/MCServer/crafting.txt b/MCServer/crafting.txt
index 5bb0569f3..d29344b64 100644
--- a/MCServer/crafting.txt
+++ b/MCServer/crafting.txt
@@ -61,30 +61,45 @@ Furnace = Cobblestone, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3
#******************************************************#
# Blocks
#
-IronBlock = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-GoldBlock = GoldIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-DiamondBlock = Diamond, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-LapisBlock = LapisLazuli, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-EmeraldBlock = Emerald, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-RedstoneBlock = RedstoneDust, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-QuartzBlock = NetherQuartz, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-NetherBrick = netherbrickitem, 1:1, 1:2, 2:1, 2:2
-Glowstone = GlowstoneDust, 1:1, 1:2, 2:1, 2:2
-Wool = String, 1:1, 1:2, 2:1, 2:2
-TNT = Gunpowder, 1:1, 3:1, 2:2, 1:3, 3:3 | Sand, 2:1, 1:2, 3:2, 2:3
-PillarQuartzBlock = QuartzSlab, 1:1, 1:2
-ChiseledQuartzBlock, 2 = QuartzBlock, 1:1, 1:2
-CoalBlock = Coal, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-HayBale = Wheat, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
-SnowBlock = SnowBall, 1:1, 1:2, 2:1, 2:2
-ClayBlock = Clay, 1:1, 1:2, 2:1, 2:2
-BrickBlock = Brick, 1:1, 1:2, 2:1, 2:2
-StoneBrick, 4 = Stone, 1:1, 1:2, 2:1, 2:2
-BookShelf = Planks, 1:1, 2:1, 3:1, 1:3, 2:3, 3:3 | Book, 1:2, 2:2, 3:2
-Sandstone, 4 = Sand, 1:1, 1:2, 2:1, 2:2
-SmoothSandstone, 4 = Sandstone, 1:1, 1:2, 2:1, 2:2
-OrnamentSandstone = SandstoneSlab, 1:1, 1:2
-JackOLantern = Pumpkin, 1:1 | Torch, 1:2
+IronBlock = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+GoldBlock = GoldIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+DiamondBlock = Diamond, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+LapisBlock = LapisLazuli, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+EmeraldBlock = Emerald, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+RedstoneBlock = RedstoneDust, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+QuartzBlock = NetherQuartz, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+NetherBrick = netherbrickitem, 1:1, 1:2, 2:1, 2:2
+Glowstone = GlowstoneDust, 1:1, 1:2, 2:1, 2:2
+Wool = String, 1:1, 1:2, 2:1, 2:2
+TNT = Gunpowder, 1:1, 3:1, 2:2, 1:3, 3:3 | Sand, 2:1, 1:2, 3:2, 2:3
+PillarQuartzBlock = QuartzSlab, 1:1, 1:2
+ChiseledQuartzBlock, 2 = QuartzBlock, 1:1, 1:2
+CoalBlock = Coal, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+HayBale = Wheat, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+SnowBlock = SnowBall, 1:1, 1:2, 2:1, 2:2
+ClayBlock = Clay, 1:1, 1:2, 2:1, 2:2
+BrickBlock = Brick, 1:1, 1:2, 2:1, 2:2
+StoneBrick, 4 = Stone, 1:1, 1:2, 2:1, 2:2
+BookShelf = Planks, 1:1, 2:1, 3:1, 1:3, 2:3, 3:3 | Book, 1:2, 2:2, 3:2
+Sandstone, 4 = Sand, 1:1, 1:2, 2:1, 2:2
+SmoothSandstone, 4 = Sandstone, 1:1, 1:2, 2:1, 2:2
+OrnamentSandstone = SandstoneSlab, 1:1, 1:2
+JackOLantern = Pumpkin, 1:1 | Torch, 1:2
+PolishedGranite, 4 = Granite, 1:1, 1:2, 2:1, 2:2
+PolishedDiorite, 4 = Diorite, 1:1, 1:2, 2:1, 2:2
+PolishedAndesite, 4 = Andesite, 1:1, 1:2, 2:1, 2:2
+CoarsedDirt, 4 = Dirt, 1:1, 2:2 | Gravel, 1:2, 2:1
+CoarsedDirt, 4 = Gravel, 1:1, 2:2 | Dirt, 1:2, 2:1
+SlimeBlock = Slimeball, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+Prismarine = PrismarineShard, 1:1, 1:2, 2:1, 2:2
+PrismarineBricks = PrismarineShard, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
+DarkPrismarine = PrismarineShard, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Inksac, 2:2
+SeaLantern = PrismarineShard, 1:1, 1:3, 3:1, 3:3 | PrismarineCrystals, 1:2, 2:1, 2:2, 2:3, 3:2
+RedSandstone, 4 = RedSand, 1:1, 1:2, 2:1, 2:2
+ChiseledRedSandstone, 4 = RedSandstoneSlab, 1:1, 1:2
+SmoothRedSandstone, 4 = RedSand, 1:1, 1:2, 2:1, 2:2
+MossyStoneBrick = Stonebrick, * | Vines, *
+Leather = RabbitHide, 1:1, 1:2, 2:1, 2:2
# Slabs:
StoneSlab, 6 = Stone, 1:1, 2:1, 3:1
@@ -101,6 +116,7 @@ StonebrickSlab, 6 = StoneBrick, 1:1, 2:1, 3:1
NetherbrickSlab, 6 = NetherBrick, 1:1, 2:1, 3:1
Quartzslab, 6 = QuartzBlock, 1:1, 2:1, 3:1
snow, 6 = SnowBlock, 1:1, 2:1, 3:1
+RedSandstoneSlab, 6 = RedSandstone, 1:1, 2:1, 3:1
# Stairs:
@@ -128,6 +144,8 @@ quartzstairs, 4 = QuartzBlock, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3
quartzstairs, 4 = QuartzBlock, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
StoneBrickStairs, 4 = StoneBrick, 1:1, 1:2, 2:2, 1:3, 2:3, 3:3
StoneBrickStairs, 4 = StoneBrick, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
+RedSandstoneStairs, 4 = RedSandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
+RedSandstoneStairs, 4 = RedSandstone, 3:1, 2:2, 3:2, 1:3, 2:3, 3:3
# Other
Carpet = Wool, 1:3, 2:3
@@ -262,11 +280,19 @@ ActivatorRail, 6 = IronIngot, 1:1, 1:2, 1:3, 3:1, 3:2, 3:3 | Stick, 2:1, 2:3 | R
#******************************************************#
# Mechanisms
#
-WoodenDoor = Planks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
-IronDoor = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+WoodenDoor, 3 = OakPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+SpruceDoor, 3 = SprucePlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+BirchDoor, 3 = BirchPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+JungleDoor, 3 = JunglePlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+AcaciaDoor, 3 = AcaciaPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+DarkOakDoor, 3 = DarkOakPlanks, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
+IronDoor, 3 = IronIngot, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3
TrapDoor, 2 = Planks, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
+IronTrapDoor = IronIngot, 1:1, 1:2, 2:1, 2:2
WoodPlate = Planks, 1:1, 2:1
StonePlate = Stone, 1:1, 2:1
+lightweightedpressureplate = IronIngot, 1:1, 2:1
+heavyweightedpressureplate = GoldIngot, 1:1, 2:1
StoneButton = Stone, 1:1
WoodenButton = Planks, 1:1
RedstoneTorchOn = Stick, 1:2 | RedstoneDust, 1:1
@@ -304,6 +330,8 @@ MelonSeeds = MelonSlice, *
PumpkinSeeds, 4 = Pumpkin, *
PumpkinPie = Pumpkin, * | Sugar, * | egg, *
Wheat, 9 = Haybale, *
+RabbitStew = Cooked Rabbit, 2:1 | Carrot, 1:2 | BakedPotato, 2:2 | BrownMushroom, 3:2 | Bowl, 2:3
+RabbitStew = Cooked Rabbit, 2:1 | Carrot, 1:2 | BakedPotato, 2:2 | RedMushroom, 3:2 | Bowl, 2:3
@@ -332,17 +360,49 @@ IronBars, 16 = IronIngot, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
Paper, 3 = Sugarcane, 1:1, 2:1, 3:1
Book = Paper, *, *, * | leather, *
Bookandquill = Book, * | feather, * | inksac, *
-Fence, 2 = Stick, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
+Fence, 3 = OakPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
+SpruceFence, 3 = SprucePlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
+BirchFence, 3 = BirchPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
+JungleFence, 3 = JunglePlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
+DarkOakFence, 3 = DarkOakPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
+AcaciaFence, 3 = AcaciaPlanks, 1:1, 1:2, 3:1, 3:2 | Stick, 2:1, 2:2
Cobblestonewall, 6 = cobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3
mossycobblestonewall, 6 = mossycobblestone, 1:2, 1:3, 2:2, 2:3, 3:2, 3:3
NetherBrickFence, 6 = NetherBrick, 1:1, 2:1, 3:1, 1:2, 2:2, 3:2
-FenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | Planks, 2:1, 2:2
+FenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | OakPlanks, 2:1, 2:2
+SpruceFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | SprucePlanks, 2:1, 2:2
+BirchFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | BirchPlanks, 2:1, 2:2
+JungleFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | JunglePlanks, 2:1, 2:2
+DarkOakFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | DarkOakPlanks, 2:1, 2:2
+AcaciaFenceGate = Stick, 1:1, 1:2, 3:1, 3:2 | AcaciaPlanks, 2:1, 2:2
Bed = Planks, 1:2, 2:2, 3:2 | Wool, 1:1, 2:1, 3:1
GoldIngot = GoldNugget, 1:1, 1:2, 1:3, 2:1, 2:2, 2:3, 3:1, 3:2, 3:3
EyeOfEnder = EnderPearl, * | BlazePowder, *
Beacon = Glass, 1:1, 1:2, 2:1, 3:1, 3:2 | Obsidian, 1:3, 2:3, 3:3 | NetherStar, 2:2
Anvil = IronBlock, 1:1, 2:1, 3:1 | IronIngot, 2:2, 1:3, 2:3, 3:3
FlowerPot = Brick, 1:2, 2:3, 3:2
+ArmorStand = Stick, 1:1, 1:3, 2:1, 2:2, 3:1, 3:3 | StoneSlab, 2:3
+
+# These are just the basic ones, you can add various shapes and stuff to each of them
+# ToDo: Add the various shapes (saved in NBT-Tags, not in meta)
+# Banners:
+
+WhiteBanner = Stick, 2:3 | WhiteWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+OrangeBanner = Stick, 2:3 | OrangeWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+MagentaBanner = Stick, 2:3 | MagentaWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+LightBlueBanner = Stick, 2:3 | LightBlueWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+YellowBanner = Stick, 2:3 | YellowWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+LimeBanner = Stick, 2:3 | LimeWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+PinkBanner = Stick, 2:3 | PinkWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+GrayBanner = Stick, 2:3 | GrayWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+LightGrayBanner = Stick, 2:3 | LightGrayWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+CyanBanner = Stick, 2:3 | CyanWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+PurpleBanner = Stick, 2:3 | PurpleWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+BlueBanner = Stick, 2:3 | BlueWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+BrownBanner = Stick, 2:3 | BrownWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+GreenBanner = Stick, 2:3 | GreenWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+RedBanner = Stick, 2:3 | RedWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
+BlackBanner = Stick, 2:3 | BlackWool, 1:1, 1:2, 2:1, 2:2, 2:1, 2:2
diff --git a/MCServer/furnace.txt b/MCServer/furnace.txt
index 9a8cf59e5..0c12a798d 100644
--- a/MCServer/furnace.txt
+++ b/MCServer/furnace.txt
@@ -56,6 +56,10 @@ TallGrass = NetherBrickItem
RawFish = CookedFish
Log = CharCoal
Cactus = GreenDye
+WetSponge = Sponge
+Stonebrick = CrackedStonebrick
+RawRabbit = CookedRabbit
+RawMutton = CookedMutton
@@ -64,31 +68,41 @@ Cactus = GreenDye
#--------------------------
# Fuels
-! CharCoal = 1600 # -> 80 sec
-! Coal = 1600 # -> 80 sec
-! WoodenSlab = 15 # -> 7.5 sec
-! Planks = 300 # -> 15 sec
-! Stick = 100 # -> 5 sec
-! Fence = 300 # -> 15 sec
-! WoodStairs = 300 # -> 15 sec
-! Workbench = 300 # -> 15 sec
-! Bookshelf = 300 # -> 15 sec
-! Chest = 300 # -> 15 sec
-! Jukebox = 300 # -> 15 sec
-! Lavabucket = 20000 # -> 1000 sec
-! Log = 300 # -> 15 sec
-! Sapling = 100 # -> 5 sec
-! CoalBlock = 16000 # -> 800 sec
-! BlazeRod = 2400 # -> 120 sec
-! NoteBlock = 300 # -> 15 sec
-! DaylightSensor = 300 # -> 15 sec
-! FenceGate = 300 # -> 15 sec
-! Trapdoor = 300 # -> 15 sec
-! TrappedChest = 300 # -> 15 sec
-! WoodPlate = 300 # -> 15 sec
-! WoodPickaxe = 200 # -> 10 sec
-! WoodAxe = 200 # -> 10 sec
-! WoodShovel = 200 # -> 10 sec
-! WoodHoe = 200 # -> 10 sec
-! WoodSword = 200 # -> 10 sec
+! CharCoal = 1600 # -> 80 sec
+! Coal = 1600 # -> 80 sec
+! WoodenSlab = 15 # -> 7.5 sec
+! Planks = 300 # -> 15 sec
+! Stick = 100 # -> 5 sec
+! Fence = 300 # -> 15 sec
+! SpruceFence = 300 # -> 15 sec
+! BirchFence = 300 # -> 15 sec
+! JungleFence = 300 # -> 15 sec
+! DarkOakFence = 300 # -> 15 sec
+! AcaciaFence = 300 # -> 15 sec
+! WoodStairs = 300 # -> 15 sec
+! Workbench = 300 # -> 15 sec
+! Bookshelf = 300 # -> 15 sec
+! Chest = 300 # -> 15 sec
+! Jukebox = 300 # -> 15 sec
+! Lavabucket = 20000 # -> 1000 sec
+! Log = 300 # -> 15 sec
+! Sapling = 100 # -> 5 sec
+! CoalBlock = 16000 # -> 800 sec
+! BlazeRod = 2400 # -> 120 sec
+! NoteBlock = 300 # -> 15 sec
+! DaylightSensor = 300 # -> 15 sec
+! FenceGate = 300 # -> 15 sec
+! SpruceFenceGate = 300 # -> 15 sec
+! BirchFenceGate = 300 # -> 15 sec
+! JungleFenceGate = 300 # -> 15 sec
+! DarkOakFenceGate = 300 # -> 15 sec
+! Trapdoor = 300 # -> 15 sec
+! TrappedChest = 300 # -> 15 sec
+! WoodPlate = 300 # -> 15 sec
+! WoodPickaxe = 200 # -> 10 sec
+! WoodAxe = 200 # -> 10 sec
+! WoodShovel = 200 # -> 10 sec
+! WoodHoe = 200 # -> 10 sec
+! WoodSword = 200 # -> 10 sec
+
diff --git a/MCServer/items.ini b/MCServer/items.ini
index 979e02396..6eb9eee6e 100644
--- a/MCServer/items.ini
+++ b/MCServer/items.ini
@@ -1,9 +1,17 @@
[Items]
air=0
rock=1
+granite=1:1
+polishedgranite=1:2
+diorite=1:3
+polisheddiorite=1:4
+andesite=1:5
+polishedandesite=1:6
stone=1
grass=2
dirt=3
+coarseddirt=3:1
+podzol=3:2
cobblestone=4
cobble=4
planks=5
@@ -45,6 +53,7 @@ stilllava=11
slava=11
stationarylava=11
sand=12
+redsand=12:1
gravel=13
goldore=14
ironore=15
@@ -69,6 +78,7 @@ spruceleaves=18:1
birchleaves=18:2
jungleleaves=18:3
sponge=19
+wetsponge=19:1
glass=20
lapisore=21
lapisblock=22
@@ -395,9 +405,42 @@ acaciawoodstairs=163
bigoakwoodstiars=164
darkoakwoodstairs=164
roofedoakwoodstairs=164
+slimeblock=165
+irontrapdoor=167
+prismarine=168
+prismarinebricks=168:1
+darkprismarine=168:2
+sealantern=169
haybale=170
carpet=171
hardenedclay=172
+redsandstone=179
+chiseledredsandstone=179:1
+smoothredsandstone=179:2
+redsandstonestairs=180
+redsandstoneslab=182
+coniferfencegate=183
+pinefencegate=183
+sprucefencegate=183
+darkfencegate=183
+birchfencegate=184
+whitefencegate=184
+junglefencegate=185
+darkoakfencegate=186
+bigoakfencegate=186
+roofedoakfencegate=186
+acaciafencegate=187
+coniferfence=188
+pinefence=188
+sprucefence=188
+darkfence=188
+birchfence=189
+whitefence=189
+junglefence=190
+darkoakfence=191
+bigoakfence=191
+roofedoakfence=191
+acaciafence=192
ironshovel=256
ironspade=256
ironpickaxe=257
@@ -645,13 +688,52 @@ netherbrickitem=405
netherquartz=406
tntminecart=407
hopperminecart=408
+prismarineshard=409
+prismarinecrystals=410
+rawrabbit=411
+cookedrabbit=412
+rabbitstew=413
+rabbitsoup=413
+rabbitsfood=414
+rabbithide=415
+armorstand=416
ironhorsearmor=417
goldhorsearmor=418
diamondhorsearmor=419
lead=420
nametag=421
commandblockminecart=422
-
+rawmutton=423
+cookedmutton=424
+banner=425
+blackbanner=415:0
+redbanner=415:1
+greenbanner=415:2
+brownbanner=415:3
+bluebanner=415:4
+purplebanner=415:5
+cyanbanner=415:6
+silverbanner=415:7
+lightgraybanner=415:7
+graybanner=415:8
+pinkbanner=415:9
+limebanner=415:10
+yellowbanner=415:11
+lightbluebanner=415:12
+magentabanner=415:13
+orangebanner=415:14
+whitebanner=415:15
+coniferdoor=427
+pinedoor=427
+sprucedoor=427
+darkdoor=427
+birchdoor=428
+whitedoor=428
+jungledoor=429
+acaciadoor=430
+bigoakdoor=431
+darkoakdoor=431
+roofedoakdoor=431
goldrecord=2256
greenrecord=2257
blocksrecord=2258
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index 51075ab4a..b8b4291c7 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -197,32 +197,32 @@ public:
inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z)
{
- ASSERT((a_X >= 0) && (a_X <= Width));
- ASSERT((a_Z >= 0) && (a_Z <= Width));
+ ASSERT((a_X >= 0) && (a_X < Width));
+ ASSERT((a_Z >= 0) && (a_Z < Width));
return a_HeightMap[a_X + Width * a_Z];
}
inline static void SetHeight(HeightMap & a_HeightMap, int a_X, int a_Z, unsigned char a_Height)
{
- ASSERT((a_X >= 0) && (a_X <= Width));
- ASSERT((a_Z >= 0) && (a_Z <= Width));
+ ASSERT((a_X >= 0) && (a_X < Width));
+ ASSERT((a_Z >= 0) && (a_Z < Width));
a_HeightMap[a_X + Width * a_Z] = a_Height;
}
inline static EMCSBiome GetBiome(const BiomeMap & a_BiomeMap, int a_X, int a_Z)
{
- ASSERT((a_X >= 0) && (a_X <= Width));
- ASSERT((a_Z >= 0) && (a_Z <= Width));
+ ASSERT((a_X >= 0) && (a_X < Width));
+ ASSERT((a_Z >= 0) && (a_Z < Width));
return a_BiomeMap[a_X + Width * a_Z];
}
inline static void SetBiome(BiomeMap & a_BiomeMap, int a_X, int a_Z, EMCSBiome a_Biome)
{
- ASSERT((a_X >= 0) && (a_X <= Width));
- ASSERT((a_Z >= 0) && (a_Z <= Width));
+ ASSERT((a_X >= 0) && (a_X < Width));
+ ASSERT((a_Z >= 0) && (a_Z < Width));
a_BiomeMap[a_X + Width * a_Z] = a_Biome;
}
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index aab534f41..87b5bed07 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -150,10 +150,14 @@ void cPickup::Tick(float a_Dt, cChunk & a_Chunk)
}
}
- if (!IsDestroyed() && (m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't combine into an already full pickup
+ // Try to combine the pickup with adjacent same-item pickups:
+ if (!IsDestroyed() && (m_Item.m_ItemCount < m_Item.GetMaxStackSize())) // Don't combine if already full
{
+ // By using a_Chunk's ForEachEntity() instead of cWorld's, pickups don't combine across chunk boundaries.
+ // That is a small price to pay for not having to traverse the entire world for each entity.
+ // The speedup in the tick thread is quite considerable.
cPickupCombiningCallback PickupCombiningCallback(GetPosition(), this);
- m_World->ForEachEntity(PickupCombiningCallback); // Not ForEachEntityInChunk, otherwise pickups don't combine across chunk boundaries
+ a_Chunk.ForEachEntity(PickupCombiningCallback);
if (PickupCombiningCallback.FoundMatchingPickup())
{
m_World->BroadcastEntityMetadata(*this);
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index d9cfc140a..2cd2a935b 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -979,9 +979,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
AString ServerAddress;
short ServerPort;
UInt32 NextState;
- m_Buffer.ReadVarUTF8String(ServerAddress);
- m_Buffer.ReadBEShort(ServerPort);
- m_Buffer.ReadVarInt(NextState);
+ if (!m_Buffer.ReadVarUTF8String(ServerAddress))
+ {
+ break;
+ }
+ if (!m_Buffer.ReadBEShort(ServerPort))
+ {
+ break;
+ }
+ if (!m_Buffer.ReadVarInt(NextState))
+ {
+ break;
+ }
m_Buffer.CommitRead();
m_Protocol = new cProtocol172(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
return true;
@@ -991,9 +1000,18 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
AString ServerAddress;
short ServerPort;
UInt32 NextState;
- m_Buffer.ReadVarUTF8String(ServerAddress);
- m_Buffer.ReadBEShort(ServerPort);
- m_Buffer.ReadVarInt(NextState);
+ if (!m_Buffer.ReadVarUTF8String(ServerAddress))
+ {
+ break;
+ }
+ if (!m_Buffer.ReadBEShort(ServerPort))
+ {
+ break;
+ }
+ if (!m_Buffer.ReadVarInt(NextState))
+ {
+ break;
+ }
m_Buffer.CommitRead();
m_Protocol = new cProtocol176(m_Client, ServerAddress, (UInt16)ServerPort, NextState);
return true;
diff --git a/tests/ChunkData/CopyBlocks.cpp b/tests/ChunkData/CopyBlocks.cpp
index ec9451099..99f416e94 100644
--- a/tests/ChunkData/CopyBlocks.cpp
+++ b/tests/ChunkData/CopyBlocks.cpp
@@ -45,7 +45,7 @@ int main(int argc, char ** argv)
BLOCKTYPE * WritePosition = &TestBuffer[WritePosIdx];
memset(TestBuffer, 0x03, sizeof(TestBuffer));
size_t LastReportedStep = 1;
- for (size_t idx = 0; idx < 5000; idx += 7)
+ for (size_t idx = 0; idx < 5000; idx += 73)
{
if (idx / 500 != LastReportedStep)
{
@@ -53,7 +53,7 @@ int main(int argc, char ** argv)
LastReportedStep = idx / 500;
}
- for (size_t len = 3; len < 1000; len += 13)
+ for (size_t len = 3; len < 700; len += 13)
{
Data.CopyBlockTypes(WritePosition, idx, len);