From f6897cf862a970028aa83340cd817df2fd85bc0f Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Wed, 4 Jan 2023 20:46:17 +0300 Subject: [PATCH] names were fixed, ->loop->stop(); --- src/API/BlockAPI.php | 4 - src/API/ConsoleAPI.php | 2 - src/API/EntityAPI.php | 2 +- src/API/PluginAPI.php | 26 +------ src/PocketMinecraftServer.php | 6 +- src/config.php | 2 +- src/dependencies.php | 8 ++ src/entity/Animal.php | 1 + src/entity/Creature.php | 11 ++- src/entity/Entity.php | 2 +- src/entity/Living.php | 2 +- src/entity/registry/EntityList.php | 14 ++++ src/entity/{ => registry}/EntityRegistry.php | 35 +-------- src/entity/registry/PropertyEntity.php | 21 +++++ .../{Ladder.php => LadderBlock.php} | 0 .../{SignPost.php => SignPostBlock.php} | 0 .../attachable/{Torch.php => TorchBlock.php} | 0 .../{Trapdoor.php => TrapdoorBlock.php} | 0 .../{WallSign.php => WallSignBlock.php} | 2 +- .../block/liquid/{Lava.php => LavaBlock.php} | 0 .../{StillLava.php => StillLavaBlock.php} | 0 .../{StillWater.php => StillWaterBlock.php} | 2 +- .../liquid/{Water.php => WaterBlock.php} | 0 .../block/misc/{Air.php => AirBlock.php} | 0 .../block/misc/{Bed.php => BedBlock.php} | 0 .../block/misc/{Fire.php => FireBlock.php} | 0 ...therReactor.php => NetherReactorBlock.php} | 11 +-- .../block/misc/{TNT.php => TNTBlock.php} | 0 .../block/nonfull/{Cake.php => CakeBlock.php} | 0 .../nonfull/{Carpet.php => CarpetBlock.php} | 0 .../nonfull/{Chest.php => ChestBlock.php} | 0 .../nonfull/{Cobweb.php => CobwebBlock.php} | 0 .../{Farmland.php => FarmlandBlock.php} | 0 .../nonfull/{Fence.php => FenceBlock.php} | 0 .../{FenceGate.php => FenceGateBlock.php} | 0 .../{GlassPane.php => GlassPaneBlock.php} | 0 .../{IronBars.php => IronBarsBlock.php} | 0 .../{IronDoor.php => IronDoorBlock.php} | 0 .../{PoweredRail.php => PoweredRailBlock.php} | 0 .../block/nonfull/{Rail.php => RailBlock.php} | 2 +- .../block/nonfull/{Slab.php => SlabBlock.php} | 2 +- .../{SnowLayer.php => SnowLayerBlock.php} | 0 .../{StoneWall.php => StoneWallBlock.php} | 0 .../{WoodDoor.php => WoodDoorBlock.php} | 0 .../{WoodSlab.php => WoodSlabBlock.php} | 0 ...oodStairs.php => BirchWoodStairsBlock.php} | 0 .../{BrickStairs.php => BrickStairsBlock.php} | 0 ...eStairs.php => CobblestoneStairsBlock.php} | 0 ...odStairs.php => JungleWoodStairsBlock.php} | 0 ...Stairs.php => NetherBricksStairsBlock.php} | 0 ...QuartzStairs.php => QuartzStairsBlock.php} | 0 ...oneStairs.php => SandstoneStairsBlock.php} | 0 ...odStairs.php => SpruceWoodStairsBlock.php} | 0 ...ckStairs.php => StoneBrickStairsBlock.php} | 0 .../{WoodStairs.php => WoodStairsBlock.php} | 0 .../ore/{CoalOre.php => CoalOreBlock.php} | 0 .../{DiamondOre.php => DiamondOreBlock.php} | 0 ...oneOre.php => GlowingRedstoneOreBlock.php} | 0 .../ore/{GoldOre.php => GoldOreBlock.php} | 0 .../ore/{IronOre.php => IronOreBlock.php} | 0 .../ore/{LapisOre.php => LapisOreBlock.php} | 0 .../{RedstoneOre.php => RedstoneOreBlock.php} | 0 .../plant/{Beetroot.php => BeetrootBlock.php} | 0 ...ownMushroom.php => BrownMushroomBlock.php} | 0 .../plant/{Cactus.php => CactusBlock.php} | 0 .../plant/{Carrot.php => CarrotBlock.php} | 0 .../{CyanFlower.php => CyanFlowerBlock.php} | 0 .../{Dandelion.php => DandelionBlock.php} | 0 .../plant/{DeadBush.php => DeadBushBlock.php} | 0 .../{MelonStem.php => MelonStemBlock.php} | 0 .../{PumpkinStem.php => PumpkinStemBlock.php} | 0 .../{RedMushroom.php => RedMushroomBlock.php} | 0 .../plant/{Sapling.php => SaplingBlock.php} | 0 .../{Sugarcane.php => SugarcaneBlock.php} | 0 .../{TallGrass.php => TallGrassBlock.php} | 0 .../block/plant/{Wheat.php => WheatBlock.php} | 0 .../solid/{Bedrock.php => BedrockBlock.php} | 0 .../{Bookshelf.php => BookshelfBlock.php} | 0 .../solid/{Bricks.php => BricksBlock.php} | 0 ...ingFurnace.php => BurningFurnaceBlock.php} | 0 .../block/solid/{Clay.php => ClayBlock.php} | 0 .../block/solid/{Coal.php => CoalBlock.php} | 0 .../{Cobblestone.php => CobblestoneBlock.php} | 0 .../solid/{Diamond.php => DiamondBlock.php} | 0 .../block/solid/{Dirt.php => DirtBlock.php} | 0 .../{DoubleSlab.php => DoubleSlabBlock.php} | 0 ...leWoodSlab.php => DoubleWoodSlabBlock.php} | 0 .../solid/{Furnace.php => FurnaceBlock.php} | 2 +- .../block/solid/{Glass.php => GlassBlock.php} | 0 ...gObsidian.php => GlowingObsidianBlock.php} | 0 .../{Glowstone.php => GlowstoneBlock.php} | 0 .../block/solid/{Gold.php => GoldBlock.php} | 0 .../block/solid/{Grass.php => GrassBlock.php} | 0 .../solid/{Gravel.php => GravelBlock.php} | 0 .../solid/{HayBale.php => HayBaleBlock.php} | 0 .../block/solid/{Ice.php => IceBlock.php} | 0 .../{InfoUpdate2.php => InfoUpdate2Block.php} | 0 .../{InfoUpdate.php => InfoUpdateBlock.php} | 0 ...eBedrock.php => InvisibleBedrockBlock.php} | 0 .../block/solid/{Iron.php => IronBlock.php} | 0 .../block/solid/{Lapis.php => LapisBlock.php} | 0 .../solid/{Leaves.php => LeavesBlock.php} | 0 .../{LitPumpkin.php => LitPumpkinBlock.php} | 0 .../block/solid/{Melon.php => MelonBlock.php} | 0 .../{MossStone.php => MossStoneBlock.php} | 0 ...{NetherBrick.php => NetherBricksBlock.php} | 0 .../{Netherrack.php => NetherrackBlock.php} | 0 .../solid/{Obsidian.php => ObsidianBlock.php} | 0 .../solid/{Planks.php => PlanksBlock.php} | 0 .../solid/{Pumpkin.php => PumpkinBlock.php} | 0 .../solid/{Quartz.php => QuartzBlock.php} | 0 .../{Reserved6.php => Reserved6Block.php} | 0 .../block/solid/{Sand.php => SandBlock.php} | 0 .../{Sandstone.php => SandstoneBlock.php} | 0 .../block/solid/{Snow.php => SnowBlock.php} | 0 .../solid/{SoulSand.php => SoulSandBlock.php} | 0 .../solid/{Sponge.php => SpongeBlock.php} | 0 .../block/solid/{Stone.php => StoneBlock.php} | 0 .../{StoneBricks.php => StoneBricksBlock.php} | 0 .../{Stonecutter.php => StonecutterBlock.php} | 0 .../block/solid/{Wood.php => WoodBlock.php} | 0 .../block/solid/{Wool.php => WoolBlock.php} | 0 .../{Workbench.php => WorkbenchBlock.php} | 0 .../{ChainBoots.php => ChainBootsItem.php} | 0 ...Chestplate.php => ChainChestplateItem.php} | 0 .../{ChainHelmet.php => ChainHelmetItem.php} | 0 ...hainLeggings.php => ChainLeggingsItem.php} | 0 ...{DiamondBoots.php => DiamondBootsItem.php} | 0 ...estplate.php => DiamondChestplateItem.php} | 0 ...iamondHelmet.php => DiamondHelmetItem.php} | 0 ...ndLeggings.php => DiamondLeggingsItem.php} | 0 .../{GoldenBoots.php => GoldenBootsItem.php} | 0 ...hestplate.php => GoldenChestplateItem.php} | 0 ...{GoldenHelmet.php => GoldenHelmetItem.php} | 0 ...denLeggings.php => GoldenLeggingsItem.php} | 0 .../{IronBoots.php => IronBootsItem.php} | 0 ...nChestplate.php => IronChestplateItem.php} | 0 .../{IronHelmet.php => IronHelmetItem.php} | 0 ...{IronLeggings.php => IronLeggingsItem.php} | 0 ...{LeatherBoots.php => LeatherBootsItem.php} | 0 .../{LeatherCap.php => LeatherCapItem.php} | 0 ...{LeatherPants.php => LeatherPantsItem.php} | 0 ...{LeatherTunic.php => LeatherTunicItem.php} | 0 .../item/food/{Apple.php => AppleItem.php} | 0 .../{BakedPotato.php => BakedPotatoItem.php} | 0 .../item/food/{Beef.php => BeefItem.php} | 0 .../food/{Beetroot.php => BeetrootItem.php} | 0 ...{BeetrootSoup.php => BeetrootSoupItem.php} | 0 .../item/food/{Bread.php => BreadItem.php} | 0 .../item/food/{Cake.php => CakeItem.php} | 0 .../item/food/{Carrot.php => CarrotItem.php} | 0 ...ookedChicken.php => CookedChickenItem.php} | 0 ...kedPorkchop.php => CookedPorkchopItem.php} | 0 ...{MushroomStew.php => MushroomStewItem.php} | 0 .../item/food/{Potato.php => PotatoItem.php} | 0 .../{PumpkinPie.php => PumpkinPieItem.php} | 0 .../{RawChicken.php => RawChickenItem.php} | 0 .../{RawPorkchop.php => RawPorkchopItem.php} | 0 .../item/food/{Steak.php => SteakItem.php} | 0 .../item/generic/{Arrow.php => ArrowItem.php} | 0 .../item/generic/{Bed.php => BedItem.php} | 0 ...eetrootSeeds.php => BeetrootSeedsItem.php} | 0 .../item/generic/{Bone.php => BoneItem.php} | 0 .../item/generic/{Book.php => BookItem.php} | 0 .../item/generic/{Bowl.php => BowlItem.php} | 0 .../item/generic/{Brick.php => BrickItem.php} | 0 .../generic/{Bucket.php => BucketItem.php} | 0 .../item/generic/{Clay.php => ClayItem.php} | 0 .../item/generic/{Coal.php => CoalItem.php} | 0 .../generic/{Diamond.php => DiamondItem.php} | 0 .../item/generic/{Dye.php => DyeItem.php} | 0 .../item/generic/{Egg.php => EggItem.php} | 0 .../generic/{Feather.php => FeatherItem.php} | 0 .../item/generic/{Flint.php => FlintItem.php} | 0 ...lowstoneDust.php => GlowstoneDustItem.php} | 0 .../{GoldIngot.php => GoldIngotItem.php} | 0 .../{Gunpowder.php => GunpowderItem.php} | 0 .../{IronDoor.php => IronDoorItem.php} | 0 .../{IronIngot.php => IronIngotItem.php} | 0 .../generic/{Leather.php => LeatherItem.php} | 0 .../{MelonSeeds.php => MelonSeedsItem.php} | 0 .../{Minecart.php => MinecartItem.php} | 0 .../{NetherBrick.php => NetherBrickItem.php} | 0 .../{Painting.php => PaintingItem.php} | 2 +- .../item/generic/{Paper.php => PaperItem.php} | 0 ...{PumpkinSeeds.php => PumpkinSeedsItem.php} | 0 .../generic/{Quartz.php => QuartzItem.php} | 0 .../{Redstone.php => RedstoneItem.php} | 0 .../generic/{Saddle.php => SaddleItem.php} | 0 .../{Slimeball.php => SlimeballItem.php} | 0 .../{Snowball.php => SnowballItem.php} | 0 .../{SpawnEgg.php => SpawnEggItem.php} | 0 .../item/generic/{Stick.php => StickItem.php} | 0 .../item/generic/{Sugar.php => SugarItem.php} | 0 .../{Sugarcane.php => SugarcaneItem.php} | 0 .../item/generic/{Wheat.php => WheatItem.php} | 0 .../{WheatSeeds.php => WheatSeedsItem.php} | 0 .../{WoodenDoor.php => WoodenDoorItem.php} | 0 .../item/tool/{Bow.php => BowItem.php} | 0 .../item/tool/{Clock.php => ClockItem.php} | 0 .../tool/{Compass.php => CompassItem.php} | 0 .../{DiamondAxe.php => DiamondAxeItem.php} | 0 .../{DiamondHoe.php => DiamondHoeItem.php} | 0 ...mondPickaxe.php => DiamondPickaxeItem.php} | 0 ...iamondShovel.php => DiamondShovelItem.php} | 0 ...{DiamondSword.php => DiamondSwordItem.php} | 0 .../{FlintSteel.php => FlintSteelItem.php} | 0 .../tool/{GoldenAxe.php => GoldenAxeItem.php} | 0 .../tool/{GoldenHoe.php => GoldenHoeItem.php} | 0 ...oldenPickaxe.php => GoldenPickaxeItem.php} | 0 ...{GoldenShovel.php => GoldenShovelItem.php} | 0 .../{GoldenSword.php => GoldenSwordItem.php} | 0 .../tool/{IronAxe.php => IronAxeItem.php} | 0 .../tool/{IronHoe.php => IronHoeItem.php} | 0 .../{IronPickaxe.php => IronPickaxeItem.php} | 0 .../{IronShovel.php => IronShovelItem.php} | 0 .../tool/{IronSword.php => IronSwordItem.php} | 0 .../item/tool/{Shears.php => ShearsItem.php} | 0 .../tool/{StoneAxe.php => StoneAxeItem.php} | 0 .../tool/{StoneHoe.php => StoneHoeItem.php} | 0 ...{StonePickaxe.php => StonePickaxeItem.php} | 0 .../{StoneShovel.php => StoneShovelItem.php} | 0 .../{StoneSword.php => StoneSwordItem.php} | 0 .../tool/{WoodenAxe.php => WoodenAxeItem.php} | 0 .../tool/{WoodenHoe.php => WoodenHoeItem.php} | 0 ...oodenPickaxe.php => WoodenPickaxeItem.php} | 0 ...{WoodenShovel.php => WoodenShovelItem.php} | 0 .../{WoodenSword.php => WoodenSwordItem.php} | 0 src/plugin/DummyPlugin.php | 13 ++++ src/plugin/OtherPluginRequirement.php | 5 ++ src/plugin/Plugin.php | 10 +++ src/{ => plugin}/phar/IClassLoader.php | 0 src/{ => plugin}/phar/PharUtils.php | 0 src/pmf/PMFLevel.php | 2 +- src/pmf/{Plugin.php => PMFPlugin.php} | 0 .../{pthreads.php => AsyncMultipleQueue.php} | 0 src/utils/Java.php | 2 +- src/utils/MersenneTwister.php | 2 +- src/utils/Utils.php | 4 + src/utils/VersionString.php | 78 +------------------ ...tPosition.php => MovingObjectPosition.php} | 0 src/world/generator/SuperflatGenerator.php | 2 +- 242 files changed, 111 insertions(+), 166 deletions(-) create mode 100644 src/entity/registry/EntityList.php rename src/entity/{ => registry}/EntityRegistry.php (61%) create mode 100644 src/entity/registry/PropertyEntity.php rename src/material/block/attachable/{Ladder.php => LadderBlock.php} (100%) rename src/material/block/attachable/{SignPost.php => SignPostBlock.php} (100%) rename src/material/block/attachable/{Torch.php => TorchBlock.php} (100%) rename src/material/block/attachable/{Trapdoor.php => TrapdoorBlock.php} (100%) rename src/material/block/attachable/{WallSign.php => WallSignBlock.php} (87%) rename src/material/block/liquid/{Lava.php => LavaBlock.php} (100%) rename src/material/block/liquid/{StillLava.php => StillLavaBlock.php} (100%) rename src/material/block/liquid/{StillWater.php => StillWaterBlock.php} (80%) rename src/material/block/liquid/{Water.php => WaterBlock.php} (100%) rename src/material/block/misc/{Air.php => AirBlock.php} (100%) rename src/material/block/misc/{Bed.php => BedBlock.php} (100%) rename src/material/block/misc/{Fire.php => FireBlock.php} (100%) rename src/material/block/misc/{NetherReactor.php => NetherReactorBlock.php} (95%) rename src/material/block/misc/{TNT.php => TNTBlock.php} (100%) rename src/material/block/nonfull/{Cake.php => CakeBlock.php} (100%) rename src/material/block/nonfull/{Carpet.php => CarpetBlock.php} (100%) rename src/material/block/nonfull/{Chest.php => ChestBlock.php} (100%) rename src/material/block/nonfull/{Cobweb.php => CobwebBlock.php} (100%) rename src/material/block/nonfull/{Farmland.php => FarmlandBlock.php} (100%) rename src/material/block/nonfull/{Fence.php => FenceBlock.php} (100%) rename src/material/block/nonfull/{FenceGate.php => FenceGateBlock.php} (100%) rename src/material/block/nonfull/{GlassPane.php => GlassPaneBlock.php} (100%) rename src/material/block/nonfull/{IronBars.php => IronBarsBlock.php} (100%) rename src/material/block/nonfull/{IronDoor.php => IronDoorBlock.php} (100%) rename src/material/block/nonfull/{PoweredRail.php => PoweredRailBlock.php} (100%) rename src/material/block/nonfull/{Rail.php => RailBlock.php} (99%) rename src/material/block/nonfull/{Slab.php => SlabBlock.php} (98%) rename src/material/block/nonfull/{SnowLayer.php => SnowLayerBlock.php} (100%) rename src/material/block/nonfull/{StoneWall.php => StoneWallBlock.php} (100%) rename src/material/block/nonfull/{WoodDoor.php => WoodDoorBlock.php} (100%) rename src/material/block/nonfull/{WoodSlab.php => WoodSlabBlock.php} (100%) rename src/material/block/nonfull/stairs/{BirchWoodStairs.php => BirchWoodStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{BrickStairs.php => BrickStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{CobblestoneStairs.php => CobblestoneStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{JungleWoodStairs.php => JungleWoodStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{NetherBricksStairs.php => NetherBricksStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{QuartzStairs.php => QuartzStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{SandstoneStairs.php => SandstoneStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{SpruceWoodStairs.php => SpruceWoodStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{StoneBrickStairs.php => StoneBrickStairsBlock.php} (100%) rename src/material/block/nonfull/stairs/{WoodStairs.php => WoodStairsBlock.php} (100%) rename src/material/block/ore/{CoalOre.php => CoalOreBlock.php} (100%) rename src/material/block/ore/{DiamondOre.php => DiamondOreBlock.php} (100%) rename src/material/block/ore/{GlowingRedstoneOre.php => GlowingRedstoneOreBlock.php} (100%) rename src/material/block/ore/{GoldOre.php => GoldOreBlock.php} (100%) rename src/material/block/ore/{IronOre.php => IronOreBlock.php} (100%) rename src/material/block/ore/{LapisOre.php => LapisOreBlock.php} (100%) rename src/material/block/ore/{RedstoneOre.php => RedstoneOreBlock.php} (100%) rename src/material/block/plant/{Beetroot.php => BeetrootBlock.php} (100%) rename src/material/block/plant/{BrownMushroom.php => BrownMushroomBlock.php} (100%) rename src/material/block/plant/{Cactus.php => CactusBlock.php} (100%) rename src/material/block/plant/{Carrot.php => CarrotBlock.php} (100%) rename src/material/block/plant/{CyanFlower.php => CyanFlowerBlock.php} (100%) rename src/material/block/plant/{Dandelion.php => DandelionBlock.php} (100%) rename src/material/block/plant/{DeadBush.php => DeadBushBlock.php} (100%) rename src/material/block/plant/{MelonStem.php => MelonStemBlock.php} (100%) rename src/material/block/plant/{PumpkinStem.php => PumpkinStemBlock.php} (100%) rename src/material/block/plant/{RedMushroom.php => RedMushroomBlock.php} (100%) rename src/material/block/plant/{Sapling.php => SaplingBlock.php} (100%) rename src/material/block/plant/{Sugarcane.php => SugarcaneBlock.php} (100%) rename src/material/block/plant/{TallGrass.php => TallGrassBlock.php} (100%) rename src/material/block/plant/{Wheat.php => WheatBlock.php} (100%) rename src/material/block/solid/{Bedrock.php => BedrockBlock.php} (100%) rename src/material/block/solid/{Bookshelf.php => BookshelfBlock.php} (100%) rename src/material/block/solid/{Bricks.php => BricksBlock.php} (100%) rename src/material/block/solid/{BurningFurnace.php => BurningFurnaceBlock.php} (100%) rename src/material/block/solid/{Clay.php => ClayBlock.php} (100%) rename src/material/block/solid/{Coal.php => CoalBlock.php} (100%) rename src/material/block/solid/{Cobblestone.php => CobblestoneBlock.php} (100%) rename src/material/block/solid/{Diamond.php => DiamondBlock.php} (100%) rename src/material/block/solid/{Dirt.php => DirtBlock.php} (100%) rename src/material/block/solid/{DoubleSlab.php => DoubleSlabBlock.php} (100%) rename src/material/block/solid/{DoubleWoodSlab.php => DoubleWoodSlabBlock.php} (100%) rename src/material/block/solid/{Furnace.php => FurnaceBlock.php} (85%) rename src/material/block/solid/{Glass.php => GlassBlock.php} (100%) rename src/material/block/solid/{GlowingObsidian.php => GlowingObsidianBlock.php} (100%) rename src/material/block/solid/{Glowstone.php => GlowstoneBlock.php} (100%) rename src/material/block/solid/{Gold.php => GoldBlock.php} (100%) rename src/material/block/solid/{Grass.php => GrassBlock.php} (100%) rename src/material/block/solid/{Gravel.php => GravelBlock.php} (100%) rename src/material/block/solid/{HayBale.php => HayBaleBlock.php} (100%) rename src/material/block/solid/{Ice.php => IceBlock.php} (100%) rename src/material/block/solid/{InfoUpdate2.php => InfoUpdate2Block.php} (100%) rename src/material/block/solid/{InfoUpdate.php => InfoUpdateBlock.php} (100%) rename src/material/block/solid/{InvisibleBedrock.php => InvisibleBedrockBlock.php} (100%) rename src/material/block/solid/{Iron.php => IronBlock.php} (100%) rename src/material/block/solid/{Lapis.php => LapisBlock.php} (100%) rename src/material/block/solid/{Leaves.php => LeavesBlock.php} (100%) rename src/material/block/solid/{LitPumpkin.php => LitPumpkinBlock.php} (100%) rename src/material/block/solid/{Melon.php => MelonBlock.php} (100%) rename src/material/block/solid/{MossStone.php => MossStoneBlock.php} (100%) rename src/material/block/solid/{NetherBrick.php => NetherBricksBlock.php} (100%) rename src/material/block/solid/{Netherrack.php => NetherrackBlock.php} (100%) rename src/material/block/solid/{Obsidian.php => ObsidianBlock.php} (100%) rename src/material/block/solid/{Planks.php => PlanksBlock.php} (100%) rename src/material/block/solid/{Pumpkin.php => PumpkinBlock.php} (100%) rename src/material/block/solid/{Quartz.php => QuartzBlock.php} (100%) rename src/material/block/solid/{Reserved6.php => Reserved6Block.php} (100%) rename src/material/block/solid/{Sand.php => SandBlock.php} (100%) rename src/material/block/solid/{Sandstone.php => SandstoneBlock.php} (100%) rename src/material/block/solid/{Snow.php => SnowBlock.php} (100%) rename src/material/block/solid/{SoulSand.php => SoulSandBlock.php} (100%) rename src/material/block/solid/{Sponge.php => SpongeBlock.php} (100%) rename src/material/block/solid/{Stone.php => StoneBlock.php} (100%) rename src/material/block/solid/{StoneBricks.php => StoneBricksBlock.php} (100%) rename src/material/block/solid/{Stonecutter.php => StonecutterBlock.php} (100%) rename src/material/block/solid/{Wood.php => WoodBlock.php} (100%) rename src/material/block/solid/{Wool.php => WoolBlock.php} (100%) rename src/material/block/solid/{Workbench.php => WorkbenchBlock.php} (100%) rename src/material/item/armor/{ChainBoots.php => ChainBootsItem.php} (100%) rename src/material/item/armor/{ChainChestplate.php => ChainChestplateItem.php} (100%) rename src/material/item/armor/{ChainHelmet.php => ChainHelmetItem.php} (100%) rename src/material/item/armor/{ChainLeggings.php => ChainLeggingsItem.php} (100%) rename src/material/item/armor/{DiamondBoots.php => DiamondBootsItem.php} (100%) rename src/material/item/armor/{DiamondChestplate.php => DiamondChestplateItem.php} (100%) rename src/material/item/armor/{DiamondHelmet.php => DiamondHelmetItem.php} (100%) rename src/material/item/armor/{DiamondLeggings.php => DiamondLeggingsItem.php} (100%) rename src/material/item/armor/{GoldenBoots.php => GoldenBootsItem.php} (100%) rename src/material/item/armor/{GoldenChestplate.php => GoldenChestplateItem.php} (100%) rename src/material/item/armor/{GoldenHelmet.php => GoldenHelmetItem.php} (100%) rename src/material/item/armor/{GoldenLeggings.php => GoldenLeggingsItem.php} (100%) rename src/material/item/armor/{IronBoots.php => IronBootsItem.php} (100%) rename src/material/item/armor/{IronChestplate.php => IronChestplateItem.php} (100%) rename src/material/item/armor/{IronHelmet.php => IronHelmetItem.php} (100%) rename src/material/item/armor/{IronLeggings.php => IronLeggingsItem.php} (100%) rename src/material/item/armor/{LeatherBoots.php => LeatherBootsItem.php} (100%) rename src/material/item/armor/{LeatherCap.php => LeatherCapItem.php} (100%) rename src/material/item/armor/{LeatherPants.php => LeatherPantsItem.php} (100%) rename src/material/item/armor/{LeatherTunic.php => LeatherTunicItem.php} (100%) rename src/material/item/food/{Apple.php => AppleItem.php} (100%) rename src/material/item/food/{BakedPotato.php => BakedPotatoItem.php} (100%) rename src/material/item/food/{Beef.php => BeefItem.php} (100%) rename src/material/item/food/{Beetroot.php => BeetrootItem.php} (100%) rename src/material/item/food/{BeetrootSoup.php => BeetrootSoupItem.php} (100%) rename src/material/item/food/{Bread.php => BreadItem.php} (100%) rename src/material/item/food/{Cake.php => CakeItem.php} (100%) rename src/material/item/food/{Carrot.php => CarrotItem.php} (100%) rename src/material/item/food/{CookedChicken.php => CookedChickenItem.php} (100%) rename src/material/item/food/{CookedPorkchop.php => CookedPorkchopItem.php} (100%) rename src/material/item/food/{MushroomStew.php => MushroomStewItem.php} (100%) rename src/material/item/food/{Potato.php => PotatoItem.php} (100%) rename src/material/item/food/{PumpkinPie.php => PumpkinPieItem.php} (100%) rename src/material/item/food/{RawChicken.php => RawChickenItem.php} (100%) rename src/material/item/food/{RawPorkchop.php => RawPorkchopItem.php} (100%) rename src/material/item/food/{Steak.php => SteakItem.php} (100%) rename src/material/item/generic/{Arrow.php => ArrowItem.php} (100%) rename src/material/item/generic/{Bed.php => BedItem.php} (100%) rename src/material/item/generic/{BeetrootSeeds.php => BeetrootSeedsItem.php} (100%) rename src/material/item/generic/{Bone.php => BoneItem.php} (100%) rename src/material/item/generic/{Book.php => BookItem.php} (100%) rename src/material/item/generic/{Bowl.php => BowlItem.php} (100%) rename src/material/item/generic/{Brick.php => BrickItem.php} (100%) rename src/material/item/generic/{Bucket.php => BucketItem.php} (100%) rename src/material/item/generic/{Clay.php => ClayItem.php} (100%) rename src/material/item/generic/{Coal.php => CoalItem.php} (100%) rename src/material/item/generic/{Diamond.php => DiamondItem.php} (100%) rename src/material/item/generic/{Dye.php => DyeItem.php} (100%) rename src/material/item/generic/{Egg.php => EggItem.php} (100%) rename src/material/item/generic/{Feather.php => FeatherItem.php} (100%) rename src/material/item/generic/{Flint.php => FlintItem.php} (100%) rename src/material/item/generic/{GlowstoneDust.php => GlowstoneDustItem.php} (100%) rename src/material/item/generic/{GoldIngot.php => GoldIngotItem.php} (100%) rename src/material/item/generic/{Gunpowder.php => GunpowderItem.php} (100%) rename src/material/item/generic/{IronDoor.php => IronDoorItem.php} (100%) rename src/material/item/generic/{IronIngot.php => IronIngotItem.php} (100%) rename src/material/item/generic/{Leather.php => LeatherItem.php} (100%) rename src/material/item/generic/{MelonSeeds.php => MelonSeedsItem.php} (100%) rename src/material/item/generic/{Minecart.php => MinecartItem.php} (100%) rename src/material/item/generic/{NetherBrick.php => NetherBrickItem.php} (100%) rename src/material/item/generic/{Painting.php => PaintingItem.php} (96%) rename src/material/item/generic/{Paper.php => PaperItem.php} (100%) rename src/material/item/generic/{PumpkinSeeds.php => PumpkinSeedsItem.php} (100%) rename src/material/item/generic/{Quartz.php => QuartzItem.php} (100%) rename src/material/item/generic/{Redstone.php => RedstoneItem.php} (100%) rename src/material/item/generic/{Saddle.php => SaddleItem.php} (100%) rename src/material/item/generic/{Slimeball.php => SlimeballItem.php} (100%) rename src/material/item/generic/{Snowball.php => SnowballItem.php} (100%) rename src/material/item/generic/{SpawnEgg.php => SpawnEggItem.php} (100%) rename src/material/item/generic/{Stick.php => StickItem.php} (100%) rename src/material/item/generic/{Sugar.php => SugarItem.php} (100%) rename src/material/item/generic/{Sugarcane.php => SugarcaneItem.php} (100%) rename src/material/item/generic/{Wheat.php => WheatItem.php} (100%) rename src/material/item/generic/{WheatSeeds.php => WheatSeedsItem.php} (100%) rename src/material/item/generic/{WoodenDoor.php => WoodenDoorItem.php} (100%) rename src/material/item/tool/{Bow.php => BowItem.php} (100%) rename src/material/item/tool/{Clock.php => ClockItem.php} (100%) rename src/material/item/tool/{Compass.php => CompassItem.php} (100%) rename src/material/item/tool/{DiamondAxe.php => DiamondAxeItem.php} (100%) rename src/material/item/tool/{DiamondHoe.php => DiamondHoeItem.php} (100%) rename src/material/item/tool/{DiamondPickaxe.php => DiamondPickaxeItem.php} (100%) rename src/material/item/tool/{DiamondShovel.php => DiamondShovelItem.php} (100%) rename src/material/item/tool/{DiamondSword.php => DiamondSwordItem.php} (100%) rename src/material/item/tool/{FlintSteel.php => FlintSteelItem.php} (100%) rename src/material/item/tool/{GoldenAxe.php => GoldenAxeItem.php} (100%) rename src/material/item/tool/{GoldenHoe.php => GoldenHoeItem.php} (100%) rename src/material/item/tool/{GoldenPickaxe.php => GoldenPickaxeItem.php} (100%) rename src/material/item/tool/{GoldenShovel.php => GoldenShovelItem.php} (100%) rename src/material/item/tool/{GoldenSword.php => GoldenSwordItem.php} (100%) rename src/material/item/tool/{IronAxe.php => IronAxeItem.php} (100%) rename src/material/item/tool/{IronHoe.php => IronHoeItem.php} (100%) rename src/material/item/tool/{IronPickaxe.php => IronPickaxeItem.php} (100%) rename src/material/item/tool/{IronShovel.php => IronShovelItem.php} (100%) rename src/material/item/tool/{IronSword.php => IronSwordItem.php} (100%) rename src/material/item/tool/{Shears.php => ShearsItem.php} (100%) rename src/material/item/tool/{StoneAxe.php => StoneAxeItem.php} (100%) rename src/material/item/tool/{StoneHoe.php => StoneHoeItem.php} (100%) rename src/material/item/tool/{StonePickaxe.php => StonePickaxeItem.php} (100%) rename src/material/item/tool/{StoneShovel.php => StoneShovelItem.php} (100%) rename src/material/item/tool/{StoneSword.php => StoneSwordItem.php} (100%) rename src/material/item/tool/{WoodenAxe.php => WoodenAxeItem.php} (100%) rename src/material/item/tool/{WoodenHoe.php => WoodenHoeItem.php} (100%) rename src/material/item/tool/{WoodenPickaxe.php => WoodenPickaxeItem.php} (100%) rename src/material/item/tool/{WoodenShovel.php => WoodenShovelItem.php} (100%) rename src/material/item/tool/{WoodenSword.php => WoodenSwordItem.php} (100%) create mode 100644 src/plugin/DummyPlugin.php create mode 100644 src/plugin/OtherPluginRequirement.php create mode 100644 src/plugin/Plugin.php rename src/{ => plugin}/phar/IClassLoader.php (100%) rename src/{ => plugin}/phar/PharUtils.php (100%) rename src/pmf/{Plugin.php => PMFPlugin.php} (100%) rename src/utils/{pthreads.php => AsyncMultipleQueue.php} (100%) rename src/world/{MocingObjectPosition.php => MovingObjectPosition.php} (100%) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index efe21123..0cbeff32 100755 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -573,11 +573,7 @@ class BlockAPI{ public function nextRandomUpdate(Position $pos){ if(!isset($this->scheduledUpdates[$pos->x . "." . $pos->y . "." . $pos->z . "." . $pos->level->getName() . "." . BLOCK_UPDATE_RANDOM])){ - $X = (($pos->x >> 4) << 4); - $Y = (($pos->y >> 4) << 4); - $Z = (($pos->z >> 4) << 4); $time = microtime(true); - $i = 0; $offset = 0; while(true){ $t = $offset + Utils::getRandomUpdateTicks() * 0.05; diff --git a/src/API/ConsoleAPI.php b/src/API/ConsoleAPI.php index 3f0694c3..8aea33c5 100644 --- a/src/API/ConsoleAPI.php +++ b/src/API/ConsoleAPI.php @@ -51,7 +51,6 @@ class ConsoleAPI{ $this->loop->notify(); //@fclose($this->loop->fp); usleep(50000); - $this->loop->kill(); //$this->loop->join(); } } @@ -294,7 +293,6 @@ class ConsoleLoop extends Thread{ public $base; public $ev; public $fp; - public function __construct(){ $this->line = false; $this->stop = false; diff --git a/src/API/EntityAPI.php b/src/API/EntityAPI.php index f0f7d6f9..cdcff6ff 100644 --- a/src/API/EntityAPI.php +++ b/src/API/EntityAPI.php @@ -54,7 +54,7 @@ class EntityAPI{ } $mobName = ucfirst(array_flip($mob)[$type]); - if((strtolower($args[1] === "baby") or strtolower($args[2] === "baby")) and !Utils::in_range($type, 10, 13)){ + if((isset($args[1]) || isset($args[2])) && (strtolower($args[1] === "baby") or strtolower($args[2] === "baby")) and !Utils::in_range($type, 10, 13)){ $output .= "$mobName cannot be a baby!"; break; } diff --git a/src/API/PluginAPI.php b/src/API/PluginAPI.php index 2726a1dc..6cc65250 100644 --- a/src/API/PluginAPI.php +++ b/src/API/PluginAPI.php @@ -1,19 +1,5 @@ extraprops = new Config(DATA_PATH . "extra.properties", CONFIG_PROPERTIES, [ "version" => "5", - "experemental-mob-features" => false, - "enable-nether-reactor" => true, + "experemental-mob-features" => true, + "enable-mob-ai" => false, + "enable-nether-reactor" => true, "enable-explosions" => true, "enable-rail-connection" => false, "save-player-data" => true, @@ -82,6 +83,7 @@ class PocketMinecraftServer{ "discord-webhook-url" => "none", "discord-bot-name" => "NostalgiaCore Logger" ]); + Entity::$allowedAI = $this->extraprops->get("enable-mob-ai"); Entity::$updateOnTick = $this->extraprops->get("experemental-mob-features"); if(Entity::$updateOnTick){ console("[WARNING] Experemental mob features are enabled. Unpredictable behavior."); diff --git a/src/config.php b/src/config.php index efd25237..33b94ff4 100644 --- a/src/config.php +++ b/src/config.php @@ -48,7 +48,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH); ini_set("memory_limit", "256M"); //Default define("LOG", true); define("START_TIME", microtime(true)); -define("MAJOR_VERSION", "1.0.2dev (Alpha_1.3.12)"); +define("MAJOR_VERSION", "1.0.2dev"); define("CODENAME", "懐かしさ (Nostalgia)"); //i'm not very creative - kotyaralih define("CURRENT_MINECRAFT_VERSION", "v0.8.1 alpha"); define("CURRENT_API_VERSION", '12.1'); diff --git a/src/dependencies.php b/src/dependencies.php index 517001e9..c235f520 100644 --- a/src/dependencies.php +++ b/src/dependencies.php @@ -123,8 +123,16 @@ require_once(FILE_PATH . "/src/material/item/armor/ArmorItem.php"); require_once(FILE_PATH . "/src/structure/Structure.php"); +require_once(FILE_PATH . "/src/plugin/Plugin.php"); +require_once(FILE_PATH . "/src/plugin/OtherPluginRequirement.php"); +require_once(FILE_PATH . "/src/plugin/DummyPlugin.php"); +require_once(FILE_PATH . "/src/plugin/phar/IClassLoader.php"); +require_once(FILE_PATH . "/src/plugin/phar/PharUtils.php"); + require_all(FILE_PATH . "src/"); + + $inc = get_included_files(); $inc[] = array_shift($inc); $srcdir = realpath(FILE_PATH . "src/"); diff --git a/src/entity/Animal.php b/src/entity/Animal.php index d06d9209..a205b0b2 100644 --- a/src/entity/Animal.php +++ b/src/entity/Animal.php @@ -14,6 +14,7 @@ abstract class Animal extends Creature implements Ageable, Breedable{ if(isset($this->data["IsBaby"]) && $this->data["IsBaby"] && $this->getAge() >= 0){ $this->setAge(-24000); } + $this->ai->addTask(new TaskTempt()); } diff --git a/src/entity/Creature.php b/src/entity/Creature.php index b7ec2975..6c45076a 100644 --- a/src/entity/Creature.php +++ b/src/entity/Creature.php @@ -12,12 +12,11 @@ abstract class Creature extends Living{ $this->inPanic = false; //force for now parent::__construct($level, $eid, $class, $type, $data); $this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 1, "generic"); - //$this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type)); - if(Entity::$updateOnTick){ - $this->ai->addTask(new TaskLookAround()); - $this->ai->addTask(new TaskRandomWalk()); - $this->ai->addTask(new TaskLookAtPlayer()); - } + // $this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type)); + $this->ai->addTask(new TaskLookAround()); + $this->ai->addTask(new TaskRandomWalk()); + $this->ai->addTask(new TaskLookAtPlayer()); + } diff --git a/src/entity/Entity.php b/src/entity/Entity.php index ba71dfa2..120f4137 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -6,7 +6,7 @@ class Entity extends Position const TYPE = - 1; const CLASS_TYPE = - 1; - public static $updateOnTick; + public static $updateOnTick, $allowedAI; public $isCollidable; public $canBeAttacked; public $moveTime, $lookTime, $idleTime; diff --git a/src/entity/Living.php b/src/entity/Living.php index ea63b266..59af9c63 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -27,7 +27,7 @@ abstract class Living extends Entity implements Damageable, Pathfindable{ } public function update(){ - if($this->idleTime <= 0) { + if(Entity::$allowedAI && $this->idleTime <= 0) { $this->ai->updateTasks(); } diff --git a/src/entity/registry/EntityList.php b/src/entity/registry/EntityList.php new file mode 100644 index 00000000..3d7caa05 --- /dev/null +++ b/src/entity/registry/EntityList.php @@ -0,0 +1,14 @@ +entities; + } + public function addEntity(PropertyEntity $property){ + $this->entities[$property->getEntityType()] = $property; + } + public function getEntityFromTypeAndClass($type, $class){ + return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0; + } + private $entities = []; +} diff --git a/src/entity/EntityRegistry.php b/src/entity/registry/EntityRegistry.php similarity index 61% rename from src/entity/EntityRegistry.php rename to src/entity/registry/EntityRegistry.php index 7834b896..f8774378 100644 --- a/src/entity/EntityRegistry.php +++ b/src/entity/registry/EntityRegistry.php @@ -1,39 +1,6 @@ class = $class; - $this->type = $type; - $this->name = $name; - } - - public function getEntityClass(){ - return $this->class; - } - public function getEntityType(){ - return $this->type; - } - public function getEntityName(){ - return $this->name; - } -} - -class EntityList{ - public function getEntities(){ - return $this->entities; - } - public function addEntity(PropertyEntity $property){ - $this->entities[$property->getEntityType()] = $property; - } - public function getEntityFromTypeAndClass($type, $class){ - return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0; - } - private $entities = []; -} - -class EntityRegistry{ +class EntityRegistry{ public static $entityList; /*Register all entities*/ public static function registerEntities(){ diff --git a/src/entity/registry/PropertyEntity.php b/src/entity/registry/PropertyEntity.php new file mode 100644 index 00000000..530b8080 --- /dev/null +++ b/src/entity/registry/PropertyEntity.php @@ -0,0 +1,21 @@ +class = $class; + $this->type = $type; + $this->name = $name; + } + + public function getEntityClass(){ + return $this->class; + } + public function getEntityType(){ + return $this->type; + } + public function getEntityName(){ + return $this->name; + } +} \ No newline at end of file diff --git a/src/material/block/attachable/Ladder.php b/src/material/block/attachable/LadderBlock.php similarity index 100% rename from src/material/block/attachable/Ladder.php rename to src/material/block/attachable/LadderBlock.php diff --git a/src/material/block/attachable/SignPost.php b/src/material/block/attachable/SignPostBlock.php similarity index 100% rename from src/material/block/attachable/SignPost.php rename to src/material/block/attachable/SignPostBlock.php diff --git a/src/material/block/attachable/Torch.php b/src/material/block/attachable/TorchBlock.php similarity index 100% rename from src/material/block/attachable/Torch.php rename to src/material/block/attachable/TorchBlock.php diff --git a/src/material/block/attachable/Trapdoor.php b/src/material/block/attachable/TrapdoorBlock.php similarity index 100% rename from src/material/block/attachable/Trapdoor.php rename to src/material/block/attachable/TrapdoorBlock.php diff --git a/src/material/block/attachable/WallSign.php b/src/material/block/attachable/WallSignBlock.php similarity index 87% rename from src/material/block/attachable/WallSign.php rename to src/material/block/attachable/WallSignBlock.php index 2f9846dc..b41f26a1 100644 --- a/src/material/block/attachable/WallSign.php +++ b/src/material/block/attachable/WallSignBlock.php @@ -1,7 +1,7 @@ level->getBlock(new Vector3($x+$a, $y+$b, $z+$c))->getID() === 87 && Utils::randomFloat() > 0.75){ @@ -188,24 +188,25 @@ class NetherReactorBlock extends SolidBlock{ foreach($this->core as $yOffset => $layer){ foreach($layer as $line){ foreach(str_split($line) as $char){ + $b = $this->level->getBlockWithoutVector(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ)); switch($char){ case "G": - if($this->level->getBlock(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ))->getID() === GOLD_BLOCK){ + if($b === GOLD_BLOCK){ //TODO make it use structure class break; } return false; case "C": - if($this->level->getBlock(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ))->getID() === COBBLESTONE){ + if($b === COBBLESTONE){ break; } return false; case "R": - if($this->level->getBlock(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ))->getID() === NETHER_REACTOR){ + if($b === NETHER_REACTOR){ break; } return false; case " ": - if($this->level->getBlock(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ))->getID() === 0){ + if($b->getID() === 0){ break; } return false; diff --git a/src/material/block/misc/TNT.php b/src/material/block/misc/TNTBlock.php similarity index 100% rename from src/material/block/misc/TNT.php rename to src/material/block/misc/TNTBlock.php diff --git a/src/material/block/nonfull/Cake.php b/src/material/block/nonfull/CakeBlock.php similarity index 100% rename from src/material/block/nonfull/Cake.php rename to src/material/block/nonfull/CakeBlock.php diff --git a/src/material/block/nonfull/Carpet.php b/src/material/block/nonfull/CarpetBlock.php similarity index 100% rename from src/material/block/nonfull/Carpet.php rename to src/material/block/nonfull/CarpetBlock.php diff --git a/src/material/block/nonfull/Chest.php b/src/material/block/nonfull/ChestBlock.php similarity index 100% rename from src/material/block/nonfull/Chest.php rename to src/material/block/nonfull/ChestBlock.php diff --git a/src/material/block/nonfull/Cobweb.php b/src/material/block/nonfull/CobwebBlock.php similarity index 100% rename from src/material/block/nonfull/Cobweb.php rename to src/material/block/nonfull/CobwebBlock.php diff --git a/src/material/block/nonfull/Farmland.php b/src/material/block/nonfull/FarmlandBlock.php similarity index 100% rename from src/material/block/nonfull/Farmland.php rename to src/material/block/nonfull/FarmlandBlock.php diff --git a/src/material/block/nonfull/Fence.php b/src/material/block/nonfull/FenceBlock.php similarity index 100% rename from src/material/block/nonfull/Fence.php rename to src/material/block/nonfull/FenceBlock.php diff --git a/src/material/block/nonfull/FenceGate.php b/src/material/block/nonfull/FenceGateBlock.php similarity index 100% rename from src/material/block/nonfull/FenceGate.php rename to src/material/block/nonfull/FenceGateBlock.php diff --git a/src/material/block/nonfull/GlassPane.php b/src/material/block/nonfull/GlassPaneBlock.php similarity index 100% rename from src/material/block/nonfull/GlassPane.php rename to src/material/block/nonfull/GlassPaneBlock.php diff --git a/src/material/block/nonfull/IronBars.php b/src/material/block/nonfull/IronBarsBlock.php similarity index 100% rename from src/material/block/nonfull/IronBars.php rename to src/material/block/nonfull/IronBarsBlock.php diff --git a/src/material/block/nonfull/IronDoor.php b/src/material/block/nonfull/IronDoorBlock.php similarity index 100% rename from src/material/block/nonfull/IronDoor.php rename to src/material/block/nonfull/IronDoorBlock.php diff --git a/src/material/block/nonfull/PoweredRail.php b/src/material/block/nonfull/PoweredRailBlock.php similarity index 100% rename from src/material/block/nonfull/PoweredRail.php rename to src/material/block/nonfull/PoweredRailBlock.php diff --git a/src/material/block/nonfull/Rail.php b/src/material/block/nonfull/RailBlock.php similarity index 99% rename from src/material/block/nonfull/Rail.php rename to src/material/block/nonfull/RailBlock.php index ca34b1bc..5afb2c71 100644 --- a/src/material/block/nonfull/Rail.php +++ b/src/material/block/nonfull/RailBlock.php @@ -30,7 +30,7 @@ class RailBlock extends FlowableBlock{ if(!($rail instanceof RailBlock)) return null; $damage = $rail->meta; if ($damage < 0 || $damage > 10) return null; - $delta = array( + $delta = array( //TODO make static array(array(0, 1), array(0, -1)), array(array(1, 0), array(-1, 0)), array(array(1, 0), array(-1, 0)), diff --git a/src/material/block/nonfull/Slab.php b/src/material/block/nonfull/SlabBlock.php similarity index 98% rename from src/material/block/nonfull/Slab.php rename to src/material/block/nonfull/SlabBlock.php index 31098656..d8f3fba9 100644 --- a/src/material/block/nonfull/Slab.php +++ b/src/material/block/nonfull/SlabBlock.php @@ -3,7 +3,7 @@ class SlabBlock extends TransparentBlock{ public function __construct($meta = 0){ parent::__construct(SLAB, $meta, "Slab"); - $names = array( + $names = array( //TODO make it static 0 => "Stone", 1 => "Sandstone", 2 => "Wooden", diff --git a/src/material/block/nonfull/SnowLayer.php b/src/material/block/nonfull/SnowLayerBlock.php similarity index 100% rename from src/material/block/nonfull/SnowLayer.php rename to src/material/block/nonfull/SnowLayerBlock.php diff --git a/src/material/block/nonfull/StoneWall.php b/src/material/block/nonfull/StoneWallBlock.php similarity index 100% rename from src/material/block/nonfull/StoneWall.php rename to src/material/block/nonfull/StoneWallBlock.php diff --git a/src/material/block/nonfull/WoodDoor.php b/src/material/block/nonfull/WoodDoorBlock.php similarity index 100% rename from src/material/block/nonfull/WoodDoor.php rename to src/material/block/nonfull/WoodDoorBlock.php diff --git a/src/material/block/nonfull/WoodSlab.php b/src/material/block/nonfull/WoodSlabBlock.php similarity index 100% rename from src/material/block/nonfull/WoodSlab.php rename to src/material/block/nonfull/WoodSlabBlock.php diff --git a/src/material/block/nonfull/stairs/BirchWoodStairs.php b/src/material/block/nonfull/stairs/BirchWoodStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/BirchWoodStairs.php rename to src/material/block/nonfull/stairs/BirchWoodStairsBlock.php diff --git a/src/material/block/nonfull/stairs/BrickStairs.php b/src/material/block/nonfull/stairs/BrickStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/BrickStairs.php rename to src/material/block/nonfull/stairs/BrickStairsBlock.php diff --git a/src/material/block/nonfull/stairs/CobblestoneStairs.php b/src/material/block/nonfull/stairs/CobblestoneStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/CobblestoneStairs.php rename to src/material/block/nonfull/stairs/CobblestoneStairsBlock.php diff --git a/src/material/block/nonfull/stairs/JungleWoodStairs.php b/src/material/block/nonfull/stairs/JungleWoodStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/JungleWoodStairs.php rename to src/material/block/nonfull/stairs/JungleWoodStairsBlock.php diff --git a/src/material/block/nonfull/stairs/NetherBricksStairs.php b/src/material/block/nonfull/stairs/NetherBricksStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/NetherBricksStairs.php rename to src/material/block/nonfull/stairs/NetherBricksStairsBlock.php diff --git a/src/material/block/nonfull/stairs/QuartzStairs.php b/src/material/block/nonfull/stairs/QuartzStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/QuartzStairs.php rename to src/material/block/nonfull/stairs/QuartzStairsBlock.php diff --git a/src/material/block/nonfull/stairs/SandstoneStairs.php b/src/material/block/nonfull/stairs/SandstoneStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/SandstoneStairs.php rename to src/material/block/nonfull/stairs/SandstoneStairsBlock.php diff --git a/src/material/block/nonfull/stairs/SpruceWoodStairs.php b/src/material/block/nonfull/stairs/SpruceWoodStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/SpruceWoodStairs.php rename to src/material/block/nonfull/stairs/SpruceWoodStairsBlock.php diff --git a/src/material/block/nonfull/stairs/StoneBrickStairs.php b/src/material/block/nonfull/stairs/StoneBrickStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/StoneBrickStairs.php rename to src/material/block/nonfull/stairs/StoneBrickStairsBlock.php diff --git a/src/material/block/nonfull/stairs/WoodStairs.php b/src/material/block/nonfull/stairs/WoodStairsBlock.php similarity index 100% rename from src/material/block/nonfull/stairs/WoodStairs.php rename to src/material/block/nonfull/stairs/WoodStairsBlock.php diff --git a/src/material/block/ore/CoalOre.php b/src/material/block/ore/CoalOreBlock.php similarity index 100% rename from src/material/block/ore/CoalOre.php rename to src/material/block/ore/CoalOreBlock.php diff --git a/src/material/block/ore/DiamondOre.php b/src/material/block/ore/DiamondOreBlock.php similarity index 100% rename from src/material/block/ore/DiamondOre.php rename to src/material/block/ore/DiamondOreBlock.php diff --git a/src/material/block/ore/GlowingRedstoneOre.php b/src/material/block/ore/GlowingRedstoneOreBlock.php similarity index 100% rename from src/material/block/ore/GlowingRedstoneOre.php rename to src/material/block/ore/GlowingRedstoneOreBlock.php diff --git a/src/material/block/ore/GoldOre.php b/src/material/block/ore/GoldOreBlock.php similarity index 100% rename from src/material/block/ore/GoldOre.php rename to src/material/block/ore/GoldOreBlock.php diff --git a/src/material/block/ore/IronOre.php b/src/material/block/ore/IronOreBlock.php similarity index 100% rename from src/material/block/ore/IronOre.php rename to src/material/block/ore/IronOreBlock.php diff --git a/src/material/block/ore/LapisOre.php b/src/material/block/ore/LapisOreBlock.php similarity index 100% rename from src/material/block/ore/LapisOre.php rename to src/material/block/ore/LapisOreBlock.php diff --git a/src/material/block/ore/RedstoneOre.php b/src/material/block/ore/RedstoneOreBlock.php similarity index 100% rename from src/material/block/ore/RedstoneOre.php rename to src/material/block/ore/RedstoneOreBlock.php diff --git a/src/material/block/plant/Beetroot.php b/src/material/block/plant/BeetrootBlock.php similarity index 100% rename from src/material/block/plant/Beetroot.php rename to src/material/block/plant/BeetrootBlock.php diff --git a/src/material/block/plant/BrownMushroom.php b/src/material/block/plant/BrownMushroomBlock.php similarity index 100% rename from src/material/block/plant/BrownMushroom.php rename to src/material/block/plant/BrownMushroomBlock.php diff --git a/src/material/block/plant/Cactus.php b/src/material/block/plant/CactusBlock.php similarity index 100% rename from src/material/block/plant/Cactus.php rename to src/material/block/plant/CactusBlock.php diff --git a/src/material/block/plant/Carrot.php b/src/material/block/plant/CarrotBlock.php similarity index 100% rename from src/material/block/plant/Carrot.php rename to src/material/block/plant/CarrotBlock.php diff --git a/src/material/block/plant/CyanFlower.php b/src/material/block/plant/CyanFlowerBlock.php similarity index 100% rename from src/material/block/plant/CyanFlower.php rename to src/material/block/plant/CyanFlowerBlock.php diff --git a/src/material/block/plant/Dandelion.php b/src/material/block/plant/DandelionBlock.php similarity index 100% rename from src/material/block/plant/Dandelion.php rename to src/material/block/plant/DandelionBlock.php diff --git a/src/material/block/plant/DeadBush.php b/src/material/block/plant/DeadBushBlock.php similarity index 100% rename from src/material/block/plant/DeadBush.php rename to src/material/block/plant/DeadBushBlock.php diff --git a/src/material/block/plant/MelonStem.php b/src/material/block/plant/MelonStemBlock.php similarity index 100% rename from src/material/block/plant/MelonStem.php rename to src/material/block/plant/MelonStemBlock.php diff --git a/src/material/block/plant/PumpkinStem.php b/src/material/block/plant/PumpkinStemBlock.php similarity index 100% rename from src/material/block/plant/PumpkinStem.php rename to src/material/block/plant/PumpkinStemBlock.php diff --git a/src/material/block/plant/RedMushroom.php b/src/material/block/plant/RedMushroomBlock.php similarity index 100% rename from src/material/block/plant/RedMushroom.php rename to src/material/block/plant/RedMushroomBlock.php diff --git a/src/material/block/plant/Sapling.php b/src/material/block/plant/SaplingBlock.php similarity index 100% rename from src/material/block/plant/Sapling.php rename to src/material/block/plant/SaplingBlock.php diff --git a/src/material/block/plant/Sugarcane.php b/src/material/block/plant/SugarcaneBlock.php similarity index 100% rename from src/material/block/plant/Sugarcane.php rename to src/material/block/plant/SugarcaneBlock.php diff --git a/src/material/block/plant/TallGrass.php b/src/material/block/plant/TallGrassBlock.php similarity index 100% rename from src/material/block/plant/TallGrass.php rename to src/material/block/plant/TallGrassBlock.php diff --git a/src/material/block/plant/Wheat.php b/src/material/block/plant/WheatBlock.php similarity index 100% rename from src/material/block/plant/Wheat.php rename to src/material/block/plant/WheatBlock.php diff --git a/src/material/block/solid/Bedrock.php b/src/material/block/solid/BedrockBlock.php similarity index 100% rename from src/material/block/solid/Bedrock.php rename to src/material/block/solid/BedrockBlock.php diff --git a/src/material/block/solid/Bookshelf.php b/src/material/block/solid/BookshelfBlock.php similarity index 100% rename from src/material/block/solid/Bookshelf.php rename to src/material/block/solid/BookshelfBlock.php diff --git a/src/material/block/solid/Bricks.php b/src/material/block/solid/BricksBlock.php similarity index 100% rename from src/material/block/solid/Bricks.php rename to src/material/block/solid/BricksBlock.php diff --git a/src/material/block/solid/BurningFurnace.php b/src/material/block/solid/BurningFurnaceBlock.php similarity index 100% rename from src/material/block/solid/BurningFurnace.php rename to src/material/block/solid/BurningFurnaceBlock.php diff --git a/src/material/block/solid/Clay.php b/src/material/block/solid/ClayBlock.php similarity index 100% rename from src/material/block/solid/Clay.php rename to src/material/block/solid/ClayBlock.php diff --git a/src/material/block/solid/Coal.php b/src/material/block/solid/CoalBlock.php similarity index 100% rename from src/material/block/solid/Coal.php rename to src/material/block/solid/CoalBlock.php diff --git a/src/material/block/solid/Cobblestone.php b/src/material/block/solid/CobblestoneBlock.php similarity index 100% rename from src/material/block/solid/Cobblestone.php rename to src/material/block/solid/CobblestoneBlock.php diff --git a/src/material/block/solid/Diamond.php b/src/material/block/solid/DiamondBlock.php similarity index 100% rename from src/material/block/solid/Diamond.php rename to src/material/block/solid/DiamondBlock.php diff --git a/src/material/block/solid/Dirt.php b/src/material/block/solid/DirtBlock.php similarity index 100% rename from src/material/block/solid/Dirt.php rename to src/material/block/solid/DirtBlock.php diff --git a/src/material/block/solid/DoubleSlab.php b/src/material/block/solid/DoubleSlabBlock.php similarity index 100% rename from src/material/block/solid/DoubleSlab.php rename to src/material/block/solid/DoubleSlabBlock.php diff --git a/src/material/block/solid/DoubleWoodSlab.php b/src/material/block/solid/DoubleWoodSlabBlock.php similarity index 100% rename from src/material/block/solid/DoubleWoodSlab.php rename to src/material/block/solid/DoubleWoodSlabBlock.php diff --git a/src/material/block/solid/Furnace.php b/src/material/block/solid/FurnaceBlock.php similarity index 85% rename from src/material/block/solid/Furnace.php rename to src/material/block/solid/FurnaceBlock.php index 08e59116..b4b6a535 100644 --- a/src/material/block/solid/Furnace.php +++ b/src/material/block/solid/FurnaceBlock.php @@ -1,7 +1,7 @@ $target->x, "y" => $target->y, diff --git a/src/material/item/generic/Paper.php b/src/material/item/generic/PaperItem.php similarity index 100% rename from src/material/item/generic/Paper.php rename to src/material/item/generic/PaperItem.php diff --git a/src/material/item/generic/PumpkinSeeds.php b/src/material/item/generic/PumpkinSeedsItem.php similarity index 100% rename from src/material/item/generic/PumpkinSeeds.php rename to src/material/item/generic/PumpkinSeedsItem.php diff --git a/src/material/item/generic/Quartz.php b/src/material/item/generic/QuartzItem.php similarity index 100% rename from src/material/item/generic/Quartz.php rename to src/material/item/generic/QuartzItem.php diff --git a/src/material/item/generic/Redstone.php b/src/material/item/generic/RedstoneItem.php similarity index 100% rename from src/material/item/generic/Redstone.php rename to src/material/item/generic/RedstoneItem.php diff --git a/src/material/item/generic/Saddle.php b/src/material/item/generic/SaddleItem.php similarity index 100% rename from src/material/item/generic/Saddle.php rename to src/material/item/generic/SaddleItem.php diff --git a/src/material/item/generic/Slimeball.php b/src/material/item/generic/SlimeballItem.php similarity index 100% rename from src/material/item/generic/Slimeball.php rename to src/material/item/generic/SlimeballItem.php diff --git a/src/material/item/generic/Snowball.php b/src/material/item/generic/SnowballItem.php similarity index 100% rename from src/material/item/generic/Snowball.php rename to src/material/item/generic/SnowballItem.php diff --git a/src/material/item/generic/SpawnEgg.php b/src/material/item/generic/SpawnEggItem.php similarity index 100% rename from src/material/item/generic/SpawnEgg.php rename to src/material/item/generic/SpawnEggItem.php diff --git a/src/material/item/generic/Stick.php b/src/material/item/generic/StickItem.php similarity index 100% rename from src/material/item/generic/Stick.php rename to src/material/item/generic/StickItem.php diff --git a/src/material/item/generic/Sugar.php b/src/material/item/generic/SugarItem.php similarity index 100% rename from src/material/item/generic/Sugar.php rename to src/material/item/generic/SugarItem.php diff --git a/src/material/item/generic/Sugarcane.php b/src/material/item/generic/SugarcaneItem.php similarity index 100% rename from src/material/item/generic/Sugarcane.php rename to src/material/item/generic/SugarcaneItem.php diff --git a/src/material/item/generic/Wheat.php b/src/material/item/generic/WheatItem.php similarity index 100% rename from src/material/item/generic/Wheat.php rename to src/material/item/generic/WheatItem.php diff --git a/src/material/item/generic/WheatSeeds.php b/src/material/item/generic/WheatSeedsItem.php similarity index 100% rename from src/material/item/generic/WheatSeeds.php rename to src/material/item/generic/WheatSeedsItem.php diff --git a/src/material/item/generic/WoodenDoor.php b/src/material/item/generic/WoodenDoorItem.php similarity index 100% rename from src/material/item/generic/WoodenDoor.php rename to src/material/item/generic/WoodenDoorItem.php diff --git a/src/material/item/tool/Bow.php b/src/material/item/tool/BowItem.php similarity index 100% rename from src/material/item/tool/Bow.php rename to src/material/item/tool/BowItem.php diff --git a/src/material/item/tool/Clock.php b/src/material/item/tool/ClockItem.php similarity index 100% rename from src/material/item/tool/Clock.php rename to src/material/item/tool/ClockItem.php diff --git a/src/material/item/tool/Compass.php b/src/material/item/tool/CompassItem.php similarity index 100% rename from src/material/item/tool/Compass.php rename to src/material/item/tool/CompassItem.php diff --git a/src/material/item/tool/DiamondAxe.php b/src/material/item/tool/DiamondAxeItem.php similarity index 100% rename from src/material/item/tool/DiamondAxe.php rename to src/material/item/tool/DiamondAxeItem.php diff --git a/src/material/item/tool/DiamondHoe.php b/src/material/item/tool/DiamondHoeItem.php similarity index 100% rename from src/material/item/tool/DiamondHoe.php rename to src/material/item/tool/DiamondHoeItem.php diff --git a/src/material/item/tool/DiamondPickaxe.php b/src/material/item/tool/DiamondPickaxeItem.php similarity index 100% rename from src/material/item/tool/DiamondPickaxe.php rename to src/material/item/tool/DiamondPickaxeItem.php diff --git a/src/material/item/tool/DiamondShovel.php b/src/material/item/tool/DiamondShovelItem.php similarity index 100% rename from src/material/item/tool/DiamondShovel.php rename to src/material/item/tool/DiamondShovelItem.php diff --git a/src/material/item/tool/DiamondSword.php b/src/material/item/tool/DiamondSwordItem.php similarity index 100% rename from src/material/item/tool/DiamondSword.php rename to src/material/item/tool/DiamondSwordItem.php diff --git a/src/material/item/tool/FlintSteel.php b/src/material/item/tool/FlintSteelItem.php similarity index 100% rename from src/material/item/tool/FlintSteel.php rename to src/material/item/tool/FlintSteelItem.php diff --git a/src/material/item/tool/GoldenAxe.php b/src/material/item/tool/GoldenAxeItem.php similarity index 100% rename from src/material/item/tool/GoldenAxe.php rename to src/material/item/tool/GoldenAxeItem.php diff --git a/src/material/item/tool/GoldenHoe.php b/src/material/item/tool/GoldenHoeItem.php similarity index 100% rename from src/material/item/tool/GoldenHoe.php rename to src/material/item/tool/GoldenHoeItem.php diff --git a/src/material/item/tool/GoldenPickaxe.php b/src/material/item/tool/GoldenPickaxeItem.php similarity index 100% rename from src/material/item/tool/GoldenPickaxe.php rename to src/material/item/tool/GoldenPickaxeItem.php diff --git a/src/material/item/tool/GoldenShovel.php b/src/material/item/tool/GoldenShovelItem.php similarity index 100% rename from src/material/item/tool/GoldenShovel.php rename to src/material/item/tool/GoldenShovelItem.php diff --git a/src/material/item/tool/GoldenSword.php b/src/material/item/tool/GoldenSwordItem.php similarity index 100% rename from src/material/item/tool/GoldenSword.php rename to src/material/item/tool/GoldenSwordItem.php diff --git a/src/material/item/tool/IronAxe.php b/src/material/item/tool/IronAxeItem.php similarity index 100% rename from src/material/item/tool/IronAxe.php rename to src/material/item/tool/IronAxeItem.php diff --git a/src/material/item/tool/IronHoe.php b/src/material/item/tool/IronHoeItem.php similarity index 100% rename from src/material/item/tool/IronHoe.php rename to src/material/item/tool/IronHoeItem.php diff --git a/src/material/item/tool/IronPickaxe.php b/src/material/item/tool/IronPickaxeItem.php similarity index 100% rename from src/material/item/tool/IronPickaxe.php rename to src/material/item/tool/IronPickaxeItem.php diff --git a/src/material/item/tool/IronShovel.php b/src/material/item/tool/IronShovelItem.php similarity index 100% rename from src/material/item/tool/IronShovel.php rename to src/material/item/tool/IronShovelItem.php diff --git a/src/material/item/tool/IronSword.php b/src/material/item/tool/IronSwordItem.php similarity index 100% rename from src/material/item/tool/IronSword.php rename to src/material/item/tool/IronSwordItem.php diff --git a/src/material/item/tool/Shears.php b/src/material/item/tool/ShearsItem.php similarity index 100% rename from src/material/item/tool/Shears.php rename to src/material/item/tool/ShearsItem.php diff --git a/src/material/item/tool/StoneAxe.php b/src/material/item/tool/StoneAxeItem.php similarity index 100% rename from src/material/item/tool/StoneAxe.php rename to src/material/item/tool/StoneAxeItem.php diff --git a/src/material/item/tool/StoneHoe.php b/src/material/item/tool/StoneHoeItem.php similarity index 100% rename from src/material/item/tool/StoneHoe.php rename to src/material/item/tool/StoneHoeItem.php diff --git a/src/material/item/tool/StonePickaxe.php b/src/material/item/tool/StonePickaxeItem.php similarity index 100% rename from src/material/item/tool/StonePickaxe.php rename to src/material/item/tool/StonePickaxeItem.php diff --git a/src/material/item/tool/StoneShovel.php b/src/material/item/tool/StoneShovelItem.php similarity index 100% rename from src/material/item/tool/StoneShovel.php rename to src/material/item/tool/StoneShovelItem.php diff --git a/src/material/item/tool/StoneSword.php b/src/material/item/tool/StoneSwordItem.php similarity index 100% rename from src/material/item/tool/StoneSword.php rename to src/material/item/tool/StoneSwordItem.php diff --git a/src/material/item/tool/WoodenAxe.php b/src/material/item/tool/WoodenAxeItem.php similarity index 100% rename from src/material/item/tool/WoodenAxe.php rename to src/material/item/tool/WoodenAxeItem.php diff --git a/src/material/item/tool/WoodenHoe.php b/src/material/item/tool/WoodenHoeItem.php similarity index 100% rename from src/material/item/tool/WoodenHoe.php rename to src/material/item/tool/WoodenHoeItem.php diff --git a/src/material/item/tool/WoodenPickaxe.php b/src/material/item/tool/WoodenPickaxeItem.php similarity index 100% rename from src/material/item/tool/WoodenPickaxe.php rename to src/material/item/tool/WoodenPickaxeItem.php diff --git a/src/material/item/tool/WoodenShovel.php b/src/material/item/tool/WoodenShovelItem.php similarity index 100% rename from src/material/item/tool/WoodenShovel.php rename to src/material/item/tool/WoodenShovelItem.php diff --git a/src/material/item/tool/WoodenSword.php b/src/material/item/tool/WoodenSwordItem.php similarity index 100% rename from src/material/item/tool/WoodenSword.php rename to src/material/item/tool/WoodenSwordItem.php diff --git a/src/plugin/DummyPlugin.php b/src/plugin/DummyPlugin.php new file mode 100644 index 00000000..da2cfbef --- /dev/null +++ b/src/plugin/DummyPlugin.php @@ -0,0 +1,13 @@ +chunks as $index => $chunk){ + foreach($this->chunks as $index => $chunk){ //TODO fix variables($X, $Z are undefined) $this->getXZ($index, $X, $Z); $this->saveChunk($X, $Z); } diff --git a/src/pmf/Plugin.php b/src/pmf/PMFPlugin.php similarity index 100% rename from src/pmf/Plugin.php rename to src/pmf/PMFPlugin.php diff --git a/src/utils/pthreads.php b/src/utils/AsyncMultipleQueue.php similarity index 100% rename from src/utils/pthreads.php rename to src/utils/AsyncMultipleQueue.php diff --git a/src/utils/Java.php b/src/utils/Java.php index 5f5fe667..267cb030 100644 --- a/src/utils/Java.php +++ b/src/utils/Java.php @@ -1,6 +1,6 @@ 0, - "a" => 0, - "beta" => 1, - "b" => 1, - "final" => 2, - "f" => 2, - ]; - private $stage; - private $major; - private $release; - private $minor; + private $development = false; public function __construct($version = MAJOR_VERSION){ - if(is_int($version)){ - $this->minor = $version & 0x1F; - $this->major = ($version >> 5) & 0x0F; - $this->generation = ($version >> 9) & 0x0F; - $this->stage = array_search(($version >> 13) & 0x0F, VersionString::$stageOrder, true); - }else{ - $version = preg_split("/([A-Za-z]*)[ _\-]([0-9]*)\.([0-9]*)\.{0,1}([0-9]*)(dev|)/", $version, -1, PREG_SPLIT_DELIM_CAPTURE); - $this->stage = strtolower($version[1]); //0-15 - $this->generation = (int) $version[2]; //0-15 - $this->major = (int) $version[3]; //0-15 - $this->minor = (int) $version[4]; //0-31 - $this->development = $version[5] === "dev" ? true : false; - } - } - - public function getStage(){ - return $this->stage; - } - - public function getGeneration(){ - return $this->generation; - } - - public function getMajor(){ - return $this->major; - } - - public function getMinor(){ - return $this->minor; + $this->development = Utils::endsWith($version, "dev"); } public function isDev(){ @@ -53,36 +13,6 @@ class VersionString{ } public function __toString(){ - return $this->get(); - } - - public function get(){ - return ucfirst($this->stage) . "_" . $this->getRelease() . ($this->development === true ? "dev" : ""); - } - - public function getRelease(){ - return $this->generation . "." . $this->major . "." . $this->minor; - } - - public function compare($target, $diff = false){ - if(($target instanceof VersionString) === false){ - $target = new VersionString($target); - } - $number = $this->getNumber(); - $tNumber = $target->getNumber(); - if($diff === true){ - return $tNumber - $number; - } - if($number > $tNumber){ - return -1; //Target is older - }elseif($number < $tNumber){ - return 1; //Target is newer - }else{ - return 0; //Same version - } - } - - public function getNumber(){ - return (int) (VersionString::$stageOrder[$this->stage] << 13) + ($this->generation << 9) + ($this->major << 5) + $this->minor; + return MAJOR_VERSION; } } \ No newline at end of file diff --git a/src/world/MocingObjectPosition.php b/src/world/MovingObjectPosition.php similarity index 100% rename from src/world/MocingObjectPosition.php rename to src/world/MovingObjectPosition.php diff --git a/src/world/generator/SuperflatGenerator.php b/src/world/generator/SuperflatGenerator.php index cf7ac2f1..8a317c43 100644 --- a/src/world/generator/SuperflatGenerator.php +++ b/src/world/generator/SuperflatGenerator.php @@ -35,7 +35,7 @@ class SuperflatGenerator implements LevelGenerator{ $this->populators[] = new MineshaftPopulator(isset($this->options["mineshaft"]["chance"]) ? floatval($this->options["mineshaft"]["chance"]) : 0.01); }*/ } - + public function parsePreset($preset){ $this->preset = $preset; $preset = explode(";", $preset);