From da1d6d8e979ecba29dc47fbf519ca40113972cdf Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 30 Mar 2026 12:54:00 -0500 Subject: [PATCH] refactor: split java libs and nbt into separate projects --- meson.build | 4 ++ .../Minecraft.Client/Common/Consoles_App.cpp | 4 +- .../Minecraft.Client/Common/ShutdownManager.h | 2 +- .../Source Files/Audio/Consoles_SoundEngine.h | 1 + .../Common/Source Files/Audio/SoundEngine.cpp | 6 +- .../Source Files/DLC/DLCGameRulesHeader.cpp | 4 +- .../GameRules/GameRuleManager.cpp | 2 +- .../LevelGeneration/ConsoleSchematicFile.cpp | 6 +- .../Network/GameNetworkManager.cpp | 2 +- .../Network/NetworkPlayerInterface.h | 2 +- .../Network/PlatformNetworkManagerStub.cpp | 2 +- .../Common/Source Files/Network}/Socket.cpp | 29 ++++---- .../Common/Source Files/Network}/Socket.h | 9 ++- .../Source Files/Tutorial/FullTutorial.cpp | 4 +- .../Tutorial/Hints/LookAtEntityHint.h | 2 +- .../UI/All Platforms/ArchiveFile.h | 2 +- .../UI/All Platforms/IUIScene_AnvilMenu.cpp | 2 +- .../All Platforms/IUIScene_CraftingMenu.cpp | 18 ++--- .../All Platforms/IUIScene_CreativeMenu.cpp | 2 +- .../Source Files/UI/Controls/UIControl.cpp | 2 +- .../UI/Controls/UIControl_Base.cpp | 2 +- .../Controls/UIControl_PlayerSkinPreview.cpp | 4 +- .../UIScene_MainMenu.cpp | 4 +- .../Containers/UIScene_CreativeMenu.cpp | 2 +- .../Minecraft.Client/Header Files/stdafx.h | 4 +- minecraft/Minecraft.Client/Linux/LinuxGL.cpp | 6 +- .../Linux/Linux_Minecraft.cpp | 2 +- .../Source Files/BufferedImage.cpp | 2 +- .../Source Files/glWrapper.cpp | 8 +-- .../Source Files/Windows64_Minecraft.cpp | 2 +- minecraft/Minecraft.Client/meson.build | 2 + .../net/minecraft/client/Camera.cpp | 10 +-- .../net/minecraft/client/Camera.h | 4 +- .../net/minecraft/client/Lighting.cpp | 2 +- .../net/minecraft/client/MemoryTracker.cpp | 6 +- .../net/minecraft/client/Minecraft.cpp | 6 +- .../net/minecraft/client/Minecraft.h | 2 +- .../net/minecraft/client/Options.cpp | 14 ++-- .../net/minecraft/client/Options.h | 2 +- .../net/minecraft/client/ProgressRenderer.cpp | 2 +- .../net/minecraft/client/Timer.cpp | 2 +- .../client/gui/CreateWorldScreen.cpp | 2 +- .../net/minecraft/client/gui/Font.cpp | 4 +- .../net/minecraft/client/gui/Gui.cpp | 4 +- .../minecraft/client/gui/MerchantScreen.cpp | 4 +- .../net/minecraft/client/gui/PauseScreen.cpp | 2 +- .../client/gui/ScrolledSelectionList.cpp | 2 +- .../gui/achievement/AchievementPopup.cpp | 2 +- .../gui/achievement/AchievementScreen.cpp | 4 +- .../client/gui/inventory/BeaconScreen.cpp | 4 +- .../client/gui/particle/GuiParticle.cpp | 2 +- .../net/minecraft/client/model/BatModel.cpp | 20 +++--- .../net/minecraft/client/model/BlazeModel.cpp | 16 ++--- .../net/minecraft/client/model/BoatModel.cpp | 8 +-- .../net/minecraft/client/model/BookModel.cpp | 4 +- .../minecraft/client/model/ChickenModel.cpp | 8 +-- .../minecraft/client/model/CreeperModel.cpp | 8 +-- .../net/minecraft/client/model/GhastModel.cpp | 2 +- .../minecraft/client/model/HumanoidModel.cpp | 66 +++++++++---------- .../minecraft/client/model/LeashKnotModel.cpp | 4 +- .../minecraft/client/model/MinecartModel.cpp | 10 +-- .../net/minecraft/client/model/ModelHorse.cpp | 12 ++-- .../minecraft/client/model/OcelotModel.cpp | 38 +++++------ .../minecraft/client/model/QuadrupedModel.cpp | 6 +- .../client/model/SilverfishModel.cpp | 4 +- .../client/model/SkeletonHeadModel.cpp | 4 +- .../net/minecraft/client/model/SkiModel.cpp | 4 +- .../minecraft/client/model/SnowManModel.cpp | 8 +-- .../minecraft/client/model/SpiderModel.cpp | 26 ++++---- .../net/minecraft/client/model/SquidModel.cpp | 6 +- .../client/model/VillagerGolemModel.cpp | 4 +- .../minecraft/client/model/VillagerModel.cpp | 6 +- .../client/model/VillagerZombieModel.cpp | 8 +-- .../net/minecraft/client/model/WitchModel.cpp | 4 +- .../client/model/WitherBossModel.cpp | 12 ++-- .../net/minecraft/client/model/WolfModel.cpp | 24 +++---- .../minecraft/client/model/ZombieModel.cpp | 8 +-- .../client/model/dragon/DragonModel.cpp | 30 ++++----- .../net/minecraft/client/model/geom/Model.h | 2 +- .../minecraft/client/model/geom/ModelPart.cpp | 2 +- .../client/multiplayer/ClientConnection.cpp | 2 +- .../multiplayer/MultiPlayerChunkCache.cpp | 2 +- .../client/multiplayer/MultiPlayerLevel.cpp | 2 +- .../client/multiplayer/MultiPlayerLevel.h | 2 +- .../multiplayer/MultiPlayerLocalPlayer.cpp | 2 +- .../client/particle/BubbleParticle.cpp | 4 +- .../client/particle/CritParticle.cpp | 2 +- .../client/particle/CritParticle2.cpp | 2 +- .../client/particle/DragonBreathParticle.cpp | 2 +- .../client/particle/DripParticle.cpp | 2 +- .../particle/EnchantmentTableParticle.cpp | 2 +- .../client/particle/EnderParticle.cpp | 4 +- .../client/particle/ExplodeParticle.cpp | 4 +- .../client/particle/FireworksParticles.cpp | 6 +- .../client/particle/FireworksParticles.h | 2 +- .../client/particle/FlameParticle.cpp | 4 +- .../client/particle/HugeExplosionParticle.cpp | 2 +- .../particle/HugeExplosionSeedParticle.cpp | 2 +- .../client/particle/LavaParticle.cpp | 4 +- .../client/particle/NetherPortalParticle.cpp | 4 +- .../client/particle/NoteParticle.cpp | 6 +- .../minecraft/client/particle/Particle.cpp | 4 +- .../client/particle/ParticleEngine.cpp | 2 +- .../client/particle/PlayerCloudParticle.cpp | 2 +- .../client/particle/RedDustParticle.cpp | 2 +- .../client/particle/SmokeParticle.cpp | 2 +- .../client/particle/SnowShovelParticle.cpp | 2 +- .../client/particle/SpellParticle.cpp | 2 +- .../client/particle/SuspendedParticle.cpp | 4 +- .../client/particle/SuspendedTownParticle.cpp | 4 +- .../client/particle/WaterDropParticle.cpp | 2 +- .../minecraft/client/player/LocalPlayer.cpp | 18 ++--- .../client/renderer/GameRenderer.cpp | 24 +++---- .../client/renderer/ItemInHandRenderer.cpp | 34 +++++----- .../client/renderer/LevelRenderer.cpp | 22 +++---- .../minecraft/client/renderer/LevelRenderer.h | 6 +- .../client/renderer/OffsettedRenderList.cpp | 2 +- .../minecraft/client/renderer/Tesselator.cpp | 6 +- .../minecraft/client/renderer/Textures.cpp | 6 +- .../net/minecraft/client/renderer/Textures.h | 2 + .../client/renderer/TileRenderer.cpp | 50 +++++++------- .../client/renderer/culling/Frustum.cpp | 2 +- .../renderer/culling/ViewportCuller.cpp | 12 ++-- .../renderer/entity/EnderDragonRenderer.cpp | 10 +-- .../renderer/entity/EntityRenderDispatcher.h | 2 +- .../renderer/entity/ExperienceOrbRenderer.cpp | 6 +- .../renderer/entity/FishingHookRenderer.cpp | 8 +-- .../renderer/entity/ItemFrameRenderer.cpp | 2 +- .../client/renderer/entity/ItemRenderer.cpp | 2 +- .../renderer/entity/LivingEntityRenderer.cpp | 4 +- .../renderer/entity/MinecartRenderer.cpp | 2 +- .../client/renderer/entity/MobRenderer.cpp | 2 +- .../renderer/entity/PaintingRenderer.cpp | 2 +- .../client/renderer/entity/PlayerRenderer.cpp | 6 +- .../renderer/entity/VillagerGolemRenderer.cpp | 2 +- .../client/renderer/entity/ZombieRenderer.cpp | 2 +- .../texture/PreStitchedTextureMap.cpp | 2 +- .../client/renderer/texture/Texture.cpp | 2 +- .../renderer/texture/custom/ClockTexture.cpp | 2 +- .../texture/custom/CompassTexture.cpp | 14 ++-- .../renderer/tileentity/BeaconRenderer.cpp | 16 ++--- .../renderer/tileentity/ChestRenderer.cpp | 2 +- .../tileentity/EnchantTableRenderer.cpp | 6 +- .../tileentity/EnderChestRenderer.cpp | 2 +- .../tileentity/TheEndPortalRenderer.cpp | 4 +- .../tileentity/TileEntityRenderDispatcher.h | 2 +- .../client/skins/AbstractTexturePack.cpp | 2 +- .../client/skins/TexturePackRepository.cpp | 2 +- .../minecraft/client/title/TitleScreen.cpp | 8 +-- .../net/minecraft/server/MinecraftServer.cpp | 6 +- .../net/minecraft/server/PlayerList.cpp | 2 +- .../minecraft/server/level/EntityTracker.h | 2 +- .../minecraft/server/level/PlayerChunkMap.cpp | 2 +- .../minecraft/server/level/PlayerChunkMap.h | 2 +- .../minecraft/server/level/ServerChunkCache.h | 4 +- .../net/minecraft/server/level/ServerLevel.h | 2 +- .../minecraft/server/level/ServerPlayer.cpp | 4 +- .../server/network/PlayerConnection.cpp | 4 +- .../server/network/PlayerConnection.h | 2 +- .../server/network/ServerConnection.cpp | 2 +- .../ConsoleHelpers/ArrayWithLength.h | 6 +- .../ConsoleSaveFileConverter.h | 2 +- .../ConsoleSaveFileInputStream.cpp | 2 +- .../ConsoleSaveFileInputStream.h | 2 +- .../ConsoleSaveFileOriginal.cpp | 2 +- .../ConsoleSaveFileOutputStream.cpp | 2 +- .../ConsoleSaveFileOutputStream.h | 2 +- .../ConsoleSaveFileSplit.cpp | 2 +- .../ConsoleSaveFileIO/FileHeader.h | 2 +- .../ConsoleHelpers/Definitions.h | 10 --- .../PathHelper.h | 0 .../ConsoleHelpers/StringHelpers.h | 4 +- .../ConsoleJavaLibs/SocketAddress.h | 3 - .../Minecraft.World/Header Files/stdafx.h | 6 +- minecraft/Minecraft.World/meson.build | 2 + .../net/minecraft/SharedConstants.cpp | 4 +- .../net/minecraft/SharedConstants.h | 2 +- .../net/minecraft/locale/Language.cpp | 4 +- .../net/minecraft/network/Connection.cpp | 4 +- .../net/minecraft/network/Connection.h | 8 +-- .../network/packet/AddEntityPacket.cpp | 2 +- .../network/packet/AddExperienceOrbPacket.cpp | 2 +- .../network/packet/AddGlobalEntityPacket.cpp | 2 +- .../minecraft/network/packet/AddMobPacket.cpp | 2 +- .../network/packet/AddPaintingPacket.cpp | 2 +- .../network/packet/AddPlayerPacket.cpp | 2 +- .../network/packet/AnimatePacket.cpp | 2 +- .../network/packet/AwardStatPacket.cpp | 2 +- .../packet/BlockRegionUpdatePacket.cpp | 2 +- .../network/packet/ChunkTilesUpdatePacket.cpp | 2 +- .../packet/ChunkVisibilityAreaPacket.cpp | 2 +- .../network/packet/ChunkVisibilityPacket.cpp | 2 +- .../network/packet/ComplexItemDataPacket.cpp | 2 +- .../network/packet/ContainerAckPacket.cpp | 2 +- .../packet/ContainerButtonClickPacket.cpp | 2 +- .../network/packet/ContainerClickPacket.cpp | 2 +- .../network/packet/ContainerClosePacket.cpp | 2 +- .../network/packet/ContainerOpenPacket.cpp | 2 +- .../packet/ContainerSetContentPacket.cpp | 6 +- .../packet/ContainerSetContentPacket.h | 2 +- .../network/packet/ContainerSetDataPacket.cpp | 2 +- .../network/packet/ContainerSetSlotPacket.cpp | 2 +- .../network/packet/CraftItemPacket.cpp | 2 +- .../network/packet/CustomPayloadPacket.cpp | 2 +- .../network/packet/DebugOptionsPacket.cpp | 2 +- .../network/packet/DisconnectPacket.cpp | 2 +- .../packet/EntityActionAtPositionPacket.cpp | 2 +- .../network/packet/EntityEventPacket.cpp | 2 +- .../network/packet/ExplodePacket.cpp | 2 +- .../network/packet/GameCommandPacket.cpp | 2 +- .../network/packet/GameEventPacket.cpp | 2 +- .../network/packet/GetInfoPacket.cpp | 2 +- .../network/packet/InteractPacket.cpp | 2 +- .../network/packet/KeepAlivePacket.cpp | 2 +- .../network/packet/KickPlayerPacket.cpp | 2 +- .../network/packet/LevelEventPacket.cpp | 2 +- .../network/packet/LevelSoundPacket.cpp | 6 +- .../minecraft/network/packet/LoginPacket.cpp | 2 +- .../network/packet/MoveEntityPacket.cpp | 2 +- .../network/packet/MoveEntityPacketSmall.cpp | 2 +- .../network/packet/MovePlayerPacket.cpp | 2 +- .../net/minecraft/network/packet/Packet.cpp | 6 +- .../net/minecraft/network/packet/Packet.h | 3 + .../network/packet/PlayerActionPacket.cpp | 2 +- .../network/packet/PlayerCommandPacket.cpp | 2 +- .../network/packet/PlayerInfoPacket.cpp | 2 +- .../network/packet/PlayerInputPacket.cpp | 2 +- .../network/packet/PreLoginPacket.cpp | 2 +- .../network/packet/RemoveEntitiesPacket.cpp | 2 +- .../network/packet/RemoveMobEffectPacket.cpp | 2 +- .../network/packet/RespawnPacket.cpp | 2 +- .../network/packet/RotateHeadPacket.h | 2 +- .../packet/ServerSettingsChangedPacket.cpp | 2 +- .../network/packet/SetCarriedItemPacket.cpp | 2 +- .../packet/SetCreativeModeSlotPacket.cpp | 2 +- .../network/packet/SetEntityDataPacket.cpp | 2 +- .../network/packet/SetEntityLinkPacket.cpp | 2 +- .../network/packet/SetEntityMotionPacket.cpp | 2 +- .../network/packet/SetEquippedItemPacket.cpp | 2 +- .../network/packet/SetExperiencePacket.cpp | 2 +- .../network/packet/SetHealthPacket.cpp | 2 +- .../network/packet/SetSpawnPositionPacket.cpp | 2 +- .../network/packet/SetTimePacket.cpp | 2 +- .../network/packet/SignUpdatePacket.cpp | 2 +- .../network/packet/TakeItemEntityPacket.cpp | 2 +- .../network/packet/TeleportEntityPacket.cpp | 2 +- .../packet/TextureAndGeometryChangePacket.cpp | 2 +- .../packet/TextureAndGeometryPacket.cpp | 2 +- .../network/packet/TextureChangePacket.cpp | 2 +- .../network/packet/TexturePacket.cpp | 2 +- .../network/packet/TileEntityDataPacket.cpp | 2 +- .../network/packet/TileEventPacket.cpp | 2 +- .../network/packet/TileUpdatePacket.cpp | 2 +- .../network/packet/TradeItemPacket.cpp | 2 +- .../packet/UpdateGameRuleProgressPacket.cpp | 2 +- .../network/packet/UpdateMobEffectPacket.cpp | 2 +- .../network/packet/UpdateProgressPacket.cpp | 2 +- .../network/packet/UseItemPacket.cpp | 2 +- .../net/minecraft/network/packet/XZPacket.cpp | 2 +- .../net/minecraft/util/Mth.cpp | 14 ++-- .../net/minecraft/world/SimpleContainer.cpp | 2 +- .../net/minecraft/world/SimpleContainer.h | 2 +- .../net/minecraft/world/entity/Entity.cpp | 18 ++--- .../net/minecraft/world/entity/Entity.h | 8 +-- .../net/minecraft/world/entity/EntityIO.cpp | 6 +- .../net/minecraft/world/entity/EntityIO.h | 2 +- .../minecraft/world/entity/ExperienceOrb.cpp | 4 +- .../minecraft/world/entity/HangingEntity.cpp | 2 +- .../net/minecraft/world/entity/ItemFrame.cpp | 2 +- .../minecraft/world/entity/LivingEntity.cpp | 34 +++++----- .../net/minecraft/world/entity/LivingEntity.h | 4 +- .../net/minecraft/world/entity/Mob.cpp | 14 ++-- .../net/minecraft/world/entity/Mob.h | 4 +- .../net/minecraft/world/entity/Painting.cpp | 2 +- .../minecraft/world/entity/PathfinderMob.cpp | 6 +- .../world/entity/SyncedEntityData.cpp | 4 +- .../world/entity/ai/control/LookControl.cpp | 4 +- .../world/entity/ai/control/MoveControl.cpp | 2 +- .../entity/ai/goal/ControlledByPlayerGoal.cpp | 6 +- .../entity/ai/goal/OcelotSitOnTileGoal.cpp | 2 +- .../entity/ai/goal/RandomLookAroundGoal.cpp | 2 +- .../world/entity/ai/village/VillageSiege.cpp | 4 +- .../minecraft/world/entity/ambient/Bat.cpp | 2 +- .../minecraft/world/entity/animal/Animal.cpp | 6 +- .../minecraft/world/entity/animal/Chicken.cpp | 2 +- .../net/minecraft/world/entity/animal/Cow.cpp | 2 +- .../world/entity/animal/EntityHorse.cpp | 8 +-- .../net/minecraft/world/entity/animal/Pig.cpp | 2 +- .../minecraft/world/entity/animal/Sheep.cpp | 8 +-- .../minecraft/world/entity/animal/Squid.cpp | 22 +++---- .../world/entity/animal/WaterAnimal.cpp | 2 +- .../minecraft/world/entity/animal/Wolf.cpp | 16 ++--- .../entity/boss/enderdragon/EnderDragon.cpp | 48 +++++++------- .../world/entity/boss/wither/WitherBoss.cpp | 8 +-- .../net/minecraft/world/entity/item/Boat.cpp | 16 ++--- .../world/entity/item/FallingTile.cpp | 2 +- .../world/entity/item/ItemEntity.cpp | 6 +- .../minecraft/world/entity/item/Minecart.cpp | 10 +-- .../world/entity/item/MinecartContainer.cpp | 4 +- .../world/entity/item/MinecartContainer.h | 2 +- .../minecraft/world/entity/item/PrimedTnt.cpp | 6 +- .../minecraft/world/entity/monster/Blaze.cpp | 2 +- .../world/entity/monster/EnderMan.cpp | 2 +- .../minecraft/world/entity/monster/Ghast.cpp | 4 +- .../world/entity/monster/Monster.cpp | 4 +- .../world/entity/monster/PigZombie.cpp | 2 +- .../minecraft/world/entity/monster/Slime.cpp | 4 +- .../minecraft/world/entity/monster/Spider.cpp | 2 +- .../minecraft/world/entity/monster/Zombie.cpp | 2 +- .../minecraft/world/entity/npc/Villager.cpp | 2 +- .../world/entity/player/Abilities.cpp | 2 +- .../world/entity/player/Inventory.cpp | 18 ++--- .../minecraft/world/entity/player/Inventory.h | 6 +- .../minecraft/world/entity/player/Player.cpp | 32 ++++----- .../minecraft/world/entity/player/Player.h | 2 +- .../world/entity/projectile/Arrow.cpp | 32 ++++----- .../entity/projectile/DragonFireball.cpp | 2 +- .../entity/projectile/EyeOfEnderSignal.cpp | 10 +-- .../world/entity/projectile/Fireball.cpp | 6 +- .../projectile/FireworksRocketEntity.cpp | 8 +-- .../world/entity/projectile/FishingHook.cpp | 20 +++--- .../world/entity/projectile/Throwable.cpp | 24 +++---- .../world/entity/projectile/ThrownEgg.cpp | 2 +- .../entity/projectile/ThrownExpBottle.cpp | 2 +- .../world/entity/projectile/ThrownPotion.cpp | 2 +- .../net/minecraft/world/food/FoodData.cpp | 2 +- .../world/inventory/AbstractContainerMenu.cpp | 2 +- .../world/inventory/AbstractContainerMenu.h | 2 +- .../world/inventory/CraftingContainer.cpp | 2 +- .../world/inventory/CraftingContainer.h | 2 +- .../world/inventory/EnchantmentMenu.h | 2 +- .../world/inventory/FurnaceResultSlot.cpp | 2 +- .../minecraft/world/inventory/MenuBackup.cpp | 8 +-- .../minecraft/world/inventory/MenuBackup.h | 2 +- .../world/inventory/MerchantContainer.cpp | 2 +- .../world/inventory/MerchantContainer.h | 2 +- .../net/minecraft/world/item/ArmorItem.cpp | 2 +- .../net/minecraft/world/item/BoatItem.cpp | 8 +-- .../net/minecraft/world/item/BucketItem.cpp | 2 +- .../minecraft/world/item/DyePowderItem.cpp | 2 +- .../net/minecraft/world/item/EggItem.cpp | 2 +- .../net/minecraft/world/item/Item.cpp | 4 +- .../net/minecraft/world/item/ItemInstance.cpp | 2 +- .../net/minecraft/world/item/ItemInstance.h | 2 +- .../net/minecraft/world/item/MapItem.cpp | 2 +- .../net/minecraft/world/item/PotionItem.cpp | 4 +- .../world/item/alchemy/PotionBrewing.cpp | 2 +- .../minecraft/world/item/crafting/Recipes.cpp | 4 +- .../item/enchantment/EnchantmentHelper.cpp | 8 +-- .../item/enchantment/EnchantmentHelper.h | 6 +- .../net/minecraft/world/level/Level.cpp | 20 +++--- .../net/minecraft/world/level/Level.h | 6 +- .../world/level/LevelConflictException.h | 2 +- .../net/minecraft/world/level/biome/Biome.cpp | 2 +- .../world/level/biome/BiomeCache.cpp | 2 +- .../minecraft/world/level/biome/BiomeCache.h | 2 +- .../world/level/biome/BiomeSource.cpp | 2 +- .../world/level/biome/FixedBiomeSource.cpp | 2 +- .../level/biome/TheEndBiomeDecorator.cpp | 4 +- .../world/level/chunk/EmptyLevelChunk.cpp | 2 +- .../world/level/chunk/LevelChunk.cpp | 2 +- .../world/level/chunk/WaterLevelChunk.cpp | 2 +- .../storage/ChunkStorageProfileDecorator.cpp | 2 +- .../chunk/storage/McRegionChunkStorage.h | 2 +- .../world/level/chunk/storage/NbtSlotFile.cpp | 2 +- .../world/level/chunk/storage/NbtSlotFile.h | 4 +- .../level/chunk/storage/OldChunkStorage.cpp | 4 +- .../level/chunk/storage/OldChunkStorage.h | 6 +- .../world/level/chunk/storage/RegionFile.cpp | 6 +- .../world/level/chunk/storage/RegionFile.h | 2 +- .../level/chunk/storage/RegionFileCache.cpp | 2 +- .../level/chunk/storage/RegionFileCache.h | 4 +- .../world/level/chunk/storage/ZoneFile.cpp | 4 +- .../world/level/chunk/storage/ZoneIo.cpp | 2 +- .../level/chunk/storage/ZonedChunkStorage.cpp | 4 +- .../level/chunk/storage/ZonedChunkStorage.h | 2 +- .../world/level/dimension/Dimension.cpp | 8 +-- .../world/level/dimension/TheEndDimension.cpp | 2 +- .../world/level/levelgen/CanyonFeature.cpp | 4 +- .../world/level/levelgen/DungeonFeature.cpp | 8 +-- .../level/levelgen/HellRandomLevelSource.cpp | 2 +- .../world/level/levelgen/LargeCaveFeature.cpp | 8 +-- .../level/levelgen/LargeHellCaveFeature.cpp | 8 +-- .../level/levelgen/feature/CaveFeature.cpp | 6 +- .../levelgen/feature/MegaTreeFeature.cpp | 2 +- .../level/levelgen/feature/OreFeature.cpp | 10 +-- .../levelgen/feature/SwampTreeFeature.cpp | 2 +- .../level/levelgen/structure/BoundingBox.cpp | 2 +- .../levelgen/structure/MineShaftFeature.cpp | 2 +- .../levelgen/structure/MineShaftPieces.cpp | 2 +- .../levelgen/structure/SkyIslandDimension.cpp | 2 +- .../levelgen/structure/StrongholdFeature.cpp | 8 +-- .../levelgen/structure/StructurePiece.cpp | 2 +- .../levelgen/structure/VillagePieces.cpp | 2 +- .../level/newbiome/layer/FuzzyZoomLayer.cpp | 2 +- .../level/newbiome/layer/SmoothZoomLayer.cpp | 2 +- .../level/newbiome/layer/VoronoiZoom.cpp | 2 +- .../world/level/newbiome/layer/ZoomLayer.cpp | 2 +- .../world/level/pathfinder/BinaryHeap.cpp | 2 +- .../world/level/pathfinder/BinaryHeap.h | 2 +- .../world/level/pathfinder/PathFinder.h | 2 +- .../level/saveddata/MapItemSavedData.cpp | 2 +- .../world/level/saveddata/SavedData.h | 2 +- .../level/storage/DirectoryLevelStorage.cpp | 10 +-- .../level/storage/DirectoryLevelStorage.h | 2 +- .../storage/DirectoryLevelStorageSource.cpp | 4 +- .../storage/DirectoryLevelStorageSource.h | 2 +- .../world/level/storage/LevelData.cpp | 4 +- .../level/storage/McRegionLevelStorage.cpp | 2 +- .../storage/McRegionLevelStorageSource.cpp | 4 +- .../storage/McRegionLevelStorageSource.h | 4 +- .../level/storage/MemoryLevelStorage.cpp | 2 +- .../world/level/storage/MemoryLevelStorage.h | 2 +- .../world/level/storage/SavedDataStorage.cpp | 4 +- .../world/level/tile/BrewingStandTile.cpp | 2 +- .../world/level/tile/BrewingStandTile.h | 2 +- .../world/level/tile/CauldronTile.cpp | 2 +- .../minecraft/world/level/tile/CauldronTile.h | 2 +- .../world/level/tile/DaylightDetectorTile.cpp | 6 +- .../minecraft/world/level/tile/FenceTile.cpp | 2 +- .../minecraft/world/level/tile/FenceTile.h | 2 +- .../minecraft/world/level/tile/FireTile.cpp | 2 +- .../minecraft/world/level/tile/GrassTile.cpp | 2 +- .../world/level/tile/HalfSlabTile.cpp | 2 +- .../minecraft/world/level/tile/HalfSlabTile.h | 2 +- .../minecraft/world/level/tile/HopperTile.cpp | 2 +- .../minecraft/world/level/tile/HopperTile.h | 2 +- .../minecraft/world/level/tile/JukeboxTile.h | 2 +- .../minecraft/world/level/tile/LiquidTile.cpp | 4 +- .../world/level/tile/RedStoneDustTile.cpp | 2 +- .../minecraft/world/level/tile/StairTile.cpp | 2 +- .../minecraft/world/level/tile/StairTile.h | 2 +- .../level/tile/TheEndPortalFrameTile.cpp | 2 +- .../world/level/tile/TheEndPortalFrameTile.h | 2 +- .../world/level/tile/ThinFenceTile.cpp | 2 +- .../world/level/tile/ThinFenceTile.h | 2 +- .../net/minecraft/world/level/tile/Tile.cpp | 2 +- .../net/minecraft/world/level/tile/Tile.h | 2 +- .../minecraft/world/level/tile/VineTile.cpp | 2 +- .../world/level/tile/WaterLilyTile.cpp | 2 +- .../world/level/tile/WaterLilyTile.h | 2 +- .../tile/entity/BrewingStandTileEntity.cpp | 6 +- .../tile/entity/BrewingStandTileEntity.h | 2 +- .../level/tile/entity/ChestTileEntity.cpp | 6 +- .../world/level/tile/entity/ChestTileEntity.h | 4 +- .../level/tile/entity/DispenserTileEntity.cpp | 6 +- .../level/tile/entity/DispenserTileEntity.h | 4 +- .../entity/EnchantmentTableTileEntity.cpp | 12 ++-- .../level/tile/entity/FurnaceTileEntity.cpp | 6 +- .../level/tile/entity/FurnaceTileEntity.h | 2 +- .../level/tile/entity/HopperTileEntity.cpp | 4 +- .../level/tile/entity/HopperTileEntity.h | 2 +- .../level/tile/entity/MusicTileEntity.cpp | 2 +- .../tile/entity/PistonPieceTileEntity.cpp | 2 +- .../level/tile/entity/SignTileEntity.cpp | 2 +- .../level/tile/entity/SkullTileEntity.cpp | 2 +- .../level/tile/entity/TheEndPortalTile.cpp | 2 +- .../level/tile/entity/TheEndPortalTile.h | 2 +- .../world/level/tile/entity/TileEntity.h | 2 +- .../level/tile/piston/PistonBaseTile.cpp | 2 +- .../world/level/tile/piston/PistonBaseTile.h | 2 +- .../level/tile/piston/PistonExtensionTile.cpp | 2 +- .../level/tile/piston/PistonExtensionTile.h | 2 +- .../include/java}/Arrays.h | 2 +- .../include/java}/Buffer.h | 0 .../include/java}/ByteBuffer.h | 5 +- .../include/java}/Class.h | 1 - .../include/java}/Color.h | 0 .../include/java}/Exceptions.h | 3 + .../include/java}/File.h | 4 ++ .../include/java}/FileFilter.h | 0 .../include/java}/FilenameFilter.h | 2 +- .../include/java}/FloatBuffer.h | 3 +- .../InputOutputStream/BufferedOutputStream.h | 1 + .../java}/InputOutputStream/BufferedReader.h | 0 .../InputOutputStream/ByteArrayInputStream.h | 1 + .../InputOutputStream/ByteArrayOutputStream.h | 1 + .../java}/InputOutputStream/DataInput.h | 4 +- .../java}/InputOutputStream/DataInputStream.h | 6 +- .../java}/InputOutputStream/DataOutput.h | 4 +- .../InputOutputStream/DataOutputStream.h | 7 +- .../java}/InputOutputStream/FileInputStream.h | 3 + .../InputOutputStream/FileOutputStream.h | 2 + .../java}/InputOutputStream/GZIPInputStream.h | 4 ++ .../InputOutputStream/GZIPOutputStream.h | 2 + .../InputOutputStream/InputOutputStream.h | 0 .../java}/InputOutputStream/InputStream.h | 5 ++ .../InputOutputStream/InputStreamReader.h | 1 + .../java}/InputOutputStream/OutputStream.h | 3 + .../include/java}/InputOutputStream/Reader.h | 0 .../include/java}/IntBuffer.h | 2 + .../include/java}/JavaIntHash.h | 0 .../include/java}/JavaMath.h | 0 .../include/java}/Random.h | 0 .../include/java}/Reference.h | 0 .../include/java}/System.h | 2 +- minecraft/java/meson.build | 35 ++++++++++ .../ConsoleJavaLibs => java/src}/Buffer.cpp | 1 - .../src}/ByteBuffer.cpp | 1 - .../ConsoleJavaLibs => java/src}/Class.cpp | 1 - .../ConsoleJavaLibs => java/src}/Color.cpp | 7 +- .../ConsoleJavaLibs => java/src}/File.cpp | 8 +-- .../src}/FloatBuffer.cpp | 1 - .../BufferedOutputStream.cpp | 8 +-- .../src}/InputOutputStream/BufferedReader.cpp | 4 +- .../ByteArrayInputStream.cpp | 6 +- .../ByteArrayOutputStream.cpp | 6 +- .../InputOutputStream/DataInputStream.cpp | 40 ++++++----- .../InputOutputStream/DataOutputStream.cpp | 15 ++--- .../InputOutputStream/FileInputStream.cpp | 23 ++----- .../InputOutputStream/FileOutputStream.cpp | 7 +- .../src}/InputOutputStream/InputStream.cpp | 7 +- .../InputOutputStream/InputStreamReader.cpp | 7 +- .../src}/IntBuffer.cpp | 1 - .../ConsoleJavaLibs => java/src}/JavaMath.cpp | 6 +- .../ConsoleJavaLibs => java/src}/Random.cpp | 1 - .../ConsoleJavaLibs => java/src}/system.cpp | 1 - .../mojang => nbt/include}/nbt/ByteArrayTag.h | 2 +- .../com/mojang => nbt/include}/nbt/ByteTag.h | 0 .../mojang => nbt/include}/nbt/CompoundTag.h | 3 +- .../mojang => nbt/include}/nbt/DoubleTag.h | 2 +- .../com/mojang => nbt/include}/nbt/EndTag.h | 0 .../com/mojang => nbt/include}/nbt/FloatTag.h | 2 +- .../mojang => nbt/include}/nbt/IntArrayTag.h | 2 +- .../com/mojang => nbt/include}/nbt/IntTag.h | 0 .../com/mojang => nbt/include}/nbt/ListTag.h | 3 +- .../com/mojang => nbt/include}/nbt/LongTag.h | 0 .../com/mojang => nbt/include}/nbt/NbtIo.h | 0 .../com/mojang => nbt/include}/nbt/ShortTag.h | 0 .../mojang => nbt/include}/nbt/StringTag.h | 0 .../com/mojang => nbt/include}/nbt/Tag.h | 2 +- .../include}/nbt/com.mojang.nbt.h | 0 minecraft/nbt/meson.build | 16 +++++ .../com/mojang/nbt => nbt/src}/NbtIo.cpp | 7 +- .../com/mojang/nbt => nbt/src}/Tag.cpp | 8 +-- 535 files changed, 1286 insertions(+), 1208 deletions(-) rename minecraft/{Minecraft.World/ConsoleJavaLibs => Minecraft.Client/Common/Source Files/Network}/Socket.cpp (97%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => Minecraft.Client/Common/Source Files/Network}/Socket.h (92%) rename minecraft/Minecraft.World/{Header Files => ConsoleHelpers}/PathHelper.h (100%) delete mode 100644 minecraft/Minecraft.World/ConsoleJavaLibs/SocketAddress.h rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Arrays.h (93%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Buffer.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/ByteBuffer.h (86%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Class.h (99%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Color.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Exceptions.h (92%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/File.h (96%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/FileFilter.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/FilenameFilter.h (81%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/FloatBuffer.h (72%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/BufferedOutputStream.h (86%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/BufferedReader.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/ByteArrayInputStream.h (93%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/ByteArrayOutputStream.h (89%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/DataInput.h (80%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/DataInputStream.h (86%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/DataOutput.h (80%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/DataOutputStream.h (87%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/FileInputStream.h (81%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/FileOutputStream.h (84%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/GZIPInputStream.h (85%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/GZIPOutputStream.h (87%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/InputOutputStream.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/InputStream.h (76%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/InputStreamReader.h (91%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/OutputStream.h (80%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/InputOutputStream/Reader.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/IntBuffer.h (84%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/JavaIntHash.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/JavaMath.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Random.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/Reference.h (100%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/include/java}/System.h (96%) create mode 100644 minecraft/java/meson.build rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/Buffer.cpp (98%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/ByteBuffer.cpp (99%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/Class.cpp (81%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/Color.cpp (95%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/File.cpp (98%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/FloatBuffer.cpp (97%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/BufferedOutputStream.cpp (96%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/BufferedReader.cpp (98%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/ByteArrayInputStream.cpp (97%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/ByteArrayOutputStream.cpp (95%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/DataInputStream.cpp (97%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/DataOutputStream.cpp (97%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/FileInputStream.cpp (91%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/FileOutputStream.cpp (96%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/InputStream.cpp (59%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/InputOutputStream/InputStreamReader.cpp (91%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/IntBuffer.cpp (98%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/JavaMath.cpp (97%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/Random.cpp (98%) rename minecraft/{Minecraft.World/ConsoleJavaLibs => java/src}/system.cpp (99%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/ByteArrayTag.h (97%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/ByteTag.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/CompoundTag.h (99%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/DoubleTag.h (91%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/EndTag.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/FloatTag.h (91%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/IntArrayTag.h (97%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/IntTag.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/ListTag.h (99%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/LongTag.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/NbtIo.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/ShortTag.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/StringTag.h (100%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/Tag.h (95%) rename minecraft/{Minecraft.World/com/mojang => nbt/include}/nbt/com.mojang.nbt.h (100%) create mode 100644 minecraft/nbt/meson.build rename minecraft/{Minecraft.World/com/mojang/nbt => nbt/src}/NbtIo.cpp (93%) rename minecraft/{Minecraft.World/com/mojang/nbt => nbt/src}/Tag.cpp (96%) diff --git a/meson.build b/meson.build index 6a3e63161..3d17d663b 100644 --- a/meson.build +++ b/meson.build @@ -64,6 +64,9 @@ stb_dep = declare_dependency(include_directories: stb) miniaudio_dep = dependency('miniaudio') +subdir('minecraft/java') +subdir('minecraft/nbt') + subdir('minecraft/4J.Render') subdir('minecraft/4J.Input') subdir('minecraft/4J.Profile') @@ -71,3 +74,4 @@ subdir('minecraft/4J.Storage') subdir('minecraft/Minecraft.Assets') subdir('minecraft/Minecraft.World') subdir('minecraft/Minecraft.Client') + diff --git a/minecraft/Minecraft.Client/Common/Consoles_App.cpp b/minecraft/Minecraft.Client/Common/Consoles_App.cpp index 9cadfaea0..f0d41d175 100644 --- a/minecraft/Minecraft.Client/Common/Consoles_App.cpp +++ b/minecraft/Minecraft.Client/Common/Consoles_App.cpp @@ -23,7 +23,7 @@ #include "Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h" #include "Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.h" #include "Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h" -#include "Minecraft.World/Header Files/PathHelper.h" +#include "Minecraft.World/ConsoleHelpers/PathHelper.h" #include "../net/minecraft/stats/StatsCounter.h" #include "../net/minecraft/server/level/GameMode.h" #include "../Windows64/Source Files/Social/SocialManager.h" @@ -37,7 +37,7 @@ #include "../net/minecraft/server/level/ServerPlayer.h" #include "Source Files/GameRules/ConsoleGameRules.h" #include "Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Minecraft.World/net/minecraft/world/level/LevelSettings.h" #include "../net/minecraft/client/User.h" #include diff --git a/minecraft/Minecraft.Client/Common/ShutdownManager.h b/minecraft/Minecraft.Client/Common/ShutdownManager.h index 4a20b51e6..0153b511f 100644 --- a/minecraft/Minecraft.Client/Common/ShutdownManager.h +++ b/minecraft/Minecraft.Client/Common/ShutdownManager.h @@ -6,7 +6,7 @@ #include #include -#include "Minecraft.World/ConsoleHelpers/C4JThread.h" +#include "../../Minecraft.World/ConsoleHelpers/C4JThread.h" class ShutdownManager { public: diff --git a/minecraft/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h b/minecraft/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h index c84169b33..231f8f648 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h +++ b/minecraft/Minecraft.Client/Common/Source Files/Audio/Consoles_SoundEngine.h @@ -20,6 +20,7 @@ typedef struct { } AUDIO_LISTENER; class Options; +class Mob; class ConsoleSoundEngine { public: diff --git a/minecraft/Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp b/minecraft/Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp index d6d57a81d..d1d23b288 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Audio/SoundEngine.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "SoundEngine.h" -#include "Minecraft.World/Header Files/PathHelper.h" +#include "Minecraft.World/ConsoleHelpers/PathHelper.h" #include "../../Consoles_App.h" #include "../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" @@ -1111,8 +1111,8 @@ void SoundEngine::tick(std::shared_ptr* players, float a) { float yRot = players[i]->yRotO + (players[i]->yRot - players[i]->yRotO) * a; - float yCos = (float)cos(-yRot * Mth::RAD_TO_GRAD - PI); - float ySin = (float)sin(-yRot * Mth::RAD_TO_GRAD - PI); + float yCos = (float)cos(-yRot * Mth::RAD_TO_GRAD - M_PI); + float ySin = (float)sin(-yRot * Mth::RAD_TO_GRAD - M_PI); // store the listener positions for splitscreen m_ListenerA[i].vPosition.x = x; diff --git a/minecraft/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp b/minecraft/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp index 8f119503c..ec8cafa93 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/DLC/DLCGameRulesHeader.cpp @@ -2,9 +2,9 @@ #include -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "DLCManager.h" #include "DLCGameRulesHeader.h" diff --git a/minecraft/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp b/minecraft/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp index b27c02108..56ac2b884 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/GameRules/GameRuleManager.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Minecraft.World/Header Files/compression.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/Header Files/compression.h" #include "../DLC/DLCPack.h" #include "../DLC/DLCLocalisationFile.h" diff --git a/minecraft/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp b/minecraft/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp index fd02c9110..19806ddba 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.cpp @@ -1,9 +1,9 @@ #include "Minecraft.World/Header Files/stdafx.h" #include -#include "Minecraft.World/com/mojang/nbt/com.mojang.nbt.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "nbt/com.mojang.nbt.h" +#include "java/System.h" #include "ConsoleSchematicFile.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" #include "Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" diff --git a/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp b/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp index 15a717294..ef788b9b7 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp @@ -5,7 +5,7 @@ #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "Minecraft.World/net/minecraft/world/phys/AABB.h" #include "Minecraft.World/net/minecraft/world/phys/Vec3.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Socket.h" #include "Minecraft.World/ConsoleHelpers/ThreadName.h" #include "Minecraft.World/net/minecraft/world/entity/Entity.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" diff --git a/minecraft/Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h b/minecraft/Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h index 9206a9405..b80be0818 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h @@ -32,7 +32,7 @@ public: virtual Socket* GetSocket() = 0; virtual const wchar_t* GetOnlineName() = 0; virtual std::wstring GetDisplayName() = 0; - virtual PlayerUID GetUID() = 0; + virtual unsigned long long GetUID() = 0; virtual void SentChunkPacket() = 0; virtual int GetTimeSinceLastChunkPacket_ms() = 0; }; diff --git a/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp b/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp index c61633000..e5c5898b8 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Socket.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "NetworkPlayerQNet.h" #include "PlatformNetworkManagerStub.h" diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Socket.cpp b/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp similarity index 97% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Socket.cpp rename to minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp index 8a0ffefe8..01bbef44b 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Socket.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp @@ -1,14 +1,15 @@ #include #include -#include "../Header Files/stdafx.h" -#include "InputOutputStream/InputOutputStream.h" -#include "SocketAddress.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Socket.h" -#include "../ConsoleHelpers/ThreadName.h" -#include "Minecraft.Client/net/minecraft/server/network/ServerConnection.h" #include -#include "Minecraft.Client/Common/ShutdownManager.h" + +// 4jcraft TODO +#include "../../Minecraft.Client/Common/ShutdownManager.h" +#include "../../Minecraft.Client/net/minecraft/server/network/ServerConnection.h" + +class SocketAddress {}; // This current socket implementation is for the creation of a single local // link. 2 sockets can be created, one for either end of this local link, the @@ -76,7 +77,7 @@ Socket::Socket(bool response) { if (s_serverConnection != nullptr) { s_serverConnection->NewIncomingSocket(socket); } else { - app.DebugPrintf( + fprintf(stderr, "SOCKET: Warning - attempted to notify server of new incoming " "socket but s_serverConnection is nullptr\n"); } @@ -137,7 +138,7 @@ void Socket::pushDataToQueue(const std::uint8_t* pbData, std::size_t dataSize, if (!fromHost) queueIdx = SOCKET_SERVER_END; if (queueIdx != m_end && !m_hostLocal) { - app.DebugPrintf( + fprintf(stderr, "SOCKET: Error pushing data to queue. End is %d but queue idx id " "%d\n", m_end, queueIdx); @@ -171,7 +172,7 @@ InputStream* Socket::getInputStream(bool isServerConnection) { } } else { if (s_hostInStream[m_end] == nullptr) { - app.DebugPrintf( + fprintf(stderr, "SOCKET: Warning - s_hostInStream[%d] is nullptr in " "getInputStream(); calling EnsureStreamsInitialised()\n", m_end); @@ -199,7 +200,7 @@ Socket::SocketOutputStream* Socket::getOutputStream(bool isServerConnection) { } else { int outIdx = 1 - m_end; if (s_hostOutStream[outIdx] == nullptr) { - app.DebugPrintf( + fprintf(stderr, "SOCKET: Warning - s_hostOutStream[%d] is nullptr in " "getOutputStream(); calling EnsureStreamsInitialised()\n", outIdx); @@ -326,14 +327,14 @@ void Socket::SocketOutputStreamLocal::write(byteArray b, unsigned int offset, if (m_streamOpen != true) { return; } - MemSect(12); + // MemSect(12); { std::lock_guard lock(s_hostQueueLock[m_queueIdx]); for (unsigned int i = 0; i < length; i++) { s_hostQueue[m_queueIdx].push(b[offset + i]); } } - MemSect(0); + // MemSect(0); } void Socket::SocketOutputStreamLocal::close() { @@ -467,13 +468,13 @@ void Socket::SocketOutputStreamNetwork::writeWithFlags(byteArray b, INetworkPlayer* hostPlayer = g_NetworkManager.GetHostPlayer(); if (hostPlayer == nullptr) { - app.DebugPrintf( + fprintf(stderr, "Trying to write to network, but the hostPlayer is nullptr\n"); return; } INetworkPlayer* socketPlayer = m_socket->getPlayer(); if (socketPlayer == nullptr) { - app.DebugPrintf( + fprintf(stderr, "Trying to write to network, but the socketPlayer is " "nullptr\n"); return; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Socket.h b/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.h similarity index 92% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Socket.h rename to minecraft/Minecraft.Client/Common/Source Files/Network/Socket.h index b1027f8ba..f17b60589 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Socket.h +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.h @@ -7,8 +7,13 @@ #endif #include #include -#include "InputOutputStream/InputStream.h" -#include "InputOutputStream/OutputStream.h" +#include "java/InputOutputStream/InputStream.h" +#include "java/InputOutputStream/OutputStream.h" + +#include "Minecraft.World/ConsoleHelpers/C4JThread.h" // 4jcraft TODO +#include "Minecraft.World/ConsoleHelpers/ThreadName.h" // 4jcraft TODO +#include "Minecraft.Client/Common/Source Files/Network/NetworkPlayerInterface.h" +#include "Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h" #define SOCKET_CLIENT_END 0 #define SOCKET_SERVER_END 1 diff --git a/minecraft/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp b/minecraft/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp index 01fb5b29c..6761d5466 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Tutorial/FullTutorial.cpp @@ -535,7 +535,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) /* * * - * PISTON - SELF-REPAIRING BRIDGE + * M_PISTON - SELF-REPAIRING BRIDGE * */ if (app.getGameRuleDefinitions() != nullptr) { @@ -555,7 +555,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) /* * * - * PISTON - PISTON AND REDSTONE CIRCUITS + * M_PISTON - PISTON AND REDSTONE CIRCUITS * */ if (app.getGameRuleDefinitions() != nullptr) { diff --git a/minecraft/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h b/minecraft/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h index 0e365ea26..22f0413b9 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h +++ b/minecraft/Minecraft.Client/Common/Source Files/Tutorial/Hints/LookAtEntityHint.h @@ -1,7 +1,7 @@ #pragma once // using namespace std; -#include "Minecraft.World/ConsoleJavaLibs/Class.h" +#include "java/Class.h" #include "TutorialHint.h" class ItemInstance; diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h index 55eaefb84..5c88db24d 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h @@ -4,7 +4,7 @@ #include #include -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h" class ArchiveFile { diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp index 00cbed1b4..0048b675d 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AnvilMenu.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "IUIScene_AnvilMenu.h" #include "Minecraft.World/net/minecraft/world/inventory/net.minecraft.world.inventory.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h" #include "../../../../net/minecraft/client/Minecraft.h" #include "../../../../net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp index 0d510ce70..be0a4bbfb 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp @@ -168,7 +168,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { case ACTION_MENU_A: // Do some crafting! if (m_pPlayer && m_pPlayer->inventory) { - // RecipyList *recipes = ((Recipes + // std::vector *recipes = ((Recipes // *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); @@ -627,7 +627,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() { } } */ - RecipyList* recipes = ((Recipes*)Recipes::getInstance())->getRecipies(); + std::vector* recipes = ((Recipes*)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); int iRecipeC = (int)recipes->size(); @@ -868,7 +868,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() { // run through the canbemade list and update the icons displayed int iIndex = 0; - // RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); + // std::vector *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); @@ -929,7 +929,7 @@ void IUIScene_CraftingMenu::UpdateHighlight() { bool bCanBeMade = CanBeMadeA[m_iCurrentSlotHIndex].iCount != 0; if (bCanBeMade) { - // RecipyList *recipes = ((Recipes + // std::vector *recipes = ((Recipes // *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); @@ -990,7 +990,7 @@ void IUIScene_CraftingMenu::UpdateHighlight() { // ////////////////////////////////////////////////////////////////////////// void IUIScene_CraftingMenu::UpdateVerticalSlots() { - // RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); + // std::vector *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); @@ -1061,7 +1061,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() { // ////////////////////////////////////////////////////////////////////////// void IUIScene_CraftingMenu::DisplayIngredients() { - // RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); + // std::vector *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); @@ -1228,7 +1228,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() { ////////////////////////////////////////////////////////////////////////// void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade) { int iIDSString = 0; - // RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); + // std::vector *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); @@ -1316,7 +1316,7 @@ void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade) { // ////////////////////////////////////////////////////////////////////////// void IUIScene_CraftingMenu::UpdateTooltips() { - // RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); + // std::vector *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); // Update tooltips @@ -1398,7 +1398,7 @@ void IUIScene_CraftingMenu::HandleInventoryUpdated() { bool IUIScene_CraftingMenu::isItemSelected(int itemId) { bool isSelected = false; if (m_pPlayer && m_pPlayer->inventory) { - // RecipyList *recipes = ((Recipes + // std::vector *recipes = ((Recipes // *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp index 883882e79..2ce9fa228 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CreativeMenu.cpp @@ -10,7 +10,7 @@ #include "Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h" #include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" #include "Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" // 4J JEV - Images for each tab. IUIScene_CreativeMenu::TabSpec** IUIScene_CreativeMenu::specs = nullptr; diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp index f701d14f5..95b14b42a 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl.cpp @@ -2,7 +2,7 @@ #include "../UI.h" #include "UIControl.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" UIControl::UIControl() { m_parentScene = nullptr; diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp index 31e926ebf..42f1623be 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_Base.cpp @@ -2,7 +2,7 @@ #include "../UI.h" #include "UIControl.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" UIControl_Base::UIControl_Base() { m_bLabelChanged = false; diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp index 89134ef5a..df9579734 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp @@ -373,8 +373,8 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer* renderer, double x, float yr = 1; // mob->yBodyRotO + (mob->yBodyRot - mob->yBodyRotO) * a; - double xa = sin(yr * PI / 180); - double za = -cos(yr * PI / 180); + double xa = sin(yr * M_PI / 180); + double za = -cos(yr * M_PI / 180); float flap = (float)yd * 10; if (flap < -6) flap = -6; diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp index 5bb0dde41..d95ad9050 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Minecraft.World/net/minecraft/util/Mth.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "../../../../../net/minecraft/client/User.h" #include "../../../../../net/minecraft/server/MinecraftServer.h" #include "../../UI.h" @@ -348,7 +348,7 @@ void UIScene_MainMenu::customDrawSplash(IggyCustomDrawCallbackRegion* region) { glRotatef(-17, 0, 0, 1); float sss = 1.8f - Mth::abs(Mth::sin(System::currentTimeMillis() % 1000 / - 1000.0f * PI * 2) * + 1000.0f * M_PI * 2) * 0.1f); sss *= (m_fScreenWidth / m_fRawWidth); diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp index c61fcba75..d680cd10e 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/Containers/UIScene_CreativeMenu.cpp @@ -2,7 +2,7 @@ #include "../../../UI.h" #include "UIScene_CreativeMenu.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../../../../net/minecraft/client/player/LocalPlayer.h" #include "../../../../Tutorial/Tutorial.h" #include "../../../../Tutorial/TutorialMode.h" diff --git a/minecraft/Minecraft.Client/Header Files/stdafx.h b/minecraft/Minecraft.Client/Header Files/stdafx.h index 3a3c47231..3faa1c6ab 100644 --- a/minecraft/Minecraft.Client/Header Files/stdafx.h +++ b/minecraft/Minecraft.Client/Header Files/stdafx.h @@ -53,10 +53,10 @@ using namespace DirectX; #include #include "Minecraft.World/ConsoleHelpers/Definitions.h" -#include "Minecraft.World/ConsoleJavaLibs/Class.h" +#include "java/Class.h" #include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h" #include "Minecraft.World/net/minecraft/SharedConstants.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/Header Files/compression.h" #include "Minecraft.World/ConsoleHelpers/PerformanceTimer.h" diff --git a/minecraft/Minecraft.Client/Linux/LinuxGL.cpp b/minecraft/Minecraft.Client/Linux/LinuxGL.cpp index 908b36d16..e461dbdf6 100644 --- a/minecraft/Minecraft.Client/Linux/LinuxGL.cpp +++ b/minecraft/Minecraft.Client/Linux/LinuxGL.cpp @@ -3,9 +3,9 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "4J_Render.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/IntBuffer.h" +#include "java/FloatBuffer.h" +#include "java/ByteBuffer.h" extern C4JRender RenderManager; diff --git a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp index 8460f774e..9578116ef 100644 --- a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp @@ -54,7 +54,7 @@ static void sigsegv_handler(int sig) { #include "../net/minecraft/client/multiplayer/ClientConnection.h" #include "../net/minecraft/client/User.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "Minecraft.World/ConsoleHelpers/ThreadName.h" #include "../net/minecraft/stats/StatsCounter.h" #include "../net/minecraft/client/multiplayer/ConnectScreen.h" diff --git a/minecraft/Minecraft.Client/Source Files/BufferedImage.cpp b/minecraft/Minecraft.Client/Source Files/BufferedImage.cpp index 101872b5c..649ee0576 100644 --- a/minecraft/Minecraft.Client/Source Files/BufferedImage.cpp +++ b/minecraft/Minecraft.Client/Source Files/BufferedImage.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "../net/minecraft/client/renderer/Textures.h" -#include "Minecraft.World/Header Files/PathHelper.h" +#include "Minecraft.World/ConsoleHelpers/PathHelper.h" #include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h" #include "../Header Files/BufferedImage.h" #if defined(__linux__) diff --git a/minecraft/Minecraft.Client/Source Files/glWrapper.cpp b/minecraft/Minecraft.Client/Source Files/glWrapper.cpp index c1dcaa07e..c7151fd30 100644 --- a/minecraft/Minecraft.Client/Source Files/glWrapper.cpp +++ b/minecraft/Minecraft.Client/Source Files/glWrapper.cpp @@ -2,9 +2,9 @@ #if !defined(__linux__) -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/FloatBuffer.h" +#include "java/IntBuffer.h" +#include "java/ByteBuffer.h" void glViewport(int x, int y, int w, int h) { // We don't really need anything here because minecraft doesn't current do @@ -16,7 +16,7 @@ void glTranslatef(float x, float y, float z) { } void glRotatef(float angle, float x, float y, float z) { - RenderManager.MatrixRotate(angle * (PI / 180.0f), x, y, z); + RenderManager.MatrixRotate(angle * (M_PI / 180.0f), x, y, z); } void glPopMatrix() { RenderManager.MatrixPop(); } diff --git a/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp b/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp index 899bea4d1..bc1687b66 100644 --- a/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp @@ -21,7 +21,7 @@ #include "../../net/minecraft/client/multiplayer/ClientConnection.h" #include "../../net/minecraft/client/User.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "Minecraft.World/ConsoleHelpers/ThreadName.h" #include "../../net/minecraft/stats/StatsCounter.h" #include "../../net/minecraft/client/multiplayer/ConnectScreen.h" diff --git a/minecraft/Minecraft.Client/meson.build b/minecraft/Minecraft.Client/meson.build index ab68ffbf5..2f6fcd9fb 100644 --- a/minecraft/Minecraft.Client/meson.build +++ b/minecraft/Minecraft.Client/meson.build @@ -46,6 +46,8 @@ if host_machine.system() == 'linux' endif client_dependencies = [ + java_dep, + nbt_dep, render_dep, input_dep, profile_dep, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Camera.cpp b/minecraft/Minecraft.Client/net/minecraft/client/Camera.cpp index a76036ce3..b1ff5c0d2 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Camera.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/Camera.cpp @@ -63,12 +63,12 @@ zPlayerOffs = position->get(2); float xRot = player->xRot; float yRot = player->yRot; - xa = cosf(yRot * PI / 180.0f) * (1 - flipCamera * 2); - za = sinf(yRot * PI / 180.0f) * (1 - flipCamera * 2); + xa = cosf(yRot * M_PI / 180.0f) * (1 - flipCamera * 2); + za = sinf(yRot * M_PI / 180.0f) * (1 - flipCamera * 2); - xa2 = -za * sinf(xRot * PI / 180.0f) * (1 - flipCamera * 2); - za2 = xa * sinf(xRot * PI / 180.0f) * (1 - flipCamera * 2); - ya = cosf(xRot * PI / 180.0f); + xa2 = -za * sinf(xRot * M_PI / 180.0f) * (1 - flipCamera * 2); + za2 = xa * sinf(xRot * M_PI / 180.0f) * (1 - flipCamera * 2); + ya = cosf(xRot * M_PI / 180.0f); } TilePos* Camera::getCameraTilePos(std::shared_ptr player, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Camera.h b/minecraft/Minecraft.Client/net/minecraft/client/Camera.h index 6b2ed04e8..a6fa03a30 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Camera.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/Camera.h @@ -1,6 +1,6 @@ #pragma once -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "java/FloatBuffer.h" +#include "java/IntBuffer.h" class TilePos; class Vec3; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Lighting.cpp b/minecraft/Minecraft.Client/net/minecraft/client/Lighting.cpp index 28b8c8bba..2e86184fc 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Lighting.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/Lighting.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Lighting.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "java/FloatBuffer.h" #include "Minecraft.World/net/minecraft/world/phys/Vec3.h" FloatBuffer* Lighting::lb = new FloatBuffer(16); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/MemoryTracker.cpp b/minecraft/Minecraft.Client/net/minecraft/client/MemoryTracker.cpp index 8182d52ba..75974d553 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/MemoryTracker.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/MemoryTracker.cpp @@ -1,8 +1,8 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "MemoryTracker.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "java/IntBuffer.h" +#include "java/ByteBuffer.h" +#include "java/FloatBuffer.h" std::unordered_map MemoryTracker::GL_LIST_IDS; std::vector MemoryTracker::TEXTURE_IDS; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp b/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp index ab3c8c049..a1eee0749 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp @@ -48,12 +48,12 @@ #include "Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" #include "Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" #include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" #include "Minecraft.World/net/minecraft/net.minecraft.h" #include "Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/System.h" +#include "java/ByteBuffer.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" #include "Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.h b/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.h index ba6298fa5..597badcb1 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.h @@ -37,7 +37,7 @@ class ItemInHandRenderer; class LevelSettings; class ColourTable; class MultiPlayerGameMode; -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/net/minecraft/network/packet/DisconnectPacket.h" #include "Minecraft.World/ConsoleHelpers/C4JThread.h" #include "resources/ResourceLocation.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Options.cpp b/minecraft/Minecraft.Client/net/minecraft/client/Options.cpp index c958760f8..57c7b3723 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Options.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/Options.cpp @@ -5,13 +5,13 @@ #include "renderer/Textures.h" #include "Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" #include "Minecraft.World/net/minecraft/locale/Language.h" -#include "Minecraft.World/ConsoleJavaLibs/File.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "java/File.h" +#include "java/InputOutputStream/BufferedReader.h" +#include "java/InputOutputStream/DataInputStream.h" +#include "java/InputOutputStream/InputStreamReader.h" +#include "java/InputOutputStream/FileInputStream.h" +#include "java/InputOutputStream/FileOutputStream.h" +#include "java/InputOutputStream/DataOutputStream.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" // 4J - the Option sub-class used to be an java enumerated type, trying to diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Options.h b/minecraft/Minecraft.Client/net/minecraft/client/Options.h index d682e0cba..eb614336a 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Options.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/Options.h @@ -2,7 +2,7 @@ class Minecraft; class KeyMapping; -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" class Options { public: diff --git a/minecraft/Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp index 1e75ee9cd..75b2eeb76 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/ProgressRenderer.cpp @@ -2,7 +2,7 @@ #include "renderer/Tesselator.h" #include "renderer/Textures.h" #include "ProgressRenderer.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" std::recursive_mutex ProgressRenderer::s_progress; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Timer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/Timer.cpp index eb310485f..2bf00a934 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Timer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/Timer.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Timer.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" Timer::Timer(float ticksPerSecond) { // 4J - added initialisers diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp index 3f24d6182..7cfd82924 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/CreateWorldScreen.cpp @@ -8,7 +8,7 @@ #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" #include "Minecraft.World/net/minecraft/SharedConstants.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "../../server/MinecraftServer.h" #include "../Options.h" #include "MessageScreen.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/Font.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/Font.cpp index d67916a60..692a4689b 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/Font.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/Font.cpp @@ -4,10 +4,10 @@ #include "../Options.h" #include "../renderer/Tesselator.h" #include "../resources/ResourceLocation.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "java/IntBuffer.h" #include "Minecraft.World/net/minecraft/net.minecraft.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" Font::Font(Options* options, const std::wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation* textureLocation, int cols, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp index e54dffbd5..ed85f4abe 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp @@ -10,7 +10,7 @@ #include "../Lighting.h" #include "ChatScreen.h" #include "../multiplayer/MultiPlayerLevel.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" #include "Minecraft.World/net/minecraft/world/effect/net.minecraft.world.effect.h" #include "Minecraft.World/net/minecraft/world/food/net.minecraft.world.food.h" @@ -18,7 +18,7 @@ #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" #include "Minecraft.World/net/minecraft/locale/Language.h" #include "../renderer/entity/EntityRenderDispatcher.h" #include "Minecraft.World/net/minecraft/world/level/dimension/Dimension.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp index bdc4b141f..6aedc4515 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/MerchantScreen.cpp @@ -14,8 +14,8 @@ #include "Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h" #include "../Minecraft.h" #include "../multiplayer/ClientConnection.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "java/InputOutputStream/ByteArrayOutputStream.h" +#include "java/InputOutputStream/DataOutputStream.h" #include "Minecraft.World/net/minecraft/world/item/Rarity.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp index 6cbfc8234..54f8bf607 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/PauseScreen.cpp @@ -110,7 +110,7 @@ void PauseScreen::render(int xm, int ym, float a) { bool isSaving = false; //! minecraft->level->pauseSave(saveStep++); if (isSaving || visibleTime < 20) { float col = ((visibleTime % 10) + a) / 10.0f; - col = Mth::sin(col * PI * 2) * 0.2f + 0.8f; + col = Mth::sin(col * M_PI * 2) * 0.2f + 0.8f; int br = (int)(255 * col); drawString(font, L"Saving level..", 8, height - 16, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp index 501ee1c3e..0197e80e2 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/ScrolledSelectionList.cpp @@ -3,7 +3,7 @@ #include "Button.h" #include "../renderer/Tesselator.h" #include "../renderer/Textures.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" ScrolledSelectionList::ScrolledSelectionList(Minecraft* minecraft, int width, int height, int y0, int y1, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp index 4c8407e4c..e901e1a4f 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementPopup.cpp @@ -4,7 +4,7 @@ #include "../Font.h" #include "../../renderer/Textures.h" #include "../../Lighting.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" #include "Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" #include "Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" #include "Minecraft.World/net/minecraft/SharedConstants.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp index 9b328471b..330ac0b09 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/achievement/AchievementScreen.cpp @@ -8,10 +8,10 @@ #include "../../renderer/Textures.h" #include "../../../stats/StatsCounter.h" #include "../../renderer/entity/ItemRenderer.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" #include "Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" AchievementScreen::AchievementScreen(StatsCounter* statsCounter) { // 4J - added initialisers diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp index 0d3a79181..1e9a2d3e1 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/inventory/BeaconScreen.cpp @@ -13,8 +13,8 @@ #include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "../../Minecraft.h" #include "../../multiplayer/ClientConnection.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "java/InputOutputStream/ByteArrayOutputStream.h" +#include "java/InputOutputStream/DataOutputStream.h" // 4jcraft: referenced from MCP 8.11 (JE 1.6.4) and the existing // container classes (and iggy too) diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp index df604051a..9cbd2aa65 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/particle/GuiParticle.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "GuiParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" Random* GuiParticle::random = new Random(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/BatModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/BatModel.cpp index b41a51373..da9ea2acc 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/BatModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/BatModel.cpp @@ -61,25 +61,25 @@ void BatModel::render(std::shared_ptr entity, float time, float r, bool usecompiled) { std::shared_ptr bat = std::dynamic_pointer_cast(entity); if (bat->isResting()) { - float rad = 180 / PI; + float rad = 180 / M_PI; head->xRot = xRot / rad; - head->yRot = PI - yRot / rad; - head->zRot = PI; + head->yRot = M_PI - yRot / rad; + head->zRot = M_PI; head->setPos(0, -2, 0); rightWing->setPos(-3, 0, 3); leftWing->setPos(3, 0, 3); - body->xRot = PI; + body->xRot = M_PI; - rightWing->xRot = -PI * .05f; - rightWing->yRot = -PI * .40f; - rightWingTip->yRot = -PI * .55f; + rightWing->xRot = -M_PI * .05f; + rightWing->yRot = -M_PI * .40f; + rightWingTip->yRot = -M_PI * .55f; leftWing->xRot = rightWing->xRot; leftWing->yRot = -rightWing->yRot; leftWingTip->yRot = -rightWingTip->yRot; } else { - float rad = 180 / PI; + float rad = 180 / M_PI; head->xRot = xRot / rad; head->yRot = yRot / rad; head->zRot = 0; @@ -88,10 +88,10 @@ void BatModel::render(std::shared_ptr entity, float time, float r, rightWing->setPos(0, 0, 0); leftWing->setPos(0, 0, 0); - body->xRot = PI * .25f + cos(bob * .1f) * .15f; + body->xRot = M_PI * .25f + cos(bob * .1f) * .15f; body->yRot = 0; - rightWing->yRot = cos(bob * 1.3f) * PI * .25f; + rightWing->yRot = cos(bob * 1.3f) * M_PI * .25f; leftWing->yRot = -rightWing->yRot; rightWingTip->yRot = rightWing->yRot * .5f; leftWingTip->yRot = -rightWing->yRot * .5f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp index 1edec6186..11cc5ce1d 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/BlazeModel.cpp @@ -40,29 +40,29 @@ void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - float angle = bob * PI * -.1f; + float angle = bob * M_PI * -.1f; for (int i = 0; i < 4; i++) { upperBodyParts[i]->y = -2 + Mth::cos((i * 2 + bob) * .25f); upperBodyParts[i]->x = Mth::cos(angle) * 9.0f; upperBodyParts[i]->z = Mth::sin(angle) * 9.0f; - angle += PI * 0.5f; + angle += M_PI * 0.5f; } - angle = .25f * PI + bob * PI * .03f; + angle = .25f * M_PI + bob * M_PI * .03f; for (int i = 4; i < 8; i++) { upperBodyParts[i]->y = 2 + Mth::cos((i * 2 + bob) * .25f); upperBodyParts[i]->x = Mth::cos(angle) * 7.0f; upperBodyParts[i]->z = Mth::sin(angle) * 7.0f; - angle += PI * 0.5f; + angle += M_PI * 0.5f; } - angle = .15f * PI + bob * PI * -.05f; + angle = .15f * M_PI + bob * M_PI * -.05f; for (int i = 8; i < 12; i++) { upperBodyParts[i]->y = 11 + Mth::cos((i * 1.5f + bob) * .5f); upperBodyParts[i]->x = Mth::cos(angle) * 5.0f; upperBodyParts[i]->z = Mth::sin(angle) * 5.0f; - angle += PI * 0.5f; + angle += M_PI * 0.5f; } - head->yRot = yRot / (float)(180 / PI); - head->xRot = xRot / (float)(180 / PI); + head->yRot = yRot / (float)(180 / M_PI); + head->xRot = xRot / (float)(180 / M_PI); } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/BoatModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/BoatModel.cpp index a692d28c9..5ff6edb22 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/BoatModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/BoatModel.cpp @@ -28,10 +28,10 @@ BoatModel::BoatModel() : Model() { cubes[4]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[4]->setPos(0, (float)(0 + yOff), (float)(+h / 2 - 1)); - cubes[0]->xRot = PI / 2; - cubes[1]->yRot = PI / 2 * 3; - cubes[2]->yRot = PI / 2 * 1; - cubes[3]->yRot = PI / 2 * 2; + cubes[0]->xRot = M_PI / 2; + cubes[1]->yRot = M_PI / 2 * 3; + cubes[2]->yRot = M_PI / 2 * 1; + cubes[3]->yRot = M_PI / 2 * 2; // 4J added - compile now to avoid random performance hit first time cubes // are rendered diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/BookModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/BookModel.cpp index 14af15e40..e0b1dc449 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/BookModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/BookModel.cpp @@ -30,7 +30,7 @@ BookModel::BookModel() { leftLid->setPos(0, 0, -1); rightLid->setPos(0, 0, 1); - seam->yRot = PI / 2; + seam->yRot = M_PI / 2; // 4J added - compile now to avoid random performance hit first time cubes // are rendered @@ -65,7 +65,7 @@ void BookModel::setupAnim(float time, float r, float bob, float yRot, unsigned int uiBitmaskOverrideAnim) { float openness = (Mth::sin(time * 0.02f) * 0.10f + 1.25f) * yRot; - leftLid->yRot = PI + openness; + leftLid->yRot = M_PI + openness; rightLid->yRot = -openness; leftPages->yRot = +openness; rightPages->yRot = -openness; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp index 0d0b162a9..e05e2b3a5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/ChickenModel.cpp @@ -86,8 +86,8 @@ void ChickenModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - head->xRot = xRot / (float)(180 / PI); - head->yRot = yRot / (float)(180 / PI); + head->xRot = xRot / (float)(180 / M_PI); + head->yRot = yRot / (float)(180 / M_PI); beak->xRot = head->xRot; beak->yRot = head->yRot; @@ -95,10 +95,10 @@ void ChickenModel::setupAnim(float time, float r, float bob, float yRot, redThing->xRot = head->xRot; redThing->yRot = head->yRot; - body->xRot = 90 / (float)(180 / PI); + body->xRot = 90 / (float)(180 / M_PI); leg0->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; - leg1->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; + leg1->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; wing0->zRot = bob; wing1->zRot = -bob; } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp index 64fea4291..92d0bcae0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/CreeperModel.cpp @@ -67,11 +67,11 @@ void CreeperModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - head->yRot = yRot / (float)(180 / PI); - head->xRot = xRot / (float)(180 / PI); + head->yRot = yRot / (float)(180 / M_PI); + head->xRot = xRot / (float)(180 / M_PI); leg0->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; - leg1->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; - leg2->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; + leg1->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; + leg2->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; leg3->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; } \ No newline at end of file diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/GhastModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/GhastModel.cpp index c2ce0356e..764b308c5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/GhastModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/GhastModel.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/util/Mth.h" #include "GhastModel.h" #include "geom/ModelPart.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp index 78a546cb1..977892b09 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/HumanoidModel.cpp @@ -196,8 +196,8 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, // bool bIsAttacking = (attackTime > -9990.0f); { - head->yRot = yRot / (float)(180.0f / PI); - head->xRot = xRot / (float)(180.0f / PI); + head->yRot = yRot / (float)(180.0f / M_PI); + head->xRot = xRot / (float)(180.0f / M_PI); hair->yRot = head->yRot; hair->xRot = head->xRot; body->z = 0.0f; @@ -211,13 +211,13 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, arm1->zRot = 0.0f; } else if (uiBitmaskOverrideAnim & (1 << eAnim_ArmsOutFront)) { - arm0->xRot = -HALF_PI; - arm1->xRot = -HALF_PI; + arm0->xRot = -M_PI_2; + arm1->xRot = -M_PI_2; arm0->zRot = 0.0f; arm1->zRot = 0.0f; } else if (uiBitmaskOverrideAnim & (1 << eAnim_SingleArms)) { - arm0->xRot = (Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f; - arm1->xRot = (Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f; + arm0->xRot = (Mth::cos(time * 0.6662f + M_PI) * 2.0f) * r * 0.5f; + arm1->xRot = (Mth::cos(time * 0.6662f + M_PI) * 2.0f) * r * 0.5f; arm0->zRot = 0.0f; arm1->zRot = 0.0f; } @@ -225,12 +225,12 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, // that's up else if ((uiBitmaskOverrideAnim & (1 << eAnim_StatueOfLiberty)) && (holdingRightHand == 0) && (attackTime == 0.0f)) { - arm0->xRot = -PI; + arm0->xRot = -M_PI ; arm0->zRot = -0.3f; arm1->xRot = (Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f; arm1->zRot = 0.0f; } else { - arm0->xRot = (Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f; + arm0->xRot = (Mth::cos(time * 0.6662f + M_PI) * 2.0f) * r * 0.5f; arm1->xRot = (Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f; arm0->zRot = 0.0f; arm1->zRot = 0.0f; @@ -246,23 +246,23 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, if (riding) { if ((uiBitmaskOverrideAnim & (1 << eAnim_SmallModel)) == 0) { - arm0->xRot += -HALF_PI * 0.4f; - arm1->xRot += -HALF_PI * 0.4f; - leg0->xRot = -HALF_PI * 0.8f; - leg1->xRot = -HALF_PI * 0.8f; - leg0->yRot = HALF_PI * 0.2f; - leg1->yRot = -HALF_PI * 0.2f; + arm0->xRot += -M_PI_2 * 0.4f; + arm1->xRot += -M_PI_2 * 0.4f; + leg0->xRot = -M_PI_2 * 0.8f; + leg1->xRot = -M_PI_2 * 0.8f; + leg0->yRot = M_PI_2 * 0.2f; + leg1->yRot = -M_PI_2 * 0.2f; } else { - arm0->xRot += -HALF_PI * 0.4f; - arm1->xRot += -HALF_PI * 0.4f; - leg0->xRot = -HALF_PI * 0.4f; - leg1->xRot = -HALF_PI * 0.4f; + arm0->xRot += -M_PI_2 * 0.4f; + arm1->xRot += -M_PI_2 * 0.4f; + leg0->xRot = -M_PI_2 * 0.4f; + leg1->xRot = -M_PI_2 * 0.4f; } } else if (idle && !sneaking) { - leg0->xRot = -HALF_PI; - leg1->xRot = -HALF_PI; - leg0->yRot = HALF_PI * 0.2f; - leg1->yRot = -HALF_PI * 0.2f; + leg0->xRot = -M_PI_2; + leg1->xRot = -M_PI_2; + leg0->yRot = M_PI_2 * 0.2f; + leg1->yRot = -M_PI_2 * 0.2f; } else if (uiBitmaskOverrideAnim & (1 << eAnim_NoLegAnim)) { leg0->xRot = 0.0f; leg0->zRot = 0.0f; @@ -275,21 +275,21 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, leg1->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; } else { leg0->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; - leg1->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; + leg1->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; } if (holdingLeftHand != 0) { - arm1->xRot = arm1->xRot * 0.5f - HALF_PI * 0.2f * holdingLeftHand; + arm1->xRot = arm1->xRot * 0.5f - M_PI_2 * 0.2f * holdingLeftHand; } if (holdingRightHand != 0) { - arm0->xRot = arm0->xRot * 0.5f - HALF_PI * 0.2f * holdingRightHand; + arm0->xRot = arm0->xRot * 0.5f - M_PI_2 * 0.2f * holdingRightHand; } arm0->yRot = 0.0f; arm1->yRot = 0.0f; if (attackTime > -9990.0f) { float swing = attackTime; - body->yRot = Mth::sin(sqrt(swing) * PI * 2.0f) * 0.2f; + body->yRot = Mth::sin(sqrt(swing) * M_PI * 2.0f) * 0.2f; arm0->z = Mth::sin(body->yRot) * 5.0f; arm0->x = -Mth::cos(body->yRot) * 5.0f; arm1->z = -Mth::sin(body->yRot) * 5.0f; @@ -302,16 +302,16 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, swing *= swing; swing *= swing; swing = 1.0f - swing; - float aa = Mth::sin(swing * PI); - float bb = Mth::sin(attackTime * PI) * -(head->xRot - 0.7f) * 0.75f; + float aa = Mth::sin(swing * M_PI); + float bb = Mth::sin(attackTime * M_PI) * -(head->xRot - 0.7f) * 0.75f; arm0->xRot -= aa * 1.2f + bb; // 4J - changed 1.2 -> 1.2f arm0->yRot += body->yRot * 2.0f; if ((uiBitmaskOverrideAnim & (1 << eAnim_StatueOfLiberty)) && (holdingRightHand == 0) && (attackTime == 0.0f)) { - arm0->zRot -= Mth::sin(attackTime * PI) * -0.4f; + arm0->zRot -= Mth::sin(attackTime * M_PI) * -0.4f; } else { - arm0->zRot = Mth::sin(attackTime * PI) * -0.4f; + arm0->zRot = Mth::sin(attackTime * M_PI) * -0.4f; } } @@ -324,7 +324,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, is = is * is * is; is = is * is * is; float iss = 1 - is; - arm0->xRot = -Mth::abs(Mth::cos(eating_t / 4.0f * PI) * 0.1f) * + arm0->xRot = -Mth::abs(Mth::cos(eating_t / 4.0f * M_PI) * 0.1f) * (eating_swing > 0.2 ? 1.0f : 0.0f) * 2.0f; // This factor is the chomping bit (conditional // factor is so that he doesn't eat whilst the @@ -413,8 +413,8 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, arm1->zRot = 0.0f; arm0->yRot = -(0.1f - attack2 * 0.6f) + head->yRot; arm1->yRot = +(0.1f - attack2 * 0.6f) + head->yRot + 0.4f; - arm0->xRot = -HALF_PI + head->xRot; - arm1->xRot = -HALF_PI + head->xRot; + arm0->xRot = -M_PI_2 + head->xRot; + arm1->xRot = -M_PI_2 + head->xRot; arm0->xRot -= attack2 * 1.2f - attack * 0.4f; arm1->xRot -= attack2 * 1.2f - attack * 0.4f; arm0->zRot += ((float)(Mth::cos(bob * 0.09f)) * 0.05f + 0.05f); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp index 163985e25..fe00c4620 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/LeashKnotModel.cpp @@ -30,6 +30,6 @@ void LeashKnotModel::setupAnim(float time, float r, float bob, float yRot, unsigned int uiBitmaskOverrideAnim) { Model::setupAnim(time, r, bob, yRot, xRot, scale, entity); - knot->yRot = yRot / (180 / PI); - knot->xRot = xRot / (180 / PI); + knot->yRot = yRot / (180 / M_PI); + knot->xRot = xRot / (180 / M_PI); } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp index 7a8637624..cb976a263 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/MinecartModel.cpp @@ -34,11 +34,11 @@ MinecartModel::MinecartModel() : Model() { cubes[4]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[4]->setPos(0, (float)(0 + yOff), (float)(+h / 2 - 1)); - cubes[0]->xRot = PI / 2; - cubes[1]->yRot = PI / 2 * 3; - cubes[2]->yRot = PI / 2 * 1; - cubes[3]->yRot = PI / 2 * 2; - cubes[5]->xRot = -PI / 2; + cubes[0]->xRot = M_PI / 2; + cubes[1]->yRot = M_PI / 2 * 3; + cubes[2]->yRot = M_PI / 2 * 1; + cubes[3]->yRot = M_PI / 2 * 2; + cubes[5]->xRot = -M_PI / 2; // 4J added - compile now to avoid random performance hit first time cubes // are rendered diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp index f2567196a..1a278b18f 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/ModelHorse.cpp @@ -491,8 +491,8 @@ void ModelHorse::prepareMobModel(std::shared_ptr mob, float wp, MuleEarL->xRot = Head->xRot; MuleEarR->xRot = Head->xRot; Neck->xRot = Head->xRot; - UMouth->xRot = 0 - (PI * .03f) * openMouth; - LMouth->xRot = 0 + (PI * .05f) * openMouth; + UMouth->xRot = 0 - (M_PI * .03f) * openMouth; + LMouth->xRot = 0 + (M_PI * .05f) * openMouth; Mane->xRot = Head->xRot; @@ -513,8 +513,8 @@ void ModelHorse::prepareMobModel(std::shared_ptr mob, float wp, * knee joints Leg1 and Leg4 use LLegXRot Leg2 and Leg3 use RLegXRot */ { - float r90 = PI * .5f; - float r270 = PI * 1.5f; + float r90 = M_PI * .5f; + float r270 = M_PI * 1.5f; float r300 = -60 * Mth::DEGRAD; float standAngle = 15 * Mth::DEGRAD * standing; float bobValue = Mth::cos((bob * 0.6f) + 3.141593f); @@ -567,14 +567,14 @@ void ModelHorse::prepareMobModel(std::shared_ptr mob, float wp, Leg3A->xRot = rlegRot; Leg3B->xRot = - (Leg3A->xRot + PI * std::max(0.0f, (.2f + bobValue * .2f))) * + (Leg3A->xRot + M_PI * std::max(0.0f, (.2f + bobValue * .2f))) * standing + (legXRotAnim + std::max(0.0f, legAnim1 * 0.5f * ws)) * iStanding; Leg3C->xRot = Leg3B->xRot; Leg4A->xRot = llegRot; Leg4B->xRot = - (Leg4A->xRot + PI * std::max(0.0f, (.2f - bobValue * .2f))) * + (Leg4A->xRot + M_PI * std::max(0.0f, (.2f - bobValue * .2f))) * standing + (-legXRotAnim + std::max(0.0f, -legAnim1 * 0.5f * ws)) * iStanding; Leg4C->xRot = Leg4B->xRot; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp index 0d5757b82..b89b83ddd 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/OcelotModel.cpp @@ -147,29 +147,29 @@ void OcelotModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - head->xRot = xRot / (float)(180 / PI); - head->yRot = yRot / (float)(180 / PI); + head->xRot = xRot / (float)(180 / M_PI); + head->yRot = yRot / (float)(180 / M_PI); if (state == SITTING_STATE) { } else { - body->xRot = 90 / (float)(180 / PI); + body->xRot = 90 / (float)(180 / M_PI); if (state == SPRINT_STATE) { backLegL->xRot = ((float)Mth::cos(time * 0.6662f) * 1.f) * r; backLegR->xRot = ((float)Mth::cos(time * 0.6662f + 0.3f) * 1.f) * r; frontLegL->xRot = - ((float)Mth::cos(time * 0.6662f + PI + 0.3f) * 1.f) * r; - frontLegR->xRot = ((float)Mth::cos(time * 0.6662f + PI) * 1.f) * r; - tail2->xRot = 0.55f * PI + 0.1f * PI * Mth::cos(time) * r; + ((float)Mth::cos(time * 0.6662f + M_PI + 0.3f) * 1.f) * r; + frontLegR->xRot = ((float)Mth::cos(time * 0.6662f + M_PI) * 1.f) * r; + tail2->xRot = 0.55f * M_PI + 0.1f * M_PI * Mth::cos(time) * r; } else { backLegL->xRot = ((float)Mth::cos(time * 0.6662f) * 1.f) * r; - backLegR->xRot = ((float)Mth::cos(time * 0.6662f + PI) * 1.f) * r; - frontLegL->xRot = ((float)Mth::cos(time * 0.6662f + PI) * 1.f) * r; + backLegR->xRot = ((float)Mth::cos(time * 0.6662f + M_PI) * 1.f) * r; + frontLegL->xRot = ((float)Mth::cos(time * 0.6662f + M_PI) * 1.f) * r; frontLegR->xRot = ((float)Mth::cos(time * 0.6662f) * 1.f) * r; if (state == WALK_STATE) - tail2->xRot = 0.55f * PI + 0.25f * PI * Mth::cos(time) * r; + tail2->xRot = 0.55f * M_PI + 0.25f * M_PI * Mth::cos(time) * r; else - tail2->xRot = 0.55f * PI + 0.15f * PI * Mth::cos(time) * r; + tail2->xRot = 0.55f * M_PI + 0.15f * M_PI * Mth::cos(time) * r; } } } @@ -198,17 +198,17 @@ void OcelotModel::prepareMobModel(std::shared_ptr mob, float time, tail1->y += 1; tail2->y += -4; tail2->z += 2; - tail1->xRot = 0.5f * PI; - tail2->xRot = 0.5f * PI; + tail1->xRot = 0.5f * M_PI; + tail2->xRot = 0.5f * M_PI; state = SNEAK_STATE; } else if (ozelot->isSprinting()) { tail2->y = tail1->y; tail2->z += 2; - tail1->xRot = 0.5f * PI; - tail2->xRot = 0.5f * PI; + tail1->xRot = 0.5f * M_PI; + tail2->xRot = 0.5f * M_PI; state = SPRINT_STATE; } else if (ozelot->isSitting()) { - body->xRot = 45 / (float)(180 / PI); + body->xRot = 45 / (float)(180 / M_PI); body->y += -4; body->z += 5; head->y += -3.3f; @@ -218,14 +218,14 @@ void OcelotModel::prepareMobModel(std::shared_ptr mob, float time, tail1->z += -2; tail2->y += 2; tail2->z += -0.8f; - tail1->xRot = PI * 0.55f; - tail2->xRot = PI * 0.85f; + tail1->xRot = M_PI * 0.55f; + tail2->xRot = M_PI * 0.85f; - frontLegL->xRot = frontLegR->xRot = -PI * 0.05f; + frontLegL->xRot = frontLegR->xRot = -M_PI * 0.05f; frontLegL->y = frontLegR->y = frontLegY + 2; frontLegL->z = frontLegR->z = -7; - backLegL->xRot = backLegR->xRot = -PI * 0.5f; + backLegL->xRot = backLegR->xRot = -M_PI * 0.5f; backLegL->y = backLegR->y = backLegY + 3; backLegL->z = backLegR->z = backLegZ - 4; state = SITTING_STATE; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp index 5a90a3ce6..8f46e1568 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/QuadrupedModel.cpp @@ -75,14 +75,14 @@ void QuadrupedModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - float rad = (float)(180 / PI); + float rad = (float)(180 / M_PI); head->xRot = xRot / rad; head->yRot = yRot / rad; body->xRot = 90 / rad; leg0->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; - leg1->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; - leg2->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; + leg1->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; + leg2->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; leg3->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp index e672ac333..044e353bd 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/SilverfishModel.cpp @@ -71,10 +71,10 @@ void SilverfishModel::setupAnim(float time, float r, float bob, float yRot, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { for (unsigned int i = 0; i < bodyParts.length; i++) { - bodyParts[i]->yRot = Mth::cos(bob * .9f + i * .15f * PI) * PI * .05f * + bodyParts[i]->yRot = Mth::cos(bob * .9f + i * .15f * M_PI) * M_PI * .05f * (1 + abs((int)i - 2)); bodyParts[i]->x = - Mth::sin(bob * .9f + i * .15f * PI) * PI * .2f * abs((int)i - 2); + Mth::sin(bob * .9f + i * .15f * M_PI) * M_PI * .2f * abs((int)i - 2); } bodyLayers[0]->yRot = bodyParts[2]->yRot; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp index f411991a2..037cdf43e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/SkeletonHeadModel.cpp @@ -40,6 +40,6 @@ void SkeletonHeadModel::setupAnim(float time, float r, float bob, float yRot, Model::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim); - head->yRot = yRot / (180 / PI); - head->xRot = xRot / (180 / PI); + head->yRot = yRot / (180 / M_PI); + head->xRot = xRot / (180 / M_PI); } \ No newline at end of file diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/SkiModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/SkiModel.cpp index 00a3b65d0..efee965a0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/SkiModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/SkiModel.cpp @@ -36,10 +36,10 @@ void SkiModel::render(std::shared_ptr entity, float time, float r, void SkiModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity) { cubes[0]->y = 24.2f; - cubes[0]->xRot = PI * .5f; + cubes[0]->xRot = M_PI * .5f; cubes[1]->y = 24.2f; - cubes[1]->xRot = PI * .5f; + cubes[1]->xRot = M_PI * .5f; if (leftSki) { cubes[0]->z = -26 - 12 * (cos(time * 0.6662f) * 0.7f) * r; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp index c540f8dd3..d90047517 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/SnowManModel.cpp @@ -41,9 +41,9 @@ void SnowManModel::setupAnim(float time, float r, float bob, float yRot, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { Model::setupAnim(time, r, bob, yRot, xRot, scale, entity); - head->yRot = yRot / (float)(180 / PI); - head->xRot = xRot / (float)(180 / PI); - piece1->yRot = (yRot / (float)(180 / PI)) * 0.25f; + head->yRot = yRot / (float)(180 / M_PI); + head->xRot = xRot / (float)(180 / M_PI); + piece1->yRot = (yRot / (float)(180 / M_PI)) * 0.25f; float s = Mth::sin(piece1->yRot); float c = Mth::cos(piece1->yRot); @@ -51,7 +51,7 @@ void SnowManModel::setupAnim(float time, float r, float bob, float yRot, arm1->zRot = 1; arm2->zRot = -1; arm1->yRot = 0 + piece1->yRot; - arm2->yRot = PI + piece1->yRot; + arm2->yRot = M_PI + piece1->yRot; arm1->x = (c) * 5; arm1->z = (-s) * 5; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp index fe4c4fba7..750b41da0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/SpiderModel.cpp @@ -89,10 +89,10 @@ void SpiderModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - head->yRot = yRot / (float)(180 / PI); - head->xRot = xRot / (float)(180 / PI); + head->yRot = yRot / (float)(180 / M_PI); + head->xRot = xRot / (float)(180 / M_PI); - float sr = (float)PI / 4.0f; + float sr = (float)M_PI / 4.0f; leg0->zRot = -sr; leg1->zRot = sr; @@ -105,8 +105,8 @@ void SpiderModel::setupAnim(float time, float r, float bob, float yRot, leg6->zRot = -sr; leg7->zRot = sr; - float ro = -(float)PI / 2.0f * 0; - float ur = (float)PI / 8.0f; + float ro = -(float)M_PI / 2.0f * 0; + float ur = (float)M_PI / 8.0f; leg0->yRot = +ur * 2.0f + ro; leg1->yRot = -ur * 2.0f - ro; leg2->yRot = +ur * 1.0f + ro; @@ -117,22 +117,22 @@ void SpiderModel::setupAnim(float time, float r, float bob, float yRot, leg7->yRot = +ur * 2.0f - ro; float c0 = - -((float)Mth::cos(time * 0.6662f * 2 + PI * 2 * 0 / 4.0f) * 0.4f) * r; + -((float)Mth::cos(time * 0.6662f * 2 + M_PI * 2 * 0 / 4.0f) * 0.4f) * r; float c1 = - -((float)Mth::cos(time * 0.6662f * 2 + PI * 2 * 2 / 4.0f) * 0.4f) * r; + -((float)Mth::cos(time * 0.6662f * 2 + M_PI * 2 * 2 / 4.0f) * 0.4f) * r; float c2 = - -((float)Mth::cos(time * 0.6662f * 2 + PI * 2 * 1 / 4.0f) * 0.4f) * r; + -((float)Mth::cos(time * 0.6662f * 2 + M_PI * 2 * 1 / 4.0f) * 0.4f) * r; float c3 = - -((float)Mth::cos(time * 0.6662f * 2 + PI * 2 * 3 / 4.0f) * 0.4f) * r; + -((float)Mth::cos(time * 0.6662f * 2 + M_PI * 2 * 3 / 4.0f) * 0.4f) * r; float s0 = - abs((float)Mth::sin(time * 0.6662f + PI * 2 * 0 / 4.0f) * 0.4f) * r; + abs((float)Mth::sin(time * 0.6662f + M_PI * 2 * 0 / 4.0f) * 0.4f) * r; float s1 = - abs((float)Mth::sin(time * 0.6662f + PI * 2 * 2 / 4.0f) * 0.4f) * r; + abs((float)Mth::sin(time * 0.6662f + M_PI * 2 * 2 / 4.0f) * 0.4f) * r; float s2 = - abs((float)Mth::sin(time * 0.6662f + PI * 2 * 1 / 4.0f) * 0.4f) * r; + abs((float)Mth::sin(time * 0.6662f + M_PI * 2 * 1 / 4.0f) * 0.4f) * r; float s3 = - abs((float)Mth::sin(time * 0.6662f + PI * 2 * 3 / 4.0f) * 0.4f) * r; + abs((float)Mth::sin(time * 0.6662f + M_PI * 2 * 3 / 4.0f) * 0.4f) * r; leg0->yRot += +c0; leg1->yRot += -c0; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/SquidModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/SquidModel.cpp index 17aadf49d..5f4c73f40 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/SquidModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/SquidModel.cpp @@ -13,7 +13,7 @@ SquidModel::SquidModel() : Model() { { tentacles[i] = new ModelPart(this, 48, 0); - double angle = i * PI * 2.0 / + double angle = i * M_PI * 2.0 / (double)TENTACLES_LENGTH; // 4J - 8 was tentacles.length float xo = Mth::cos((float)angle) * 5; float yo = Mth::sin((float)angle) * 5; @@ -23,8 +23,8 @@ SquidModel::SquidModel() : Model() { tentacles[i]->z = yo; tentacles[i]->y = (float)(31 + yoffs); - angle = i * PI * -2.0 / (double)TENTACLES_LENGTH + - PI * .5; // 4J - 8 was tentacles.length + angle = i * M_PI * -2.0 / (double)TENTACLES_LENGTH + + M_PI * .5; // 4J - 8 was tentacles.length tentacles[i]->yRot = (float)angle; // 4J added - compile now to avoid random performance hit first time diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp index a6c03feee..09b6260d0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerGolemModel.cpp @@ -52,8 +52,8 @@ void VillagerGolemModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - head->yRot = yRot / (float)(180 / PI); - head->xRot = xRot / (float)(180 / PI); + head->yRot = yRot / (float)(180 / M_PI); + head->xRot = xRot / (float)(180 / M_PI); leg0->xRot = (-1.5f * triangleWave(time, 13)) * r; leg1->xRot = (1.5f * triangleWave(time, 13)) * r; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp index dd1793e8d..2f2184083 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerModel.cpp @@ -67,15 +67,15 @@ void VillagerModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - head->yRot = yRot / (float)(180 / PI); - head->xRot = xRot / (float)(180 / PI); + head->yRot = yRot / (float)(180 / M_PI); + head->xRot = xRot / (float)(180 / M_PI); arms->y = 3; arms->z = -1; arms->xRot = -0.75f; leg0->xRot = ((float)Mth::cos(time * 0.6662f) * 1.4f) * r * 0.5f; - leg1->xRot = ((float)Mth::cos(time * 0.6662f + PI) * 1.4f) * r * 0.5f; + leg1->xRot = ((float)Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r * 0.5f; leg0->yRot = 0; leg1->yRot = 0; } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp index b789dee24..6c11c71d1 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/VillagerZombieModel.cpp @@ -39,14 +39,14 @@ void VillagerZombieModel::setupAnim(float time, float r, float bob, float yRot, HumanoidModel::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim); - float attack2 = Mth::sin(attackTime * PI); - float attack = Mth::sin((1 - (1 - attackTime) * (1 - attackTime)) * PI); + float attack2 = Mth::sin(attackTime * M_PI); + float attack = Mth::sin((1 - (1 - attackTime) * (1 - attackTime)) * M_PI); arm0->zRot = 0; arm1->zRot = 0; arm0->yRot = -(0.1f - attack2 * 0.6f); arm1->yRot = +(0.1f - attack2 * 0.6f); - arm0->xRot = -PI / 2.0f; - arm1->xRot = -PI / 2.0f; + arm0->xRot = -M_PI / 2.0f; + arm1->xRot = -M_PI / 2.0f; arm0->xRot -= attack2 * 1.2f - attack * 0.4f; arm1->xRot -= attack2 * 1.2f - attack * 0.4f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/WitchModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/WitchModel.cpp index f1eb47a96..c637fad03 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/WitchModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/WitchModel.cpp @@ -57,9 +57,9 @@ void WitchModel::setupAnim(float time, float r, float bob, float yRot, nose->translateX = nose->translateY = nose->translateZ = 0; float speed = 0.01f * (entity->entityId % 10); - nose->xRot = (sin(entity->tickCount * speed) * 4.5f) * PI / 180; + nose->xRot = (sin(entity->tickCount * speed) * 4.5f) * M_PI / 180; nose->yRot = 0; - nose->zRot = (cos(entity->tickCount * speed) * 2.5f) * PI / 180; + nose->zRot = (cos(entity->tickCount * speed) * 2.5f) * M_PI / 180; if (holdingItem) { nose->xRot = -0.9f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp index 00542bd68..36e68e445 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/WitherBossModel.cpp @@ -56,14 +56,14 @@ void WitherBossModel::setupAnim(float time, float r, float bob, float yRot, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { float anim = cos(bob * .1f); - upperBodyParts[1]->xRot = (.065f + .05f * anim) * PI; + upperBodyParts[1]->xRot = (.065f + .05f * anim) * M_PI; upperBodyParts[2]->setPos(-2.f, 6.9f + cos(upperBodyParts[1]->xRot) * 10.f, -.5f + sin(upperBodyParts[1]->xRot) * 10.f); - upperBodyParts[2]->xRot = (.265f + .1f * anim) * PI; + upperBodyParts[2]->xRot = (.265f + .1f * anim) * M_PI; - heads[0]->yRot = yRot / (180 / PI); - heads[0]->xRot = xRot / (180 / PI); + heads[0]->yRot = yRot / (180 / M_PI); + heads[0]->xRot = xRot / (180 / M_PI); } void WitherBossModel::prepareMobModel(std::shared_ptr mob, @@ -73,7 +73,7 @@ void WitherBossModel::prepareMobModel(std::shared_ptr mob, for (int i = 1; i < 3; i++) { heads[i]->yRot = - (boss->getHeadYRot(i - 1) - mob->yBodyRot) / (180 / PI); - heads[i]->xRot = boss->getHeadXRot(i - 1) / (180 / PI); + (boss->getHeadYRot(i - 1) - mob->yBodyRot) / (180 / M_PI); + heads[i]->xRot = boss->getHeadXRot(i - 1) / (180 / M_PI); } } \ No newline at end of file diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/WolfModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/WolfModel.cpp index d26e5d57c..a6b271cd0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/WolfModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/WolfModel.cpp @@ -104,26 +104,26 @@ void WolfModel::prepareMobModel(std::shared_ptr mob, float time, if (wolf->isSitting()) { upperBody->setPos(-1.0f, 11 + 13.0f - 8, -3); - upperBody->xRot = .40f * PI; - upperBody->yRot = .0f * PI; + upperBody->xRot = .40f * M_PI; + upperBody->yRot = .0f * M_PI; body->setPos(0, 11 + 15 - legSize, 0); - body->xRot = .25f * PI; + body->xRot = .25f * M_PI; tail->setPos(-1, 11 + 18 - legSize, 6); leg0->setPos(-2.5f, 18 + 12 - legSize, 2); - leg0->xRot = 1.5f * PI; + leg0->xRot = 1.5f * M_PI; leg1->setPos(.5f, 18 + 12 - legSize, 2); - leg1->xRot = 1.5f * PI; + leg1->xRot = 1.5f * M_PI; - leg2->xRot = 1.85f * PI; + leg2->xRot = 1.85f * M_PI; leg2->setPos(-2.49f, 18 + 7.0f - legSize, -4); - leg3->xRot = 1.85f * PI; + leg3->xRot = 1.85f * M_PI; leg3->setPos(.51f, 18 + 7.0f - legSize, -4); } else { body->setPos(0, 11 + 11 - legSize, 2); - body->xRot = 90 / (float)(180 / PI); + body->xRot = 90 / (float)(180 / M_PI); upperBody->setPos(-1.0f, 11 + 11.0f - legSize, -3); upperBody->xRot = body->xRot; @@ -136,8 +136,8 @@ void WolfModel::prepareMobModel(std::shared_ptr mob, float time, leg3->setPos(.5f, 18 + 6 - legSize, -4); leg0->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; - leg1->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; - leg2->xRot = (Mth::cos(time * 0.6662f + PI) * 1.4f) * r; + leg1->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; + leg2->xRot = (Mth::cos(time * 0.6662f + M_PI) * 1.4f) * r; leg3->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; } @@ -154,7 +154,7 @@ void WolfModel::setupAnim(float time, float r, float bob, float yRot, std::shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { Model::setupAnim(time, r, bob, yRot, xRot, scale, entity); - head->xRot = xRot / (float)(180 / PI); - head->yRot = yRot / (float)(180 / PI); + head->xRot = xRot / (float)(180 / M_PI); + head->yRot = yRot / (float)(180 / M_PI); tail->xRot = bob; } \ No newline at end of file diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp index 4f6e5e2e2..9d531e417 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/ZombieModel.cpp @@ -18,14 +18,14 @@ void ZombieModel::setupAnim(float time, float r, float bob, float yRot, HumanoidModel::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim); - float attack2 = Mth::sin(attackTime * PI); - float attack = Mth::sin((1 - (1 - attackTime) * (1 - attackTime)) * PI); + float attack2 = Mth::sin(attackTime * M_PI); + float attack = Mth::sin((1 - (1 - attackTime) * (1 - attackTime)) * M_PI); arm0->zRot = 0; arm1->zRot = 0; arm0->yRot = -(0.1f - attack2 * 0.6f); arm1->yRot = +(0.1f - attack2 * 0.6f); - arm0->xRot = -(float)PI / 2.0f; - arm1->xRot = -(float)PI / 2.0f; + arm0->xRot = -(float)M_PI / 2.0f; + arm1->xRot = -(float)M_PI / 2.0f; arm0->xRot -= attack2 * 1.2f - attack * 0.4f; arm1->xRot -= attack2 * 1.2f - attack * 0.4f; arm0->zRot += ((Mth::cos(bob * 0.09f)) * 0.05f + 0.05f); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp index 258e1d630..5508dc16e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/dragon/DragonModel.cpp @@ -119,9 +119,9 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, std::dynamic_pointer_cast(entity); float ttt = dragon->oFlapTime + (dragon->flapTime - dragon->oFlapTime) * a; - jaw->xRot = (float)(Mth::sin(ttt * PI * 2) + 1) * 0.2f; + jaw->xRot = (float)(Mth::sin(ttt * M_PI * 2) + 1) * 0.2f; - float yo = (float)(Mth::sin(ttt * PI * 2 - 1) + 1); + float yo = (float)(Mth::sin(ttt * M_PI * 2 - 1) + 1); yo = (yo * yo * 1 + yo * 2) * 0.05f; glTranslatef(0, yo - 2.0f, -3); @@ -148,7 +148,7 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, yy += 2.0f; float rr = 0; - float roff = ttt * PI * 2.0f; + float roff = ttt * M_PI * 2.0f; yy = 20.0f; zz = -12.0f; double pComponents[3]; @@ -158,14 +158,14 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, dragon->getLatencyPos(p, 5 - i, a); rr = (float)Mth::cos(i * 0.45f + roff) * 0.15f; - neck->yRot = rotWrap(dragon->getHeadPartYRotDiff(i, start, p)) * PI / + neck->yRot = rotWrap(dragon->getHeadPartYRotDiff(i, start, p)) * M_PI / 180.0f * rotScale; // 4J replaced "p[0] - start[0] with // call to getHeadPartYRotDiff neck->xRot = rr + (float)(dragon->getHeadPartYOffset(i, start, p)) * - PI / 180.0f * rotScale * + M_PI / 180.0f * rotScale * 5.0f; // 4J replaced "p[1] - start[1]" with call // to getHeadPartYOffset - neck->zRot = -rotWrap(p[0] - rot) * PI / 180.0f * rotScale; + neck->zRot = -rotWrap(p[0] - rot) * M_PI / 180.0f * rotScale; neck->y = yy; neck->z = zz; @@ -181,11 +181,11 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, head->x = xx; dragon->getLatencyPos(p, 0, a); head->yRot = - rotWrap(dragon->getHeadPartYRotDiff(6, start, p)) * PI / 180.0f * + rotWrap(dragon->getHeadPartYRotDiff(6, start, p)) * M_PI / 180.0f * 1; // 4J replaced "p[0] - start[0] with call to getHeadPartYRotDiff - head->xRot = (float)(dragon->getHeadPartYOffset(6, start, p)) * PI / + head->xRot = (float)(dragon->getHeadPartYOffset(6, start, p)) * M_PI / 180.0f * rotScale * 5.0f; // 4J Added - head->zRot = -rotWrap(p[0] - rot) * PI / 180 * 1; + head->zRot = -rotWrap(p[0] - rot) * M_PI / 180 * 1; head->render(scale, usecompiled); glPushMatrix(); glTranslatef(0, 1, 0); @@ -196,7 +196,7 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, glEnable(GL_CULL_FACE); for (int i = 0; i < 2; i++) { - float flapTime = ttt * PI * 2; + float flapTime = ttt * M_PI * 2; wing->xRot = 0.125f - (float)(Mth::cos(flapTime)) * 0.2f; wing->yRot = 0.25f; wing->zRot = (float)(Mth::sin(flapTime) + 0.125f) * 0.8f; @@ -221,8 +221,8 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, glCullFace(GL_BACK); glDisable(GL_CULL_FACE); - rr = -(float)Mth::sin(ttt * PI * 2) * 0.0f; - roff = ttt * PI * 2; + rr = -(float)Mth::sin(ttt * M_PI * 2) * 0.0f; + roff = ttt * M_PI * 2; yy = 10; zz = 60; xx = 0; @@ -230,9 +230,9 @@ void DragonModel::render(std::shared_ptr entity, float time, float r, for (int i = 0; i < 12; i++) { dragon->getLatencyPos(p, 12 + i, a); rr += Mth::sin(i * 0.45f + roff) * 0.05f; - neck->yRot = (rotWrap(p[0] - start[0]) * rotScale + 180) * PI / 180; - neck->xRot = rr + (float)(p[1] - start[1]) * PI / 180 * rotScale * 5; - neck->zRot = rotWrap(p[0] - rot) * PI / 180 * rotScale; + neck->yRot = (rotWrap(p[0] - start[0]) * rotScale + 180) * M_PI / 180; + neck->xRot = rr + (float)(p[1] - start[1]) * M_PI / 180 * rotScale * 5; + neck->zRot = rotWrap(p[0] - rot) * M_PI / 180 * rotScale; neck->y = yy; neck->z = zz; neck->x = xx; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/geom/Model.h b/minecraft/Minecraft.Client/net/minecraft/client/model/geom/Model.h index dda9730d8..ee29f6d20 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/geom/Model.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/geom/Model.h @@ -1,6 +1,6 @@ #pragma once -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "../../../../../Header Files/SkinBox.h" class Mob; class ModelPart; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp b/minecraft/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp index 8c55fb120..a1efa00c9 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/model/geom/ModelPart.cpp @@ -3,7 +3,7 @@ #include "ModelPart.h" #include "Cube.h" -const float ModelPart::RAD = (180.0f / PI); +const float ModelPart::RAD = (180.0f / M_PI); void ModelPart::_init() { xTexSize = 64.0f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp index c726e858a..4d027ded3 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp @@ -37,7 +37,7 @@ #include "Minecraft.World/net/minecraft/SharedConstants.h" #include "Minecraft.World/net/minecraft/world/phys/AABB.h" #include "Minecraft.World/net/minecraft/Pos.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "../Minecraft.h" #include "../ProgressRenderer.h" #include "../renderer/LevelRenderer.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp index 69667da9a..5f2878865 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerChunkCache.cpp @@ -3,7 +3,7 @@ #include "../../server/level/ServerChunkCache.h" #include "Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" #include "Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" -#include "Minecraft.World/ConsoleJavaLibs/Arrays.h" +#include "java/Arrays.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "../../server/MinecraftServer.h" #include "../../server/level/ServerLevel.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp index 25ade8363..8262021e5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp @@ -14,7 +14,7 @@ #include "Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.h" #include "Minecraft.World/net/minecraft/world/level/tile/Tile.h" #include "Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" MultiPlayerLevel::ResetInfo::ResetInfo(int x, int y, int z, int tile, int data) { diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h index 1d23a38a3..0872cf8fe 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h @@ -3,7 +3,7 @@ #include "Minecraft.World/ConsoleHelpers/HashExtension.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class ClientConnection; class MultiPlayerChunkCache; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp index a6ec0b02c..9e51e8644 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -// #include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "MultiPlayerLocalPlayer.h" #include "ClientConnection.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp index d368a47a6..f0c45e2b5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/BubbleParticle.cpp @@ -1,8 +1,8 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "BubbleParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/util/Mth.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp index 3047c2084..36f69aaa7 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "CritParticle.h" #include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp index 827272b50..79a91be92 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/CritParticle2.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "CritParticle2.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" void CritParticle2::_init(double xa, double ya, double za, float scale) { xd *= 0.1f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp index 4bd709f80..a3fad3228 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/DragonBreathParticle.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "DragonBreathParticle.h" void DragonBreathParticle::init(Level* level, double x, double y, double z, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp index d708098e5..ad70defba 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/DripParticle.cpp @@ -2,7 +2,7 @@ #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/util/Mth.h" #include "DripParticle.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp index b5595aa1f..d73f741a0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/EnchantmentTableParticle.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "EnchantmentTableParticle.h" EchantmentTableParticle::EchantmentTableParticle(Level* level, double x, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp index bf760a877..d5545ae98 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/EnderParticle.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "EnderParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/JavaMath.h" +#include "java/Random.h" // 4J Stu - This class was originally "PortalParticle" but I have split the two // uses of the particle End creatures/items (e.g. EnderMan, EyeOfEnder, etc) use diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp index c3e840458..25873ee2c 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/ExplodeParticle.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "ExplodeParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/JavaMath.h" +#include "java/Random.h" ExplodeParticle::ExplodeParticle(Level* level, double x, double y, double z, double xa, double ya, double za) diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp index 0b19f13d0..704d1e892 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.cpp @@ -246,10 +246,10 @@ void FireworksParticles::FireworksStarter::createParticleShape( fadeColors, trail, flicker); } - float baseAngle = random->nextFloat() * PI; + float baseAngle = random->nextFloat() * M_PI; double angleMod = (flat ? .034 : .34); for (int angleStep = 0; angleStep < 3; angleStep++) { - double angle = baseAngle + angleStep * PI * angleMod; + double angle = baseAngle + angleStep * M_PI * angleMod; double ox = sx; double oy = sy; @@ -434,7 +434,7 @@ void FireworksParticles::FireworksOverlayParticle::render(Tesselator* t, float u1 = u0 + 32.0f / 128.0f; float v0 = 16.0f / 128.0f; float v1 = v0 + 32.0f / 128.0f; - float r = 7.1f * sin(((float)age + a - 1.0f) * .25f * PI); + float r = 7.1f * sin(((float)age + a - 1.0f) * .25f * M_PI); alpha = 0.6f - ((float)age + a - 1.0f) * .25f * .5f; float x = (float)(xo + (this->x - xo) * a - xOff); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h b/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h index f47c1c4eb..da3895e25 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/FireworksParticles.h @@ -1,6 +1,6 @@ #pragma once #include "Particle.h" -#include "Minecraft.World/com/mojang/nbt/CompoundTag.h" +#include "nbt/CompoundTag.h" class ParticleEngine; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp index ad191db3e..0601ca8b5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/FlameParticle.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/JavaMath.h" +#include "java/Random.h" #include "FlameParticle.h" FlameParticle::FlameParticle(Level* level, double x, double y, double z, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp index 761a54855..36bcf60ba 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionParticle.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "HugeExplosionParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "../renderer/Textures.h" #include "../renderer/Tesselator.h" #include "../Lighting.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp index b4ce2a574..c2a4b609c 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/HugeExplosionSeedParticle.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "HugeExplosionSeedParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" HugeExplosionSeedParticle::HugeExplosionSeedParticle(Level* level, double x, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp index 0f8e76af5..3b1c6e764 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/LavaParticle.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "LavaParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/JavaMath.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" LavaParticle::LavaParticle(Level* level, double x, double y, double z) diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp index 6a37b7299..d661b8a7b 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/NetherPortalParticle.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "NetherPortalParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/JavaMath.h" +#include "java/Random.h" #include "../Minecraft.h" // 4J Stu - This class was originally "PortalParticle" but I have split the two diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp index f89f34f1d..74acfff1d 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/NoteParticle.cpp @@ -18,9 +18,9 @@ gMin = ( (cMin>>8)&0xFF )/255.0, bMin = ( cMin&0xFF )/255.0; double rMax = ( (cMax>>16)&0xFF )/255.0f, gMax = ( (cMax>>8)&0xFF )/255.0, bMax = ( cMax&0xFF )/255.0; -rCol = Mth::sin(((float) xa + 0.0f / 3) * PI * 2) * (rMax - rMin) + rMin; -gCol = Mth::sin(((float) xa + 1.0f / 3) * PI * 2) * (gMax - gMin) + gMin; -bCol = Mth::sin(((float) xa + 2.0f / 3) * PI * 2) * (bMax - bMin) + bMin; +rCol = Mth::sin(((float) xa + 0.0f / 3) * M_PI * 2) * (rMax - rMin) + rMin; +gCol = Mth::sin(((float) xa + 1.0f / 3) * M_PI * 2) * (gMax - gMin) + gMin; +bCol = Mth::sin(((float) xa + 2.0f / 3) * M_PI * 2) * (bMax - bMin) + bMin; */ // 4J-JEV: Added, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/Particle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/Particle.cpp index be03138ba..bf96905d3 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/Particle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/Particle.cpp @@ -1,9 +1,9 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Particle.h" #include "../renderer/Tesselator.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/util/Mth.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/net.minecraft.world.h" /* diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp index 74c5edad5..d184f4e80 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp @@ -155,7 +155,7 @@ void ParticleEngine::renderLit(std::shared_ptr player, float a, Particle::yOff = (player->yOld + (player->y - player->yOld) * a); Particle::zOff = (player->zOld + (player->z - player->zOld) * a); - float RAD = PI / 180; + float RAD = M_PI / 180; float xa = (float)Mth::cos(player->yRot * RAD); float za = (float)Mth::sin(player->yRot * RAD); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp index f6131cd32..a47903df5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/PlayerCloudParticle.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "PlayerCloudParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" #include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp index 625fc730d..bf768afb5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/RedDustParticle.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "RedDustParticle.h" void RedDustParticle::init(Level* level, double x, double y, double z, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp index 09600bb90..d7e1f3e91 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/SmokeParticle.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "SmokeParticle.h" void SmokeParticle::init(Level* level, double x, double y, double z, double xa, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp index 9d9e83bfd..60e36491f 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/SnowShovelParticle.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "SnowShovelParticle.h" void SnowShovelParticle::init(Level* level, double x, double y, double z, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp index 853a5a970..2332bca7e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/SpellParticle.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "SpellParticle.h" SpellParticle::SpellParticle(Level* level, double x, double y, double z, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp index d22430cfb..e866c214b 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedParticle.cpp @@ -1,8 +1,8 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "SuspendedParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/util/Mth.h" #include "Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp index 31d752405..7d485e3f7 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/SuspendedTownParticle.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "SuspendedTownParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/Random.h" +#include "java/JavaMath.h" SuspendedTownParticle::SuspendedTownParticle(Level* level, double x, double y, double z, double xa, double ya, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp index 5916c3f78..93aa00677 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/WaterDropParticle.cpp @@ -1,6 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "WaterDropParticle.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/material/net.minecraft.world.level.material.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp index f19e5675c..933cfcb53 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/player/LocalPlayer.cpp @@ -36,8 +36,8 @@ #include "Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" #include "Minecraft.World/net/minecraft/stats/net.minecraft.stats.h" -#include "Minecraft.World/com/mojang/nbt/com.mojang.nbt.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "nbt/com.mojang.nbt.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h" #include "Minecraft.World/net/minecraft/util/Mth.h" #include "../gui/achievement/AchievementPopup.h" @@ -150,7 +150,7 @@ void LocalPlayer::serverAiStep() { // Don't bother for tiny inputs if (fMag >= 0.1f) { // Get angle (in player rotated space) of input controls - float yRotInput = atan2f(input->ya, input->xa) * (180.0f / PI); + float yRotInput = atan2f(input->ya, input->xa) * (180.0f / M_PI); // Now get in world space float yRotFinal = yRotInput + yRot; // Snap this to nearest 90 degrees @@ -161,8 +161,8 @@ void LocalPlayer::serverAiStep() { float yRotInputAdjust = yRotInput + yRotDiff; // Calculate final x/y player-space movement required - this->xxa = cos(yRotInputAdjust * (PI / 180.0f)) * fMag; - this->yya = sin(yRotInputAdjust * (PI / 180.0f)) * fMag; + this->xxa = cos(yRotInputAdjust * (M_PI / 180.0f)) * fMag; + this->yya = sin(yRotInputAdjust * (M_PI / 180.0f)) * fMag; } else { this->xxa = input->xa; this->yya = input->ya; @@ -354,11 +354,11 @@ void LocalPlayer::aiStep() { if (InputManager.GetJoypadMapVal(m_iPad) == 0) { if (ullDpad_filtered & (1LL << MINECRAFT_ACTION_DPAD_RIGHT)) { - xd = -0.15 * cos(yRotSnapped * PI / 180); - zd = -0.15 * sin(yRotSnapped * PI / 180); + xd = -0.15 * cos(yRotSnapped * M_PI / 180); + zd = -0.15 * sin(yRotSnapped * M_PI / 180); } else if (ullDpad_filtered & (1LL << MINECRAFT_ACTION_DPAD_LEFT)) { - xd = 0.15 * cos(yRotSnapped * PI / 180); - zd = 0.15 * sin(yRotSnapped * PI / 180); + xd = 0.15 * cos(yRotSnapped * M_PI / 180); + zd = 0.15 * sin(yRotSnapped * M_PI / 180); } } } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp index cf933100a..79b39f957 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp @@ -27,13 +27,13 @@ #include "Minecraft.World/net/minecraft/world/level/biome/net.minecraft.world.level.biome.h" #include "Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" #include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "java/System.h" +#include "java/FloatBuffer.h" #include "Minecraft.World/ConsoleHelpers/ThreadName.h" #include "Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h" #include "Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.h" #include "Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/Facing.h" #include "Minecraft.World/net/minecraft/world/effect/MobEffect.h" #include "Minecraft.World/net/minecraft/util/SmoothFloat.h" @@ -407,7 +407,7 @@ void GameRenderer::bobHurt(float a) { if (hurt < 0) return; hurt /= player->hurtDuration; - hurt = (float)Mth::sin(hurt * hurt * hurt * hurt * PI); + hurt = (float)Mth::sin(hurt * hurt * hurt * hurt * M_PI); float rr = player->hurtDir; @@ -426,10 +426,10 @@ void GameRenderer::bobView(float a) { float b = -(player->walkDist + wda * a); float bob = player->oBob + (player->bob - player->oBob) * a; float tilt = player->oTilt + (player->tilt - player->oTilt) * a; - glTranslatef((float)Mth::sin(b * PI) * bob * 0.5f, - -(float)abs(Mth::cos(b * PI) * bob), 0); - glRotatef((float)Mth::sin(b * PI) * bob * 3, 0, 0, 1); - glRotatef((float)abs(Mth::cos(b * PI - 0.2f) * bob) * 5, 1, 0, 0); + glTranslatef((float)Mth::sin(b * M_PI) * bob * 0.5f, + -(float)abs(Mth::cos(b * M_PI) * bob), 0); + glRotatef((float)Mth::sin(b * M_PI) * bob * 3, 0, 0, 1); + glRotatef((float)abs(Mth::cos(b * M_PI - 0.2f) * bob) * 5, 1, 0, 0); glRotatef((float)tilt, 1, 0, 0); } @@ -500,11 +500,11 @@ void GameRenderer::moveCameraToPlayer(float a) { xRot += 180.0f; } - double xd = -Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI) * + double xd = -Mth::sin(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI) * cameraDist; - double zd = Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI) * + double zd = Mth::cos(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI) * cameraDist; - double yd = -Mth::sin(xRot / 180 * PI) * cameraDist; + double yd = -Mth::sin(xRot / 180 * M_PI) * cameraDist; for (int i = 0; i < 8; i++) { float xo = (float)((i & 1) * 2 - 1); @@ -961,7 +961,7 @@ float GameRenderer::getNightVisionScale(std::shared_ptr player, return 1.0f; } else { float flash = std::max(0.0f, (float)duration - a); - return .7f + Mth::sin(flash * PI * .05f) * + return .7f + Mth::sin(flash * M_PI * .05f) * .3f; // was: .7 + sin(flash*pi*0.2) * .3 } } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp index c98c19d28..94c83d650 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp @@ -477,16 +477,16 @@ void ItemInHandRenderer::render(float a) { { float swing = player->getAttackAnim(a); - float swing1 = Mth::sin(swing * PI); - float swing2 = Mth::sin((sqrt(swing)) * PI); - glTranslatef(-swing2 * 0.4f, Mth::sin(sqrt(swing) * PI * 2) * 0.2f, + float swing1 = Mth::sin(swing * M_PI); + float swing2 = Mth::sin((sqrt(swing)) * M_PI); + glTranslatef(-swing2 * 0.4f, Mth::sin(sqrt(swing) * M_PI * 2) * 0.2f, -swing1 * 0.2f); } float tilt = 1 - xr / 45.0f + 0.1f; if (tilt < 0) tilt = 0; if (tilt > 1) tilt = 1; - tilt = -Mth::cos(tilt * PI) * 0.5f + 0.5f; + tilt = -Mth::cos(tilt * M_PI) * 0.5f + 0.5f; glTranslatef(0.0f, 0.0f * d - (1 - h) * 1.2f - tilt * 0.5f + 0.04f, -0.9f * d); @@ -537,8 +537,8 @@ void ItemInHandRenderer::render(float a) { { float swing = player->getAttackAnim(a); - float swing3 = Mth::sin(swing * swing * PI); - float swing2 = Mth::sin(sqrt(swing) * PI); + float swing3 = Mth::sin(swing * swing * M_PI); + float swing2 = Mth::sin(sqrt(swing) * M_PI); glRotatef(-swing3 * 20, 0, 1, 0); glRotatef(-swing2 * 20, 0, 0, 1); glRotatef(-swing2 * 80, 1, 0, 0); @@ -603,7 +603,7 @@ void ItemInHandRenderer::render(float a) { is = is * is * is; float iss = 1 - is; glTranslatef(0, - Mth::abs(Mth::cos(t / 4 * PI) * 0.1f) * + Mth::abs(Mth::cos(t / 4 * M_PI) * 0.1f) * (swing > 0.2 ? 1 : 0), 0); glTranslatef(iss * 0.6f, -iss * 0.5f, 0); @@ -614,9 +614,9 @@ void ItemInHandRenderer::render(float a) { } else { float swing = powf(player->getAttackAnim(a), swingPowFactor); - float swing1 = Mth::sin(swing * PI); - float swing2 = Mth::sin((sqrt(swing)) * PI); - glTranslatef(-swing2 * 0.4f, Mth::sin(sqrt(swing) * PI * 2) * 0.2f, + float swing1 = Mth::sin(swing * M_PI); + float swing2 = Mth::sin((sqrt(swing)) * M_PI); + glTranslatef(-swing2 * 0.4f, Mth::sin(sqrt(swing) * M_PI * 2) * 0.2f, -swing1 * 0.2f); } @@ -627,8 +627,8 @@ void ItemInHandRenderer::render(float a) { glEnable(GL_RESCALE_NORMAL); float swing = powf(player->getAttackAnim(a), swingPowFactor); - float swing3 = Mth::sin(swing * swing * PI); - float swing2 = Mth::sin(sqrt(swing) * PI); + float swing3 = Mth::sin(swing * swing * M_PI); + float swing2 = Mth::sin(sqrt(swing) * M_PI); glRotatef(-swing3 * 20, 0, 1, 0); glRotatef(-swing2 * 20, 0, 0, 1); glRotatef(-swing2 * 80, 1, 0, 0); @@ -700,9 +700,9 @@ void ItemInHandRenderer::render(float a) { { float swing = player->getAttackAnim(a); - float swing1 = Mth::sin(swing * PI); - float swing2 = Mth::sin((sqrt(swing)) * PI); - glTranslatef(-swing2 * 0.3f, Mth::sin(sqrt(swing) * PI * 2) * 0.4f, + float swing1 = Mth::sin(swing * M_PI); + float swing2 = Mth::sin((sqrt(swing)) * M_PI); + glTranslatef(-swing2 * 0.3f, Mth::sin(sqrt(swing) * M_PI * 2) * 0.4f, -swing1 * 0.4f); } @@ -713,8 +713,8 @@ void ItemInHandRenderer::render(float a) { glEnable(GL_RESCALE_NORMAL); { float swing = player->getAttackAnim(a); - float swing3 = Mth::sin(swing * swing * PI); - float swing2 = Mth::sin(sqrt(swing) * PI); + float swing3 = Mth::sin(swing * swing * M_PI); + float swing2 = Mth::sin(sqrt(swing) * M_PI); glRotatef(swing2 * 70, 0, 1, 0); glRotatef(-swing3 * 20, 0, 0, 1); } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp index 22065459f..ba168552a 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp @@ -48,15 +48,15 @@ #include "../Options.h" #include "../multiplayer/MultiPlayerChunkCache.h" #include "Minecraft.World/Header Files/ParticleTypes.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/IntBuffer.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h" #include "Minecraft.World/net/minecraft/world/entity/player/net.minecraft.world.entity.player.h" #include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" #include "Minecraft.World/net/minecraft/world/entity/projectile/net.minecraft.world.entity.projectile.h" @@ -239,7 +239,7 @@ LevelRenderer::LevelRenderer(Minecraft* mc, Textures* textures) { 1000; // How much we raise the circle origin to make the circle // curve back towards us const int WIDTH = 10; - const float ARC_RADIANS = 2.0f * PI / ARC_SEGMENTS; + const float ARC_RADIANS = 2.0f * M_PI / ARC_SEGMENTS; const float HALF_ARC_SEG = ARC_SEGMENTS / 2; const float WIDE_ARC_SEGS = ARC_SEGMENTS / 8; const float WIDE_ARC_SEGS_SQR = WIDE_ARC_SEGS * WIDE_ARC_SEGS; @@ -307,7 +307,7 @@ void LevelRenderer::renderStars() { double xSin = sin(xRot); double xCos = cos(xRot); - double zRot = random.nextDouble() * PI * 2; + double zRot = random.nextDouble() * M_PI * 2; double zSin = sin(zRot); double zCos = cos(zRot); @@ -966,7 +966,7 @@ void LevelRenderer::renderSky(float alpha) { int steps = 16; t->color(c[0], c[1], c[2], 0.0f); for (int i = 0; i <= steps; i++) { - float a = i * PI * 2 / steps; + float a = i * M_PI * 2 / steps; float _sin = Mth::sin(a); float _cos = Mth::cos(a); t->vertex((float)(_sin * 120), (float)(_cos * 120), @@ -1959,7 +1959,7 @@ bool LevelRenderer::updateDirtyChunks() { // main thread if (bAtomic || (index == 0)) { - // PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d + // M_PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d // %d",chunk->x, chunk->y, chunk->z); static int64_t // totalTime = // 0; static int64_t countTime = 0; @@ -3321,7 +3321,7 @@ void LevelRenderer::levelEvent(std::shared_ptr source, int type, int x, random->nextDouble() * 0.2, random->nextGaussian() * .15); } - for (double a = 0; a < PI * 2.0; a += PI * 0.05) { + for (double a = 0; a < M_PI * 2.0; a += M_PI * 0.05) { addParticle(eParticleType_ender, xp + cos(a) * 5, yp - .4, zp + sin(a) * 5, cos(a) * -5, 0, sin(a) * -5); addParticle(eParticleType_ender, xp + cos(a) * 5, yp - .4, @@ -3355,7 +3355,7 @@ void LevelRenderer::levelEvent(std::shared_ptr source, int type, int x, for (int i = 0; i < 100; i++) { double dist = random->nextDouble() * ThrownPotion::SPLASH_RANGE; - double angle = random->nextDouble() * PI * 2; + double angle = random->nextDouble() * M_PI * 2; double xs = cos(angle) * dist; double ys = 0.01 + random->nextDouble() * 0.5; double zs = sin(angle) * dist; @@ -3385,7 +3385,7 @@ void LevelRenderer::levelEvent(std::shared_ptr source, int type, int x, for (int i = 0; i < 200; i++) { double dist = random->nextDouble() * DragonFireball::SPLASH_RANGE; - double angle = random->nextDouble() * PI * 2; + double angle = random->nextDouble() * M_PI * 2; double xs = cos(angle) * dist; double ys = 0.01 + random->nextDouble() * 0.5; double zs = sin(angle) * dist; @@ -3951,7 +3951,7 @@ void LevelRenderer::DestroyedTileManager::updatedChunkAt(Level* level, int x, // For game to get any AABBs that the user should be colliding with as render // data has not yet been updated void LevelRenderer::DestroyedTileManager::addAABBs(Level* level, AABB* box, - AABBList* boxes) { + std::vector* boxes) { std::lock_guard lock(m_csDestroyedTiles); for (unsigned int i = 0; i < m_destroyedTiles.size(); i++) { diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h b/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h index 8a3e8fe62..f10324a19 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.h @@ -2,7 +2,7 @@ #include "Minecraft.World/net/minecraft/world/level/LevelListener.h" #include "Minecraft.World/ConsoleHelpers/Definitions.h" #include "OffsettedRenderList.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" #include "Minecraft.World/net/minecraft/world/level/Level.h" #if !defined(__linux__) #include @@ -230,7 +230,7 @@ public: int y; int z; Level* level; - AABBList boxes; + std::vector boxes; int timeout_ticks; bool rebuilt; RecentTile(int x, int y, int z, Level* level); @@ -250,7 +250,7 @@ public: // that a chunk (a 16x16x16 tile render chunk) // has been updated void addAABBs(Level* level, AABB* box, - AABBList* boxes); // For game to get any AABBs that the + std::vector* boxes); // For game to get any AABBs that the // user should be colliding with as // render data has not yet been updated void tick(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp index b13cb63bd..6dfa7d37d 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/OffsettedRenderList.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" +#include "java/IntBuffer.h" #include "OffsettedRenderList.h" // 4J added diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp index e297cf958..b6d1aa4f4 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Tesselator.cpp @@ -1,8 +1,8 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "Tesselator.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/FloatBuffer.h" +#include "java/IntBuffer.h" +#include "java/ByteBuffer.h" bool Tesselator::TRIANGLE_MODE = false; bool Tesselator::USE_VBO = false; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp index ee79928ba..2a288c7e2 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp @@ -3,9 +3,9 @@ #include "../skins/TexturePackRepository.h" #include "HttpTexture.h" #include "../../../../Header Files/MemTexture.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h" -#include "Minecraft.World/ConsoleJavaLibs/IntBuffer.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/InputOutputStream/InputStream.h" +#include "java/IntBuffer.h" +#include "java/ByteBuffer.h" #include "../skins/TexturePack.h" #include "../Options.h" #include "../../../../Header Files/MemTextureProcessor.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.h b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.h index aacb5a37a..4f1284f3b 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.h @@ -1,6 +1,8 @@ #pragma once #include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h" +class Icon; +class Entity; class DynamicTexture; class BufferedImage; class HttpTexture; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp index a216cd95b..79e93501e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/TileRenderer.cpp @@ -748,7 +748,7 @@ bool TileRenderer::tesselateBrewingStandInWorld(BrewingStandTile* tt, int x, int data = level->getData(x, y, z); for (int arm = 0; arm < 3; arm++) { - float angle = arm * PI * 2.0f / 3.0f + PI * 0.5f; + float angle = arm * M_PI * 2.0f / 3.0f + M_PI * 0.5f; float u0 = tex->getU(8, true); float u1 = tex->getU1(true); @@ -1832,26 +1832,26 @@ bool TileRenderer::tesselateLeverInWorld(Tile* tt, int x, int y, int z) { for (int i = 0; i < 8; i++) { if (flipped) { corners[i].z -= 1 / 16.0f; - corners[i].xRot(40 * PI / 180); + corners[i].xRot(40 * M_PI / 180); } else { corners[i].z += 1 / 16.0f; - corners[i].xRot(-40 * PI / 180); + corners[i].xRot(-40 * M_PI / 180); } if (dir == 0 || dir == 7) { - corners[i].zRot(180 * PI / 180); + corners[i].zRot(180 * M_PI / 180); } if (dir == 6 || dir == 0) { - corners[i].yRot(90 * PI / 180); + corners[i].yRot(90 * M_PI / 180); } if (dir > 0 && dir < 5) { corners[i].y -= 6 / 16.0f; - corners[i].xRot(90 * PI / 180); + corners[i].xRot(90 * M_PI / 180); - if (dir == 4) corners[i].yRot(0 * PI / 180); - if (dir == 3) corners[i].yRot(180 * PI / 180); - if (dir == 2) corners[i].yRot(90 * PI / 180); - if (dir == 1) corners[i].yRot(-90 * PI / 180); + if (dir == 4) corners[i].yRot(0 * M_PI / 180); + if (dir == 3) corners[i].yRot(180 * M_PI / 180); + if (dir == 2) corners[i].yRot(90 * M_PI / 180); + if (dir == 1) corners[i].yRot(-90 * M_PI / 180); corners[i].x += x + 0.5; corners[i].y += y + 8 / 16.0f; @@ -1992,22 +1992,22 @@ bool TileRenderer::tesselateTripwireSourceInWorld(Tile* tt, int x, int y, corners[i].z += 1 / 16.0f; if (powered) { - corners[i].xRot(30 * PI / 180); + corners[i].xRot(30 * M_PI / 180); corners[i].y -= 7 / 16.0f; } else if (attached) { - corners[i].xRot(5 * PI / 180); + corners[i].xRot(5 * M_PI / 180); corners[i].y -= 7 / 16.0f; } else { - corners[i].xRot(-40 * PI / 180); + corners[i].xRot(-40 * M_PI / 180); corners[i].y -= 6 / 16.0f; } - corners[i].xRot(90 * PI / 180); + corners[i].xRot(90 * M_PI / 180); - if (dir == Direction::NORTH) corners[i].yRot(0 * PI / 180); - if (dir == Direction::SOUTH) corners[i].yRot(180 * PI / 180); - if (dir == Direction::WEST) corners[i].yRot(90 * PI / 180); - if (dir == Direction::EAST) corners[i].yRot(-90 * PI / 180); + if (dir == Direction::NORTH) corners[i].yRot(0 * M_PI / 180); + if (dir == Direction::SOUTH) corners[i].yRot(180 * M_PI / 180); + if (dir == Direction::WEST) corners[i].yRot(90 * M_PI / 180); + if (dir == Direction::EAST) corners[i].yRot(-90 * M_PI / 180); corners[i].x += x + 0.5; corners[i].y += y + 5 / 16.0f; @@ -2084,19 +2084,19 @@ bool TileRenderer::tesselateTripwireSourceInWorld(Tile* tt, int x, int y, if (powered) { corners[i].y -= 1.5 / 16.0f; corners[i].z -= 2.6 / 16.0f; - corners[i].xRot(0 * PI / 180); + corners[i].xRot(0 * M_PI / 180); } else if (attached) { corners[i].y += 0.25 / 16.0f; corners[i].z -= 2.75 / 16.0f; - corners[i].xRot(10 * PI / 180); + corners[i].xRot(10 * M_PI / 180); } else { - corners[i].xRot(50 * PI / 180); + corners[i].xRot(50 * M_PI / 180); } - if (dir == Direction::NORTH) corners[i].yRot(0 * PI / 180); - if (dir == Direction::SOUTH) corners[i].yRot(180 * PI / 180); - if (dir == Direction::WEST) corners[i].yRot(90 * PI / 180); - if (dir == Direction::EAST) corners[i].yRot(-90 * PI / 180); + if (dir == Direction::NORTH) corners[i].yRot(0 * M_PI / 180); + if (dir == Direction::SOUTH) corners[i].yRot(180 * M_PI / 180); + if (dir == Direction::WEST) corners[i].yRot(90 * M_PI / 180); + if (dir == Direction::EAST) corners[i].yRot(-90 * M_PI / 180); corners[i].x += x + 0.5; corners[i].y += y + 5 / 16.0f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp index d66f55bc2..28bcf85d4 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/Frustum.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "java/FloatBuffer.h" #include "Frustum.h" #include "../../Camera.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp index 86e594bca..2db484bd7 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/culling/ViewportCuller.cpp @@ -8,9 +8,9 @@ ViewportCuller::Face::Face(double x, double y, double z, float yRot, this->yc = y; this->zc = z; - xd = Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); - zd = -Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); - yd = -Mth::sin(xRot / 180 * PI); + xd = Mth::sin(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI); + zd = -Mth::cos(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI); + yd = -Mth::sin(xRot / 180 * M_PI); cullOffs = xc * xd + yc * yd + zc * zd; } @@ -56,9 +56,9 @@ ViewportCuller::ViewportCuller(std::shared_ptr mob, double y = mob->yOld + (mob->y - mob->yOld) * a; double z = mob->zOld + (mob->z - mob->zOld) * a; - double xd = Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); - double zd = -Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); - double yd = -Mth::sin(xRot / 180 * PI); + double xd = Mth::sin(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI); + double zd = -Mth::cos(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI); + double yd = -Mth::sin(xRot / 180 * M_PI); float xFov = 30; float yFov = 45; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp index 8fda90d71..53f0b998a 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.cpp @@ -123,8 +123,8 @@ void EnderDragonRenderer::render(std::shared_ptr _mob, double x, glPushMatrix(); glTranslatef((float)x, (float)y + 2, (float)z); - glRotatef((float)(-atan2(zd, xd)) * 180.0f / PI - 90.0f, 0, 1, 0); - glRotatef((float)(-atan2(sdd, yd)) * 180.0f / PI - 90.0f, 1, 0, 0); + glRotatef((float)(-atan2(zd, xd)) * 180.0f / M_PI - 90.0f, 0, 1, 0); + glRotatef((float)(-atan2(sdd, yd)) * 180.0f / M_PI - 90.0f, 1, 0, 0); // 4J-PB - Rotating the healing beam too static float fRot = 0.0f; @@ -157,9 +157,9 @@ void EnderDragonRenderer::render(std::shared_ptr _mob, double x, int steps = 8; for (int i = 0; i <= steps; i++) { - double d = i % steps * PI * 2 / steps; - float s = sin(i % steps * PI * 2 / steps) * 0.75f; - float c = cos(i % steps * PI * 2 / steps) * 0.75f; + double d = i % steps * M_PI * 2 / steps; + float s = sin(i % steps * M_PI * 2 / steps) * 0.75f; + float c = cos(i % steps * M_PI * 2 / steps) * 0.75f; float u = i % steps * 1.0f / steps; // t->color(0x000000); t->vertexUV(s * 0.2f, c * 0.2f, 0, u, v1); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h index bfb836dbf..d37a69845 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderDispatcher.h @@ -1,7 +1,7 @@ #pragma once #include "EntityRenderer.h" #include "Minecraft.World/net/minecraft/world/entity/Entity.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class font; class EntityRenderDispatcher { diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp index 98ff2c9b1..034c47eac 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ExperienceOrbRenderer.cpp @@ -6,7 +6,7 @@ #include "../Tesselator.h" #include "EntityRenderDispatcher.h" #include "Minecraft.World/net/minecraft/util/Mth.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" ResourceLocation ExperienceOrbRenderer::XP_ORB_LOCATION = ResourceLocation(TN_ITEM_EXPERIENCE_ORB); @@ -47,9 +47,9 @@ void ExperienceOrbRenderer::render(std::shared_ptr _orb, double x, } float br = 255.0f; float rr = (orb->tickCount + a) / 2; - int rc = (int)((Mth::sin(rr + 0 * PI * 2 / 3) + 1) * 0.5f * br); + int rc = (int)((Mth::sin(rr + 0 * M_PI * 2 / 3) + 1) * 0.5f * br); int gc = (int)(br); - int bc = (int)((Mth::sin(rr + 2 * PI * 2 / 3) + 1) * 0.1f * br); + int bc = (int)((Mth::sin(rr + 2 * M_PI * 2 / 3) + 1) * 0.1f * br); int col = rc << 16 | gc << 8 | bc; glRotatef(180 - entityRenderDispatcher->playerRotY, 0, 1, 0); glRotatef(-entityRenderDispatcher->playerRotX, 1, 0, 0); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp index 598fbfb9f..166d10e14 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FishingHookRenderer.cpp @@ -56,15 +56,15 @@ void FishingHookRenderer::render(std::shared_ptr _hook, double x, if (hook->owner != nullptr) { float swing = hook->owner->getAttackAnim(a); - float swing2 = (float)Mth::sin(sqrt(swing) * PI); + float swing2 = (float)Mth::sin(sqrt(swing) * M_PI); Vec3 vv(-0.5, 0.03, 0.8); vv.xRot(-(hook->owner->xRotO + (hook->owner->xRot - hook->owner->xRotO) * a) * - PI / 180); + M_PI / 180); vv.yRot(-(hook->owner->yRotO + (hook->owner->yRot - hook->owner->yRotO) * a) * - PI / 180); + M_PI / 180); vv.yRot(swing2 * 0.5f); vv.xRot(-swing2 * 0.7f); @@ -85,7 +85,7 @@ void FishingHookRenderer::render(std::shared_ptr _hook, double x, float rr = (float)(hook->owner->yBodyRotO + (hook->owner->yBodyRot - hook->owner->yBodyRotO) * a) * - PI / 180; + M_PI / 180; double ss = Mth::sin((float)rr); double cc = Mth::cos((float)rr); xp = hook->owner->xo + (hook->owner->x - hook->owner->xo) * a - diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp index 47109375a..681d634bc 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemFrameRenderer.cpp @@ -6,7 +6,7 @@ #include "ItemFrameRenderer.h" #include "../texture/TextureAtlas.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" #include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp index bc52593f6..867bf4be1 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp @@ -2,7 +2,7 @@ #include "ItemRenderer.h" #include "../TileRenderer.h" #include "EntityRenderDispatcher.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/entity/item/net.minecraft.world.entity.item.h" #include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "Minecraft.World/net/minecraft/world/item/alchemy/net.minecraft.world.item.alchemy.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp index 8793b2edb..831710ba5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp @@ -319,8 +319,8 @@ void LivingEntityRenderer::renderArrows(std::shared_ptr mob, zd *= -1; } float sd = (float)sqrt(xd * xd + zd * zd); - arrow->yRotO = arrow->yRot = (float)(atan2(xd, zd) * 180 / PI); - arrow->xRotO = arrow->xRot = (float)(atan2(yd, sd) * 180 / PI); + arrow->yRotO = arrow->yRot = (float)(atan2(xd, zd) * 180 / M_PI); + arrow->xRotO = arrow->xRot = (float)(atan2(yd, sd) * 180 / M_PI); double x = 0; double y = 0; double z = 0; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp index 637afce3f..88a274b29 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MinecartRenderer.cpp @@ -60,7 +60,7 @@ void MinecartRenderer::render(std::shared_ptr _cart, double x, double y, if (dir.length() == 0) { } else { dir = dir.normalize(); - rot = (float)(atan2(dir.z, dir.x) * 180 / PI); + rot = (float)(atan2(dir.z, dir.x) * 180 / M_PI); xRot = (float)(atan(dir.y) * 73); } } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp index 30c7e1ecf..42e75ac04 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/MobRenderer.cpp @@ -59,7 +59,7 @@ void MobRenderer::renderLeash(std::shared_ptr entity, double x, double y, double entityYRot = lerp(entity->yBodyRotO, entity->yBodyRot, a) * Mth::RAD_TO_GRAD + - PI * .5; + M_PI * .5; rotOffCos = cos(entityYRot) * entity->bbWidth * .4; rotOffSin = sin(entityYRot) * entity->bbWidth * .4; double startX = lerp(entity->xo, entity->x, a) + rotOffCos; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp index cc3c887bb..3445354f8 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PaintingRenderer.cpp @@ -3,7 +3,7 @@ #include "EntityRenderDispatcher.h" #include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/util/Mth.h" ResourceLocation PaintingRenderer::PAINTING_LOCATION(TN_ART_KZ); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp index eabedc0c3..669fec242 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PlayerRenderer.cpp @@ -21,7 +21,7 @@ const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] = 0xff33cc33, // GREEN 0xffcc3333, // RED 0xff3333cc, // BLUE - 0xffcc33cc, // PINK + 0xffcc33cc, // M_PINK 0xffcc6633, // ORANGE 0xffcccc33, // YELLOW 0xff33dccc, // TURQUOISE @@ -318,8 +318,8 @@ bool b2 = !mob->isCapeHidden();*/ float yr = mob->yBodyRotO + (mob->yBodyRot - mob->yBodyRotO) * a; - double xa = Mth::sin(yr * PI / 180); - double za = -Mth::cos(yr * PI / 180); + double xa = Mth::sin(yr * M_PI / 180); + double za = -Mth::cos(yr * M_PI / 180); float flap = (float)yd * 10; if (flap < -6) flap = -6; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp index 22d3950a5..9a46afa63 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/VillagerGolemRenderer.cpp @@ -55,7 +55,7 @@ void VillagerGolemRenderer::additionalRendering( glPushMatrix(); // dont ask me how I got the flower into his hand. - glRotatef(5 + 180 * golemModel->arm0->xRot / PI, 1, 0, 0); + glRotatef(5 + 180 * golemModel->arm0->xRot / M_PI, 1, 0, 0); glTranslatef(-11 / 16.0f, 20 / 16.0f, -15 / 16.0f); glRotatef(90, 1, 0, 0); float s = 0.8f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp index 3d4312441..afa412c93 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ZombieRenderer.cpp @@ -99,7 +99,7 @@ void ZombieRenderer::setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a) { std::shared_ptr mob = std::dynamic_pointer_cast(_mob); if (mob->isConverting()) { - bodyRot += (float)(cos(mob->tickCount * 3.25) * PI * .25f); + bodyRot += (float)(cos(mob->tickCount * 3.25) * M_PI * .25f); } HumanoidMobRenderer::setupRotations(mob, bob, bodyRot, a); } \ No newline at end of file diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp index 85d50dd62..65101d182 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp @@ -2,7 +2,7 @@ #include "Minecraft.World/net/minecraft/world/net.minecraft.world.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/ByteBuffer.h" #include "../../Minecraft.h" #include "../LevelRenderer.h" #include "../entity/EntityRenderDispatcher.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp index 7a777707a..18533fb70 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp @@ -1,5 +1,5 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/ByteBuffer.h" +#include "java/ByteBuffer.h" #include "../Rect2i.h" #include "TextureManager.h" #include "Texture.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp index 1d8f22f4b..f892ef1cc 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/ClockTexture.cpp @@ -3,7 +3,7 @@ #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" #include "../../../multiplayer/MultiPlayerLocalPlayer.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../Texture.h" #include "ClockTexture.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp index f3d93df93..c33edc0ad 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/custom/CompassTexture.cpp @@ -3,7 +3,7 @@ #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/dimension/net.minecraft.world.level.dimension.h" #include "../../../multiplayer/MultiPlayerLocalPlayer.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../Texture.h" #include "CompassTexture.h" @@ -51,9 +51,9 @@ void CompassTexture::updateFromPosition(Level* level, double x, double z, double za = spawnPos->z - z; delete spawnPos; yRot = (int)yRot % 360; - rott = -((yRot - 90) * PI / 180 - atan2(za, xa)); + rott = -((yRot - 90) * M_PI / 180 - atan2(za, xa)); if (!level->dimension->isNaturalDimension()) { - rott = Math::random() * PI * 2; + rott = Math::random() * M_PI * 2; } } @@ -61,8 +61,8 @@ void CompassTexture::updateFromPosition(Level* level, double x, double z, rot = rott; } else { double rotd = rott - rot; - while (rotd < -PI) rotd += PI * 2; - while (rotd >= PI) rotd -= PI * 2; + while (rotd < -M_PI ) rotd += M_PI * 2; + while (rotd >= M_PI) rotd -= M_PI * 2; if (rotd < -1) rotd = -1; if (rotd > 1) rotd = 1; rota += rotd * 0.1; @@ -73,7 +73,7 @@ void CompassTexture::updateFromPosition(Level* level, double x, double z, // 4J Stu - We share data with another texture if (m_dataTexture != nullptr) { int newFrame = - (int)(((rot / (PI * 2)) + 1.0) * m_dataTexture->frames->size()) % + (int)(((rot / (M_PI * 2)) + 1.0) * m_dataTexture->frames->size()) % m_dataTexture->frames->size(); while (newFrame < 0) { newFrame = (newFrame + m_dataTexture->frames->size()) % @@ -87,7 +87,7 @@ void CompassTexture::updateFromPosition(Level* level, double x, double z, } } else { int newFrame = - (int)(((rot / (PI * 2)) + 1.0) * frames->size()) % frames->size(); + (int)(((rot / (M_PI * 2)) + 1.0) * frames->size()) % frames->size(); while (newFrame < 0) { newFrame = (newFrame + frames->size()) % frames->size(); } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp index 72c8feca5..fecabf317 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/BeaconRenderer.cpp @@ -44,15 +44,15 @@ void BeaconRenderer::render(std::shared_ptr _beacon, double x, double rr1 = r * 0.2; - double wnx = .5 + cos(rot + PI * .75) * rr1; - double wnz = .5 + sin(rot + PI * .75) * rr1; - double enx = .5 + cos(rot + PI * .25) * rr1; - double enz = .5 + sin(rot + PI * .25) * rr1; + double wnx = .5 + cos(rot + M_PI * .75) * rr1; + double wnz = .5 + sin(rot + M_PI * .75) * rr1; + double enx = .5 + cos(rot + M_PI * .25) * rr1; + double enz = .5 + sin(rot + M_PI * .25) * rr1; - double wsx = .5 + cos(rot + PI * 1.25) * rr1; - double wsz = .5 + sin(rot + PI * 1.25) * rr1; - double esx = .5 + cos(rot + PI * 1.75) * rr1; - double esz = .5 + sin(rot + PI * 1.75) * rr1; + double wsx = .5 + cos(rot + M_PI * 1.25) * rr1; + double wsz = .5 + sin(rot + M_PI * 1.25) * rr1; + double esx = .5 + cos(rot + M_PI * 1.75) * rr1; + double esz = .5 + sin(rot + M_PI * 1.75) * rr1; double top = 256 * scale; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp index 7301edea0..aecd7fa31 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/ChestRenderer.cpp @@ -128,7 +128,7 @@ void ChestRenderer::render(std::shared_ptr _chest, double x, open = 1 - open; open = 1 - open * open * open; - model->lid->xRot = -(open * PI / 2); + model->lid->xRot = -(open * M_PI / 2); model->render(useCompiled); glDisable(GL_RESCALE_NORMAL); glPopMatrix(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp index 1887e42bb..800b32e5d 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnchantTableRenderer.cpp @@ -25,12 +25,12 @@ void EnchantTableRenderer::render(std::shared_ptr _table, double x, glTranslatef(0, 0.1f + sin(tt * 0.1f) * 0.01f, 0); float orot = (table->rot - table->oRot); - while (orot >= PI) orot -= PI * 2; - while (orot < -PI) orot += PI * 2; + while (orot >= M_PI) orot -= M_PI * 2; + while (orot < -M_PI ) orot += M_PI * 2; float yRot = table->oRot + orot * a; - glRotatef(-yRot * 180 / PI, 0, 1, 0); + glRotatef(-yRot * 180 / M_PI, 0, 1, 0); glRotatef(80, 0, 0, 1); bindTexture(&BOOK_LOCATION); // 4J was "/item/book.png" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp index 7ce10b1f7..f4cf8d8b9 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/EnderChestRenderer.cpp @@ -42,7 +42,7 @@ void EnderChestRenderer::render(std::shared_ptr _chest, double x, open = 1 - open; open = 1 - open * open * open; - chestModel.lid->xRot = -(open * PI / 2); + chestModel.lid->xRot = -(open * M_PI / 2); chestModel.render(useCompiled); glDisable(GL_RESCALE_NORMAL); glPopMatrix(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp index e48637c45..249073ca4 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TheEndPortalRenderer.cpp @@ -1,10 +1,10 @@ #include "Minecraft.World/Header Files/stdafx.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "../Tesselator.h" #include "TileEntityRenderDispatcher.h" #include "../../Camera.h" -#include "Minecraft.World/ConsoleJavaLibs/FloatBuffer.h" +#include "java/FloatBuffer.h" #include "TheEndPortalRenderer.h" ResourceLocation TheEndPortalRenderer::END_SKY_LOCATION = diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h index e6411f848..3177a0243 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/tileentity/TileEntityRenderDispatcher.h @@ -1,6 +1,6 @@ #pragma once #include "../Textures.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class Mob; class Level; class TileEntityRenderer; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp b/minecraft/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp index 6e7020b63..8f8c35015 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/skins/AbstractTexturePack.cpp @@ -1,7 +1,7 @@ #include "Minecraft.World/Header Files/stdafx.h" #include "../renderer/Textures.h" #include "AbstractTexturePack.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include diff --git a/minecraft/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp b/minecraft/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp index 229cc4f29..de3c2ab25 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/skins/TexturePackRepository.cpp @@ -5,7 +5,7 @@ #include "FolderTexturePack.h" #include "DLCTexturePack.h" #include "../Options.h" -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #include "../gui/Minimap.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp b/minecraft/Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp index f726a5a0e..bb2c29631 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/title/TitleScreen.cpp @@ -7,10 +7,10 @@ #include "../renderer/Textures.h" #include "../Options.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" -#include "Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/System.h" +#include "java/Random.h" #include #include "TitleScreen.h" @@ -392,7 +392,7 @@ void TitleScreen::render(int xm, int ym, float a) { glRotatef(-20, 0, 0, 1); float sss = 1.8f - Mth::abs(Mth::sin(System::currentTimeMillis() % 1000 / - 1000.0f * PI * 2) * + 1000.0f * M_PI * 2) * 0.1f); sss = sss * 100 / (font->width(splash) + 8 * 4); diff --git a/minecraft/Minecraft.Client/net/minecraft/server/MinecraftServer.cpp b/minecraft/Minecraft.Client/net/minecraft/server/MinecraftServer.cpp index 402569ea4..85e935c8f 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/MinecraftServer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/MinecraftServer.cpp @@ -27,13 +27,13 @@ #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "Minecraft.World/net/minecraft/Pos.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" #include "Minecraft.World/ConsoleHelpers/StringHelpers.h" #if defined(SPLIT_SAVES) #include "Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.h" #endif #include "Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h" #include "../client/ProgressRenderer.h" #include "level/ServerPlayer.h" @@ -1129,7 +1129,7 @@ void MinecraftServer::run(int64_t seed, void* lpParameter) { } // int64_t afterall = // System::currentTimeMillis(); - // PIXReportCounter(L"Server time + // M_PIXReportCounter(L"Server time // all",(float)(afterall-beforeall)); // PIXReportCounter(L"Server // ticks",(float)tickcount); diff --git a/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp b/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp index 122198cb7..18c487281 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp @@ -24,7 +24,7 @@ #include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h" #include "Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" #include "Minecraft.World/net/minecraft/world/level/saveddata/net.minecraft.world.level.saveddata.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "Minecraft.World/net/minecraft/world/entity/EntityIO.h" // 4J - this class is fairly substantially altered as there didn't seem any // point in porting code for banning, whitelisting, ops etc. diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/EntityTracker.h b/minecraft/Minecraft.Client/net/minecraft/server/level/EntityTracker.h index 361cfc1f3..0e19fc1e7 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/EntityTracker.h +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/EntityTracker.h @@ -1,6 +1,6 @@ #pragma once #include "Minecraft.World/ConsoleHelpers/HashExtension.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class Entity; class ServerPlayer; class TrackedEntity; diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp b/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp index 9032b5fe8..041241def 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.cpp @@ -10,7 +10,7 @@ #include "Minecraft.World/net/minecraft/world/level/chunk/net.minecraft.world.level.chunk.h" #include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h" #include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h" -#include "Minecraft.World/ConsoleJavaLibs/System.h" +#include "java/System.h" #include "../PlayerList.h" PlayerChunkMap::PlayerChunk::PlayerChunk(int x, int z, PlayerChunkMap* pcm) diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h b/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h index f4d4105a5..c08c0235e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h @@ -1,5 +1,5 @@ #pragma once -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" #include "Minecraft.World/net/minecraft/world/level/ChunkPos.h" class ServerPlayer; class ServerLevel; diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h index 82ec6233a..fee7b3a6e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerChunkCache.h @@ -1,9 +1,9 @@ #pragma once #include #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" -#include "Minecraft.World/ConsoleJavaLibs/File.h" +#include "java/File.h" #include "Minecraft.World/net/minecraft/world/level/storage/net.minecraft.world.level.storage.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" #include "Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.h" #include "Minecraft.World/ConsoleHelpers/C4JThread.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.h b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.h index 6a5c5a381..69583e728 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.h +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.h @@ -1,7 +1,7 @@ #pragma once #include #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class ServerChunkCache; class MinecraftServer; class Node; diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp index 229526bc6..0b377b389 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerPlayer.cpp @@ -28,7 +28,7 @@ #include "Minecraft.World/net/minecraft/locale/net.minecraft.locale.h" #include "Minecraft.World/net/minecraft/Pos.h" -#include "Minecraft.World/ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.h" #include "../../client/renderer/LevelRenderer.h" @@ -52,7 +52,7 @@ ServerPlayer::ServerPlayer(MinecraftServer* server, Level* level, latency = 0; wonGame = false; m_enteredEndExitPortal = false; - // lastCarried = ItemInstanceArray(5); + // lastCarried = arrayWithLength>(5); lastActionTime = 0; viewDistance = server->getPlayers()->getViewDistance(); diff --git a/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp b/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp index 2cf9a4127..543b29dd9 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.cpp @@ -21,13 +21,13 @@ #include "Minecraft.World/net/minecraft/world/phys/AABB.h" #include "Minecraft.World/net/minecraft/Pos.h" #include "Minecraft.World/net/minecraft/SharedConstants.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "Minecraft.World/net/minecraft/stats/Achievements.h" #include "Minecraft.World/net/minecraft/net.minecraft.h" #include "../level/EntityTracker.h" #include "ServerConnection.h" #include "Minecraft.World/net/minecraft/stats/GenericStats.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" // 4J Added #include "Minecraft.World/net/minecraft/world/item/crafting/net.minecraft.world.item.crafting.h" diff --git a/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.h b/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.h index 468f7cb64..c1f6b1dd8 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.h +++ b/minecraft/Minecraft.Client/net/minecraft/server/network/PlayerConnection.h @@ -2,7 +2,7 @@ #include #include "../ConsoleInputSource.h" #include "Minecraft.World/net/minecraft/network/packet/PacketListener.h" -#include "Minecraft.World/ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class MinecraftServer; class Connection; diff --git a/minecraft/Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp b/minecraft/Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp index c1d494cc0..0849efc2a 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/network/ServerConnection.cpp @@ -5,7 +5,7 @@ #include "PlayerConnection.h" #include "../level/ServerPlayer.h" #include "Minecraft.World/net/minecraft/network/net.minecraft.network.h" -#include "Minecraft.World/ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h" #include "../../client/multiplayer/MultiPlayerLevel.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ArrayWithLength.h b/minecraft/Minecraft.World/ConsoleHelpers/ArrayWithLength.h index 50eccb4f2..b3e0c4b0c 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ArrayWithLength.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/ArrayWithLength.h @@ -1,6 +1,8 @@ #pragma once -#include +#include +#include +#include // Note - this is meant to be a really simple wrapper round a pointer just to be // able to add a length value to arrays. @@ -126,5 +128,3 @@ typedef arrayWithLength ModelPartArray; typedef arrayWithLength EnchantmentArray; typedef arrayWithLength ClipChunkArray; -#include "../net/minecraft/world/item/ItemInstance.h" -typedef arrayWithLength > ItemInstanceArray; diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h index 5e8ea06d0..179d76bba 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileConverter.h @@ -1,5 +1,5 @@ #pragma once -#include "../../ConsoleJavaLibs/File.h" +#include "java/File.h" class FileEntry; class ConsoleSaveFile; class ProgressRenderer; diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp index 1b7f0c1d5..002c6c8bb 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.cpp @@ -1,6 +1,6 @@ #include "../../Header Files/stdafx.h" -#include "../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "ConsoleSaveFile.h" #include "ConsoleSaveFileInputStream.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h index ad6cf5d09..7790a4d58 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileInputStream.h @@ -2,7 +2,7 @@ // 4J Stu - Implements the Java InputStream but rather than writing directly to // disc it writes through the save file -#include "../../ConsoleJavaLibs/InputOutputStream/InputStream.h" +#include "java/InputOutputStream/InputStream.h" #include "ConsoleSavePath.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp index 3dc2dd7af..87dd81504 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp @@ -5,7 +5,7 @@ #include "../StringHelpers.h" #include "../../Header Files/PortableFileIO.h" #include "ConsoleSaveFileOriginal.h" -#include "../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include #include #include "../../Header Files/compression.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp index 5a3dd08a2..27b02a4d7 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.cpp @@ -1,5 +1,5 @@ #include "../../Header Files/stdafx.h" -#include "../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "ConsoleSaveFileOutputStream.h" #include "ConsoleSaveFile.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h index 790a3f88d..6d0a40155 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h @@ -2,7 +2,7 @@ // 4J Stu - Implements the Java InputStream but rather than writing directly to // disc it writes through the save file -#include "../../ConsoleJavaLibs/InputOutputStream/OutputStream.h" +#include "java/InputOutputStream/OutputStream.h" #include "ConsoleSavePath.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp index 43bf36232..dae092929 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp @@ -6,7 +6,7 @@ #include "../../Header Files/PortableFileIO.h" #include "ConsoleSaveFileSplit.h" #include "ConsoleSaveFileConverter.h" -#include "../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "../../Header Files/compression.h" #include "Minecraft.Client/net/minecraft/client/Minecraft.h" #include "Minecraft.Client/net/minecraft/server/MinecraftServer.h" diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h index 981b063bf..092f1e2aa 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h @@ -1,6 +1,6 @@ #pragma once -#include "../../ConsoleJavaLibs/System.h" +#include "java/System.h" // The first 4 bytes is the location of the header (the header itself is at the // end of the file) Then 4 bytes for the size of the header Then 2 bytes for the diff --git a/minecraft/Minecraft.World/ConsoleHelpers/Definitions.h b/minecraft/Minecraft.World/ConsoleHelpers/Definitions.h index c21df2527..8069dc16f 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/Definitions.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/Definitions.h @@ -1,16 +1,6 @@ #pragma once -class AABB; -class Recipy; -class Object; - -typedef std::vector AABBList; -typedef std::vector RecipyList; -typedef std::vector ObjectList; - #define MAX_PATH_SIZE 256 -#define PI (3.141592654f) -#define HALF_PI (1.570796327f) enum ByteOrder { BIGENDIAN, diff --git a/minecraft/Minecraft.World/Header Files/PathHelper.h b/minecraft/Minecraft.World/ConsoleHelpers/PathHelper.h similarity index 100% rename from minecraft/Minecraft.World/Header Files/PathHelper.h rename to minecraft/Minecraft.World/ConsoleHelpers/PathHelper.h diff --git a/minecraft/Minecraft.World/ConsoleHelpers/StringHelpers.h b/minecraft/Minecraft.World/ConsoleHelpers/StringHelpers.h index 871e46d87..b13a10af5 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/StringHelpers.h +++ b/minecraft/Minecraft.World/ConsoleHelpers/StringHelpers.h @@ -1,5 +1,7 @@ #pragma once -// using namespace stdtd; + +#include +#include std::wstring toLower(const std::wstring& a); std::wstring trimString(const std::wstring& a); diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/SocketAddress.h b/minecraft/Minecraft.World/ConsoleJavaLibs/SocketAddress.h deleted file mode 100644 index d912020eb..000000000 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/SocketAddress.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -class SocketAddress {}; \ No newline at end of file diff --git a/minecraft/Minecraft.World/Header Files/stdafx.h b/minecraft/Minecraft.World/Header Files/stdafx.h index 619e6d3dd..d16ad958b 100644 --- a/minecraft/Minecraft.World/Header Files/stdafx.h +++ b/minecraft/Minecraft.World/Header Files/stdafx.h @@ -44,12 +44,12 @@ #include #include "../ConsoleHelpers/Definitions.h" -#include "../ConsoleJavaLibs/Class.h" -#include "../ConsoleJavaLibs/Exceptions.h" +#include "java/Class.h" +#include "java/Exceptions.h" #include "../net/minecraft/util/Mth.h" #include "../ConsoleHelpers/StringHelpers.h" #include "../ConsoleHelpers/ArrayWithLength.h" -#include "../ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "../net/minecraft/world/level/TilePos.h" #include "../net/minecraft/world/level/ChunkPos.h" #include "../Header Files/compression.h" diff --git a/minecraft/Minecraft.World/meson.build b/minecraft/Minecraft.World/meson.build index b9fa8ebab..804a1fd12 100644 --- a/minecraft/Minecraft.World/meson.build +++ b/minecraft/Minecraft.World/meson.build @@ -33,6 +33,8 @@ simdutf_dep = dependency('simdutf', lib_world = static_library('Minecraft.World', world_sources, dependencies : [ + nbt_dep, + java_dep, assets_localisation_dep, render_dep, input_dep, diff --git a/minecraft/Minecraft.World/net/minecraft/SharedConstants.cpp b/minecraft/Minecraft.World/net/minecraft/SharedConstants.cpp index 73f3afdbb..c75af697d 100644 --- a/minecraft/Minecraft.World/net/minecraft/SharedConstants.cpp +++ b/minecraft/Minecraft.World/net/minecraft/SharedConstants.cpp @@ -1,6 +1,6 @@ #include "../../Header Files/stdafx.h" -#include "../../ConsoleJavaLibs/File.h" -#include "../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/File.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "SharedConstants.h" const std::wstring SharedConstants::VERSION_STRING = L"1.6.4"; diff --git a/minecraft/Minecraft.World/net/minecraft/SharedConstants.h b/minecraft/Minecraft.World/net/minecraft/SharedConstants.h index 45466b8e6..a908b1a43 100644 --- a/minecraft/Minecraft.World/net/minecraft/SharedConstants.h +++ b/minecraft/Minecraft.World/net/minecraft/SharedConstants.h @@ -1,6 +1,6 @@ #pragma once -#include "../../ConsoleJavaLibs/Class.h" +#include "java/Class.h" class SharedConstants { public: diff --git a/minecraft/Minecraft.World/net/minecraft/locale/Language.cpp b/minecraft/Minecraft.World/net/minecraft/locale/Language.cpp index 01ab5e0ca..bfdb7b81e 100644 --- a/minecraft/Minecraft.World/net/minecraft/locale/Language.cpp +++ b/minecraft/Minecraft.World/net/minecraft/locale/Language.cpp @@ -1,7 +1,7 @@ #include "../../../Header Files/stdafx.h" #include "Language.h" -#include "../../../ConsoleJavaLibs/File.h" -#include "../../../ConsoleJavaLibs/InputOutputStream/FileInputStream.h" +#include "java/File.h" +#include "java/InputOutputStream/FileInputStream.h" // 4J - TODO - properly implement // 4jcraft: done! diff --git a/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp b/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp index 38a52b660..ed16efdd1 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp @@ -2,8 +2,8 @@ #include #include "../../../Header Files/stdafx.h" -#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" -#include "../../../ConsoleJavaLibs/Socket.h" +#include "java/InputOutputStream/InputOutputStream.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" #include "Connection.h" #include "../../../ConsoleHelpers/ThreadName.h" #include "../../../Header Files/compression.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/Connection.h b/minecraft/Minecraft.World/net/minecraft/network/Connection.h index c9e3ba5b3..b058e5268 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/Connection.h +++ b/minecraft/Minecraft.World/net/minecraft/network/Connection.h @@ -2,15 +2,15 @@ #include "../../../Header Files/stdafx.h" #include -#include "../../../ConsoleJavaLibs/System.h" -#include "../../../ConsoleJavaLibs/InputOutputStream/DataInputStream.h" -#include "../../../ConsoleJavaLibs/InputOutputStream/DataOutputStream.h" +#include "java/System.h" +#include "java/InputOutputStream/DataInputStream.h" +#include "java/InputOutputStream/DataOutputStream.h" #include "packet/net.minecraft.network.packet.h" #include "../../../ConsoleHelpers/C4JThread.h" #include -#include "../../../ConsoleJavaLibs/Socket.h" +#include "Minecraft.Client/Common/Source Files/Network/Socket.h" // 4J JEV, size of the threads (bytes). #define READ_STACK_SIZE 0 diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp index 703f5cb93..a3be0ac5b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddEntityPacket.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" #include #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AddEntityPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp index b15353cca..60e2b762b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddExperienceOrbPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include "../../world/entity/net.minecraft.world.entity.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "AddExperienceOrbPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp index 00f8b4812..680715f55 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddGlobalEntityPacket.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" #include #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "../../world/entity/global/net.minecraft.world.entity.global.h" #include "PacketListener.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp index 7a9d2c7a4..f75dcb52e 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AddMobPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp index e4adc4591..3740b4eee 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddPaintingPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AddPaintingPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp index adfc49029..b35dafa55 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/player/net.minecraft.world.entity.player.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp index a211f7611..1d71486b8 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AnimatePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "AnimatePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp index 1a610bd01..e73aa9b47 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AwardStatPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "AwardStatPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp index 2d05a04c1..20502df18 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" #include #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/level/net.minecraft.world.level.h" #include "../../../../Header Files/compression.h" #include "PacketListener.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp index 505c80c2c..be66182fd 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkTilesUpdatePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/level/net.minecraft.world.level.h" #include "../../world/level/chunk/net.minecraft.world.level.chunk.h" #include "PacketListener.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp index 6589b9ef3..827018c75 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityAreaPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/level/net.minecraft.world.level.h" #include "PacketListener.h" #include "ChunkVisibilityAreaPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp index 463ab86a0..527be7808 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ChunkVisibilityPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ChunkVisibilityPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp index 926b7ffa4..72800cff4 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ComplexItemDataPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ComplexItemDataPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp index fc7eeff59..688d6fad4 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerAckPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerAckPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp index c8fed699b..faf2ad6d4 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerButtonClickPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "ContainerButtonClickPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp index 3e96482d5..aec7e920e 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClickPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ContainerClickPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp index e72bcb8c2..ea05ed185 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerClosePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerClosePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp index d1acd3f1d..e05cd9857 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerOpenPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerOpenPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp index 73e28d6a1..294cd599c 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ContainerSetContentPacket.h" @@ -12,7 +12,7 @@ ContainerSetContentPacket::ContainerSetContentPacket() { containerId = 0; } ContainerSetContentPacket::ContainerSetContentPacket( int containerId, std::vector >* newItems) { this->containerId = containerId; - items = ItemInstanceArray((int)newItems->size()); + items = arrayWithLength>((int)newItems->size()); for (unsigned int i = 0; i < items.length; i++) { std::shared_ptr item = newItems->at(i); items[i] = item == nullptr ? nullptr : item->copy(); @@ -24,7 +24,7 @@ void ContainerSetContentPacket::read( { containerId = (int)dis->readByte(); int count = dis->readShort(); - items = ItemInstanceArray(count); + items = arrayWithLength>(count); for (int i = 0; i < count; i++) { items[i] = readItem(dis); } diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.h b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.h index 4877f779b..4ab0cb258 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.h +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetContentPacket.h @@ -7,7 +7,7 @@ class ContainerSetContentPacket public std::enable_shared_from_this { public: int containerId; - ItemInstanceArray items; + arrayWithLength> items; ContainerSetContentPacket(); ~ContainerSetContentPacket(); diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp index 9b59a5869..f34bd5ffb 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetDataPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "ContainerSetDataPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp index aec79be3a..6d6c2c422 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ContainerSetSlotPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ContainerSetSlotPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp index a691a3899..d991f7ec2 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/CraftItemPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "CraftItemPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp index ff229363e..2ed958ceb 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/CustomPayloadPacket.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "CustomPayloadPacket.h" #include diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp index efecbb485..cd336879c 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/DebugOptionsPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "DebugOptionsPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp index f864f8599..c307e8629 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/DisconnectPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../SharedConstants.h" #include "PacketListener.h" #include "DisconnectPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp index 63d455c95..04d0d0369 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/EntityActionAtPositionPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "EntityActionAtPositionPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp index 3cae4a5db..5d4bee486 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/EntityEventPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "EntityEventPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp index b355b2efd..f56a6f4d1 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ExplodePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/level/net.minecraft.world.level.h" #include "PacketListener.h" #include "ExplodePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp index 04a7ce3ab..e3e428ec2 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/GameCommandPacket.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "GameCommandPacket.h" #include diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp index d12a6ddb7..86819bb21 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/GameEventPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "GameEventPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp index 858c8e40c..8dc8cfcb8 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/GetInfoPacket.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "GetInfoPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp index 6a67ea236..2e3fc8a7a 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/InteractPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "InteractPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp index 171c418ad..c18e2b13b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/KeepAlivePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "KeepAlivePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp index 95e28691c..d588f62a9 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/KickPlayerPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "KickPlayerPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp index ffe45cdb0..a0cec82f8 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/LevelEventPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "LevelEventPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp index 2da855fc8..2f178170e 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/LevelSoundPacket.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "net.minecraft.network.packet.h" #include "LevelSoundPacket.h" #include @@ -26,7 +26,7 @@ LevelSoundPacket::LevelSoundPacket(int sound, double x, double y, double z, this->volume = volume; // 4J-PB - Let's make the pitch a float so it doesn't get mangled and make // the noteblock people unhappy - // this->pitch = (int) (pitch * PITCH_ACCURACY); + // this->pitch = (int) (pitch * M_PITCH_ACCURACY); this->pitch = pitch; // if (this->pitch < 0) this->pitch = 0; @@ -64,7 +64,7 @@ double LevelSoundPacket::getZ() { return z / LOCATION_ACCURACY; } float LevelSoundPacket::getVolume() { return volume; } float LevelSoundPacket::getPitch() { - // return pitch / PITCH_ACCURACY; + // return pitch / M_PITCH_ACCURACY; return pitch; } diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp index f13f6f94e..9f5946746 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/LoginPacket.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" #include #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/player/net.minecraft.world.entity.player.h" #include "PacketListener.h" #include "LoginPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp index fed630029..b67a0e526 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "MoveEntityPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp index dabf86ead..f821228fd 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/MoveEntityPacketSmall.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "MoveEntityPacketSmall.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp index 63e6dd5c7..ca334ac82 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/MovePlayerPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "MovePlayerPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.cpp index ea1f623b6..8d8b14131 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.cpp @@ -1,10 +1,10 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/System.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/System.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "net.minecraft.network.packet.h" #include "PacketListener.h" #include "Packet.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #if !defined(_CONTENT_PACKAGE) #include "Minecraft.Client/net/minecraft/client/Minecraft.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.h b/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.h index c52fbf239..f84357d98 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.h +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/Packet.h @@ -1,5 +1,7 @@ #pragma once +#include "nbt/CompoundTag.h" + class Packet; class PacketListener; class DataInputStream; @@ -8,6 +10,7 @@ class DataOutputStream; #define PACKET_ENABLE_STAT_TRACKING 0 class Packet; +class ItemInstance; typedef std::shared_ptr (*packetCreateFn)(); diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp index 306001e5e..aeaceb111 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerActionPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "PlayerActionPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp index 9aa28856f..6a8c68c06 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerCommandPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PlayerCommandPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp index d0071834b..f6879c823 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInfoPacket.cpp @@ -6,7 +6,7 @@ #include #endif // __linux__ #include "PacketListener.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PlayerInfoPacket.h" PlayerInfoPacket::PlayerInfoPacket() { diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp index 0a90ddef2..4a57d1124 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/PlayerInputPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "PlayerInputPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp index 8dbb25985..26af42fb4 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/PreLoginPacket.cpp @@ -4,7 +4,7 @@ #include #include "PacketListener.h" #include "PreLoginPacket.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" PreLoginPacket::PreLoginPacket() { loginKey = L""; diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp index 7d4cbecca..73277fdb6 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveEntitiesPacket.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" #include #include "../../../../ConsoleHelpers/ArrayWithLength.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "RemoveEntitiesPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp index 34071dd2e..959e859f2 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/RemoveMobEffectPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include "../../world/effect/net.minecraft.world.effect.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "RemoveMobEffectPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp index 38e2b9afb..f97366b8c 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/RespawnPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "RespawnPacket.h" #include "../../world/level/LevelType.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h b/minecraft/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h index 828aa5bd9..822bfd14f 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/RotateHeadPacket.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "Packet.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp index f1c6a890d..8066ccd0d 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/ServerSettingsChangedPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "ServerSettingsChangedPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp index 233b8208a..c32f59805 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetCarriedItemPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetCarriedItemPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp index 0cda8e9f9..0b2771c58 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetCreativeModeSlotPacket.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetCreativeModeSlotPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp index 4f5985f8c..a80f44446 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityDataPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "SetEntityDataPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp index 52977acf9..27b639756 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityLinkPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "SetEntityLinkPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp index a949e5d9d..225a522b3 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEntityMotionPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "SetEntityMotionPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp index a24b36bac..0a145b890 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetEquippedItemPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "SetEquippedItemPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp index 1843b8658..d505b984b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetExperiencePacket.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" #include "SetExperiencePacket.h" #include "PacketListener.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" SetExperiencePacket::SetExperiencePacket() { this->experienceProgress = 0; diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp index 78bdb2d44..66bdde26c 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetHealthPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetHealthPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp index 6563d3745..c6ac1470e 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetSpawnPositionPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetSpawnPositionPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp index 395acd088..741f7b5b4 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SetTimePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "SetTimePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp index 6a68dfa04..2f7748cbc 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/SignUpdatePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "../../world/level/tile/entity/net.minecraft.world.level.tile.entity.h" #include "SignUpdatePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp index a2c54eb8f..a6f1487f4 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TakeItemEntityPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TakeItemEntityPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp index ea675d9c2..6e1bdc75f 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TeleportEntityPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "TeleportEntityPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp index 237c6a1f2..d89d027ce 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryChangePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "TextureAndGeometryChangePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp index eb99fe5fa..a625f9e81 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TextureAndGeometryPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TextureAndGeometryPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp index 1c3fb9b0f..e911b4433 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TextureChangePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/entity/net.minecraft.world.entity.h" #include "PacketListener.h" #include "TextureChangePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp index 9e348f413..b21420b9b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TexturePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TexturePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp index c24a6db91..f9d0f5e82 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TileEntityDataPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TileEntityDataPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp index 8a2b0be1c..3c50f02d9 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TileEventPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TileEventPacket.h" #include "../../world/level/tile/net.minecraft.world.level.tile.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp index 77be8b070..6533fa635 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TileUpdatePacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/level/net.minecraft.world.level.h" #include "PacketListener.h" #include "TileUpdatePacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp index 942a77be6..f1df45484 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/TradeItemPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "TradeItemPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp index 01c228120..59d8018d1 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateGameRuleProgressPacket.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "UpdateGameRuleProgressPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp index 8a943642d..9206f4185 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateMobEffectPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include "../../world/effect/net.minecraft.world.effect.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "../../world/level/levelgen/feature/BasicTreeFeature.h" #include "UpdateMobEffectPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp index 2cedb9e8f..23c68e918 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/UpdateProgressPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "PacketListener.h" #include "UpdateProgressPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp index d50e2f2dd..42c158369 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/UseItemPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "UseItemPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/XZPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/XZPacket.cpp index 126ebddfe..86eb35174 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/XZPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/XZPacket.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" #include -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../world/item/net.minecraft.world.item.h" #include "PacketListener.h" #include "XZPacket.h" diff --git a/minecraft/Minecraft.World/net/minecraft/util/Mth.cpp b/minecraft/Minecraft.World/net/minecraft/util/Mth.cpp index 735678197..6c119fbb5 100644 --- a/minecraft/Minecraft.World/net/minecraft/util/Mth.cpp +++ b/minecraft/Minecraft.World/net/minecraft/util/Mth.cpp @@ -1,26 +1,26 @@ #include "../../../Header Files/stdafx.h" #include "Mth.h" -#include "../../../ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "../../../ConsoleHelpers/StringHelpers.h" const int Mth::BIG_ENOUGH_INT = 1024; const float Mth::BIG_ENOUGH_FLOAT = BIG_ENOUGH_INT; -const float Mth::DEGRAD = PI / 180.0f; -const float Mth::RADDEG = 180.0f / PI; -const float Mth::RAD_TO_GRAD = PI / 180.0f; +const float Mth::DEGRAD = M_PI / 180.0f; +const float Mth::RADDEG = 180.0f / M_PI; +const float Mth::RAD_TO_GRAD = M_PI / 180.0f; float* Mth::_sin = nullptr; // 4jcraft for clarity constexpr size_t SIN_TAB_CNT = 65536; -const float Mth::sinScale = 65536.0f / (float)(PI * 2); +const float Mth::sinScale = 65536.0f / (float)(M_PI * 2); // 4J - added - was in static constructor void Mth::init() { _sin = new float[SIN_TAB_CNT]; for (int i = 0; i < SIN_TAB_CNT; i++) { - _sin[i] = (float)::sin(i * PI * 2 / (float)SIN_TAB_CNT); + _sin[i] = (float)::sin(i * M_PI * 2 / (float)SIN_TAB_CNT); } } @@ -38,7 +38,7 @@ float Mth::sin(float i) { float Mth::cos(float i) { if (_sin == nullptr) init(); // 4J - added // 4jcraft same thing as ::sin but shift by SIN_TAB_CNT / 4 - // which is aquivalent to shift by pi / 2 + // which is aquivalent to shift by M_PI / 2 // and again the same modulo logic to cramp and map it onto the computed // table diff --git a/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.cpp b/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.cpp index 2e3e9fe59..28a681b33 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.cpp @@ -11,7 +11,7 @@ SimpleContainer::SimpleContainer(int name, std::wstring stringName, this->stringName = stringName; this->customName = customName; this->size = size; - items = new ItemInstanceArray(size); + items = new arrayWithLength>(size); listeners = nullptr; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.h b/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.h index fcd91d44c..e82f56537 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.h +++ b/minecraft/Minecraft.World/net/minecraft/world/SimpleContainer.h @@ -8,7 +8,7 @@ private: int name; std::wstring stringName; int size; - ItemInstanceArray* items; + arrayWithLength>* items; std::vector* listeners; bool customName; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.cpp index acd78e677..c25ac1c7a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../item/net.minecraft.world.item.h" #include "../item/enchantment/net.minecraft.world.item.enchantment.h" #include "../level/net.minecraft.world.level.h" @@ -618,7 +618,7 @@ void Entity::outOfWorld() { remove(); } bool Entity::isFree(float xa, float ya, float za, float grow) { AABB box = bb.grow(grow, grow, grow).move(xa, ya, za); - AABBList* aABBs = level->getCubes(shared_from_this(), &box); + std::vector* aABBs = level->getCubes(shared_from_this(), &box); if (!aABBs->empty()) return false; if (level->containsAnyLiquid(&box)) return false; return true; @@ -626,7 +626,7 @@ bool Entity::isFree(float xa, float ya, float za, float grow) { bool Entity::isFree(double xa, double ya, double za) { AABB box = bb.move(xa, ya, za); - AABBList* aABBs = level->getCubes(shared_from_this(), &box); + std::vector* aABBs = level->getCubes(shared_from_this(), &box); if (!aABBs->empty()) return false; if (level->containsAnyLiquid(&box)) return false; return true; @@ -717,7 +717,7 @@ void Entity::move(double xa, double ya, double za, } AABB expanded = bb.expand(xa, ya, za); - AABBList* aABBs = + std::vector* aABBs = level->getCubes(shared_from_this(), &expanded, noEntityCubes, true); // LAND FIRST, then x and z @@ -1066,8 +1066,8 @@ void Entity::moveRelative(float xa, float za, float speed) { xa *= dist; za *= dist; - float sinVar = Mth::sin(yRot * PI / 180); - float cosVar = Mth::cos(yRot * PI / 180); + float sinVar = Mth::sin(yRot * M_PI / 180); + float cosVar = Mth::cos(yRot * M_PI / 180); xd += xa * cosVar - za * sinVar; zd += za * cosVar + xa * sinVar; @@ -1521,7 +1521,7 @@ void Entity::lerpTo(double x, double y, double z, float yRot, float xRot, // intersect the geometry they land in slightly. if (GetType() != eTYPE_ARROW) { AABB shrunk = bb.shrink(1 / 32.0, 0.0, 1 / 32.0); - AABBList* collisions = level->getCubes(shared_from_this(), &shrunk); + std::vector* collisions = level->getCubes(shared_from_this(), &shrunk); if (!collisions->empty()) { double yTop = 0; auto itEnd = collisions->end(); @@ -1569,9 +1569,9 @@ void Entity::handleEntityEvent(uint8_t eventId) {} void Entity::animateHurt() {} -ItemInstanceArray Entity::getEquipmentSlots() // ItemInstance[] +arrayWithLength> Entity::getEquipmentSlots() // ItemInstance[] { - return ItemInstanceArray(); // Default ctor creates nullptr internal array + return arrayWithLength>(); // Default ctor creates nullptr internal array } // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.h b/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.h index 7d4d6c768..730da5986 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/Entity.h @@ -1,8 +1,8 @@ #pragma once -#include "../../../../com/mojang/nbt/ListTag.h" -#include "../../../../com/mojang/nbt/DoubleTag.h" -#include "../../../../com/mojang/nbt/FloatTag.h" +#include "nbt/ListTag.h" +#include "nbt/DoubleTag.h" +#include "nbt/FloatTag.h" #include "../phys/Vec3.h" #include "../../../../ConsoleHelpers/Definitions.h" #include "../phys/AABB.h" @@ -350,7 +350,7 @@ public: virtual void lerpMotion(double xd, double yd, double zd); virtual void handleEntityEvent(uint8_t eventId); virtual void animateHurt(); - virtual ItemInstanceArray getEquipmentSlots(); // ItemInstance[] + virtual arrayWithLength> getEquipmentSlots(); // ItemInstance[] virtual void setEquippedSlot( int slot, std::shared_ptr item); // 4J Stu - Brought forward change from 1.3 to fix diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.cpp index ea4c301cb..c2d7a3350 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.cpp @@ -1,7 +1,7 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/Class.h" +#include "java/Class.h" #include "Painting.h" -#include "../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "Entity.h" #include "boss/wither/WitherBoss.h" #include "ambient/net.minecraft.world.entity.ambient.h" @@ -13,7 +13,7 @@ #include "npc/net.minecraft.world.entity.npc.h" #include "net.minecraft.world.entity.h" #include "../level/net.minecraft.world.level.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "EntityIO.h" std::unordered_map* EntityIO::idCreateMap = diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.h b/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.h index 93ca1afe0..830a5fd3a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/EntityIO.h @@ -1,7 +1,7 @@ #pragma once #include "Entity.h" -#include "../../../../ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class Level; class CompoundTag; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp index 1309325e7..240928c49 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ExperienceOrb.cpp @@ -4,8 +4,8 @@ #include "../phys/net.minecraft.world.phys.h" #include "../level/tile/net.minecraft.world.level.tile.h" #include "../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" -#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "nbt/com.mojang.nbt.h" +#include "java/JavaMath.h" #include "../../SharedConstants.h" #include "ExperienceOrb.h" #include "../../../../Header Files/SoundTypes.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp index 04c6ab578..3ed12ec66 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/HangingEntity.cpp @@ -4,7 +4,7 @@ #include "../level/tile/net.minecraft.world.level.tile.h" #include "../level/net.minecraft.world.level.h" #include "../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "HangingEntity.h" void HangingEntity::_init(Level* level) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp index 44699ac36..ded3dfd4a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ItemFrame.cpp @@ -8,7 +8,7 @@ #include "net.minecraft.world.entity.h" #include "../level/tile/net.minecraft.world.level.tile.h" #include "../level/saveddata/net.minecraft.world.level.saveddata.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "ItemFrame.h" // 4J - added for common ctor code diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp index b2c1759ee..4029ac3fb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../util/Mth.h" #include "../../network/packet/net.minecraft.network.packet.h" #include "../level/net.minecraft.world.level.h" @@ -22,7 +22,7 @@ #include "../item/alchemy/net.minecraft.world.item.alchemy.h" #include "../item/enchantment/net.minecraft.world.item.enchantment.h" #include "../scores/net.minecraft.world.scores.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "LivingEntity.h" #include #include "Minecraft.Client/net/minecraft/client/renderer/Textures.h" @@ -44,7 +44,7 @@ AttributeModifier* LivingEntity::SPEED_MODIFIER_SPRINTING = void LivingEntity::_init() { attributes = nullptr; combatTracker = new CombatTracker(this); - lastEquipment = ItemInstanceArray(5); + lastEquipment = arrayWithLength>(5); swinging = false; swingTime = 0; @@ -113,7 +113,7 @@ LivingEntity::LivingEntity(Level* level) : Entity(level) { rotA = (float)(Math::random() + 1) * 0.01f; setPos(x, y, z); timeOffs = (float)Math::random() * 12398; - yRot = (float)(Math::random() * PI * 2); + yRot = (float)(Math::random() * M_PI * 2); yHeadRot = yRot; footSize = 0.5f; @@ -357,7 +357,7 @@ void LivingEntity::addAdditonalSaveData(CompoundTag* entityTag) { entityTag->putShort(L"AttackTime", (short)attackTime); entityTag->putFloat(L"AbsorptionAmount", getAbsorptionAmount()); - ItemInstanceArray items = getEquipmentSlots(); + arrayWithLength> items = getEquipmentSlots(); for (unsigned int i = 0; i < items.length; ++i) { std::shared_ptr item = items[i]; if (item != nullptr) { @@ -768,7 +768,7 @@ bool LivingEntity::hurt(DamageSource* source, float dmg) { xd = (Math::random() - Math::random()) * 0.01; zd = (Math::random() - Math::random()) * 0.01; } - hurtDir = (float)(atan2(zd, xd) * 180 / PI) - yRot; + hurtDir = (float)(atan2(zd, xd) * 180 / M_PI) - yRot; knockback(sourceEntity, dmg, xd, zd); } else { hurtDir = (float)(int)((Math::random() * 2) * @@ -796,13 +796,13 @@ void LivingEntity::breakItem(std::shared_ptr itemInstance) { for (int i = 0; i < 5; i++) { Vec3 d = Vec3((random->nextFloat() - 0.5) * 0.1, Math::random() * 0.1 + 0.1, 0); - d.xRot(-xRot * PI / 180); - d.yRot(-yRot * PI / 180); + d.xRot(-xRot * M_PI / 180); + d.yRot(-yRot * M_PI / 180); Vec3 p = Vec3((random->nextFloat() - 0.5) * 0.3, -random->nextFloat() * 0.6 - 0.3, 0.6); - p.xRot(-xRot * PI / 180); - p.yRot(-yRot * PI / 180); + p.xRot(-xRot * M_PI / 180); + p.yRot(-yRot * M_PI / 180); p = p.add(x, y + getHeadHeight(), z); level->addParticle(PARTICLE_ICONCRACK(itemInstance->getItem()->id, 0), p.x, p.y, p.z, d.x, d.y + 0.05, d.z); @@ -951,7 +951,7 @@ void LivingEntity::animateHurt() { */ int LivingEntity::getArmorValue() { int val = 0; - ItemInstanceArray items = getEquipmentSlots(); + arrayWithLength> items = getEquipmentSlots(); for (unsigned int i = 0; i < items.length; ++i) { std::shared_ptr item = items[i]; if (item != nullptr && @@ -1439,7 +1439,7 @@ void LivingEntity::tick() { if (sideDist > 0.05f * 0.05f) { tRun = 1; walkSpeed = sqrt(sideDist) * 3; - yBodyRotT = ((float)atan2(zd, xd) * 180 / (float)PI - 90); + yBodyRotT = ((float)atan2(zd, xd) * 180 / (float)M_PI - 90); } if (attackAnim > 0) { yBodyRotT = yRot; @@ -1511,7 +1511,7 @@ void LivingEntity::aiStep() { // pop up the sides of walls, undersides of trees etc. AABB shrinkbb = bb.shrink(0.1, 0, 0.1); shrinkbb.y1 = shrinkbb.y0 + 0.1; - AABBList* collisions = level->getCubes(shared_from_this(), &shrinkbb); + std::vector* collisions = level->getCubes(shared_from_this(), &shrinkbb); if (collisions->size() > 0) { double yTop = 0; auto itEnd = collisions->end(); @@ -1653,8 +1653,8 @@ std::optional LivingEntity::getLookAngle() { return getViewVector(1); } Vec3 LivingEntity::getViewVector(float a) { if (a == 1) { - float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - PI); - float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - PI); + float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - M_PI); + float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - M_PI); float xCos = -Mth::cos(-xRot * Mth::RAD_TO_GRAD); float xSin = Mth::sin(-xRot * Mth::RAD_TO_GRAD); @@ -1663,8 +1663,8 @@ Vec3 LivingEntity::getViewVector(float a) { float xRot = xRotO + (this->xRot - xRotO) * a; float yRot = yRotO + (this->yRot - yRotO) * a; - float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - PI); - float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - PI); + float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - M_PI); + float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - M_PI); float xCos = -Mth::cos(-xRot * Mth::RAD_TO_GRAD); float xSin = Mth::sin(-xRot * Mth::RAD_TO_GRAD); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.h b/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.h index 1fad17157..eddf7caa9 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.h @@ -56,7 +56,7 @@ private: BaseAttributeMap* attributes; CombatTracker* combatTracker; std::unordered_map activeEffects; - ItemInstanceArray lastEquipment; + arrayWithLength> lastEquipment; public: bool swinging; @@ -242,7 +242,7 @@ public: std::shared_ptr item) = 0; virtual void setSprinting(bool value); - virtual ItemInstanceArray getEquipmentSlots() = 0; + virtual arrayWithLength> getEquipmentSlots() = 0; virtual Icon* getItemInHandIcon(std::shared_ptr item, int layer); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp index a945e899a..f8ac18ee8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../network/packet/net.minecraft.network.packet.h" #include "../level/tile/net.minecraft.world.level.tile.h" #include "../phys/net.minecraft.world.phys.h" @@ -21,7 +21,7 @@ #include "../net.minecraft.world.h" #include "Minecraft.Client/net/minecraft/server/level/ServerLevel.h" #include "Minecraft.Client/net/minecraft/server/level/EntityTracker.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Mob.h" #include "Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../../../../Header Files/SoundTypes.h" @@ -43,7 +43,7 @@ void Mob::_init() { target = nullptr; sensing = nullptr; - equipment = ItemInstanceArray(5); + equipment = arrayWithLength>(5); dropChances = floatArray(5); for (unsigned int i = 0; i < 5; ++i) { equipment[i] = nullptr; @@ -157,7 +157,7 @@ int Mob::getExperienceReward(std::shared_ptr killedBy) { if (xpReward > 0) { int result = xpReward; - ItemInstanceArray slots = getEquipmentSlots(); + arrayWithLength> slots = getEquipmentSlots(); for (int i = 0; i < slots.length; i++) { if (slots[i] != nullptr && dropChances[i] <= 1) { result += 1 + random->nextInt(3); @@ -505,8 +505,8 @@ void Mob::lookAt(std::shared_ptr e, float yMax, float xMax) { double sd = Mth::sqrt(xd * xd + zd * zd); - float yRotD = (float)(atan2(zd, xd) * 180 / PI) - 90; - float xRotD = (float)-(atan2(yd, sd) * 180 / PI); + float yRotD = (float)(atan2(zd, xd) * 180 / M_PI) - 90; + float xRotD = (float)-(atan2(yd, sd) * 180 / M_PI); xRot = rotlerp(xRot, xRotD, xMax); yRot = rotlerp(yRot, yRotD, yMax); } @@ -563,7 +563,7 @@ void Mob::setEquippedSlot(int slot, std::shared_ptr item) { equipment[slot] = item; } -ItemInstanceArray Mob::getEquipmentSlots() { return equipment; } +arrayWithLength> Mob::getEquipmentSlots() { return equipment; } void Mob::dropEquipment(bool byPlayer, int playerBonusLevel) { for (int slot = 0; slot < getEquipmentSlots().length; slot++) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.h b/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.h index bbc157ee7..6f80d5d51 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.h @@ -59,7 +59,7 @@ private: std::shared_ptr target; Sensing* sensing; - ItemInstanceArray equipment; + arrayWithLength> equipment; protected: floatArray dropChances; @@ -158,7 +158,7 @@ public: virtual std::shared_ptr getCarried(int slot); virtual std::shared_ptr getArmor(int pos); virtual void setEquippedSlot(int slot, std::shared_ptr item); - virtual ItemInstanceArray getEquipmentSlots(); + virtual arrayWithLength> getEquipmentSlots(); protected: virtual void dropEquipment(bool byPlayer, int playerBonusLevel); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/Painting.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/Painting.cpp index ccc916946..d6c99f61e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/Painting.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/Painting.cpp @@ -5,7 +5,7 @@ #include "../level/net.minecraft.world.level.h" #include "../level/material/net.minecraft.world.level.material.h" #include "../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Painting.h" #include "../level/material/Material.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp index 068d72d27..06a01510a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/PathfinderMob.cpp @@ -139,7 +139,7 @@ void PathfinderMob::serverAiStep() { double xd = target->x - x; double zd = target->z - z; double yd = target->y - yFloor; - float yRotD = (float)(atan2(zd, xd) * 180 / PI) - 90; + float yRotD = (float)(atan2(zd, xd) * 180 / M_PI) - 90; float rotDiff = Mth::wrapDegrees(yRotD - yRot); yya = (float)getAttribute(SharedMonsterAttributes::MOVEMENT_SPEED) ->getValue(); @@ -157,9 +157,9 @@ void PathfinderMob::serverAiStep() { double zd2 = attackTarget->z - z; float oldyRot = yRot; - yRot = (float)(atan2(zd2, xd2) * 180 / PI) - 90; + yRot = (float)(atan2(zd2, xd2) * 180 / M_PI) - 90; - rotDiff = ((oldyRot - yRot) + 90) * PI / 180; + rotDiff = ((oldyRot - yRot) + 90) * M_PI / 180; xxa = -Mth::sin(rotDiff) * yya * 1.0f; yya = Mth::cos(rotDiff) * yya * 1.0f; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp index d4abc7998..203b97301 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/Class.h" -#include "../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/Class.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../net.minecraft.h" #include "../../network/packet/net.minecraft.network.packet.h" #include "../item/net.minecraft.world.item.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp index 3fc8a02e7..99123f10d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/LookControl.cpp @@ -48,8 +48,8 @@ void LookControl::tick() { double zd = wantedZ - mob->z; double sd = sqrt(xd * xd + zd * zd); - float yRotD = (float)(atan2(zd, xd) * 180 / PI) - 90; - float xRotD = (float)-(atan2(yd, sd) * 180 / PI); + float yRotD = (float)(atan2(zd, xd) * 180 / M_PI) - 90; + float xRotD = (float)-(atan2(yd, sd) * 180 / M_PI); mob->xRot = rotlerp(mob->xRot, xRotD, xMax); mob->yHeadRot = rotlerp(mob->yHeadRot, yRotD, yMax); } else { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp index 483e02fb2..849b568fe 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/control/MoveControl.cpp @@ -46,7 +46,7 @@ void MoveControl::tick() { double dd = xd * xd + yd * yd + zd * zd; if (dd < MIN_SPEED_SQR) return; - float yRotD = (float)(atan2(zd, xd) * 180 / PI) - 90; + float yRotD = (float)(atan2(zd, xd) * 180 / M_PI) - 90; mob->yRot = rotlerp(mob->yRot, yRotD, MAX_TURN); mob->setSpeed( diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp index 2d4eeb79b..bce5cc384 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/ControlledByPlayerGoal.cpp @@ -63,7 +63,7 @@ void ControlledByPlayerGoal::tick() { boosting = false; } moveSpeed += moveSpeed * 1.15f * - Mth::sin((float)boostTime / boostTimeTotal * PI); + Mth::sin((float)boostTime / boostTimeTotal * M_PI); } float friction = 0.91f; @@ -76,8 +76,8 @@ void ControlledByPlayerGoal::tick() { } float friction2 = (0.6f * 0.6f * 0.91f * 0.91f * 0.6f * 0.91f) / (friction * friction * friction); - float sin = Mth::sin(pig->yRot * PI / 180); - float cos = Mth::cos(pig->yRot * PI / 180); + float sin = Mth::sin(pig->yRot * M_PI / 180); + float cos = Mth::cos(pig->yRot * M_PI / 180); float aproxSpeed = pig->getSpeed() * friction2; float dist = std::max((int)moveSpeed, 1); dist = aproxSpeed / dist; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp index 98eade3cd..c4955de36 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/OcelotSitOnTileGoal.cpp @@ -6,7 +6,7 @@ #include "../../../level/net.minecraft.world.level.h" #include "../../../level/tile/net.minecraft.world.level.tile.h" #include "../../../level/tile/entity/net.minecraft.world.level.tile.entity.h" -#include "../../../../../../ConsoleJavaLibs/Arrays.h" +#include "java/Arrays.h" #include "OcelotSitOnTileGoal.h" #include diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp index 88f12608b..96f40df55 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/goal/RandomLookAroundGoal.cpp @@ -19,7 +19,7 @@ bool RandomLookAroundGoal::canUse() { bool RandomLookAroundGoal::canContinueToUse() { return lookTime >= 0; } void RandomLookAroundGoal::start() { - double rnd = 2 * PI * mob->getRandom()->nextDouble(); + double rnd = 2 * M_PI * mob->getRandom()->nextDouble(); relX = cos(rnd); relZ = sin(rnd); lookTime = 20 + mob->getRandom()->nextInt(20); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp index 6c97d2d40..4837279d5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/village/VillageSiege.cpp @@ -86,11 +86,11 @@ bool VillageSiege::tryToSetupSiege() { bool overlaps = false; for (int i = 0; i < 10; ++i) { spawnX = center->x + - (int)(Mth::cos(level->random->nextFloat() * PI * 2.f) * + (int)(Mth::cos(level->random->nextFloat() * M_PI * 2.f) * radius * 0.9); spawnY = center->y; spawnZ = center->z + - (int)(Mth::sin(level->random->nextFloat() * PI * 2.f) * + (int)(Mth::sin(level->random->nextFloat() * M_PI * 2.f) * radius * 0.9); overlaps = false; std::vector >* villages = diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp index eb7380a65..7e8e9383f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ambient/Bat.cpp @@ -137,7 +137,7 @@ void Bat::newServerAiStep() { yd = yd + (signum(dy) * .7f - yd) * .1f; zd = zd + (signum(dz) * .5f - zd) * .1f; - float yRotD = (float)(atan2(zd, xd) * 180 / PI) - 90; + float yRotD = (float)(atan2(zd, xd) * 180 / M_PI) - 90; float rotDiff = Mth::wrapDegrees(yRotD - yRot); yya = .5f; yRot += rotDiff; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp index f231891d5..8f14af3cb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Animal.cpp @@ -1,6 +1,6 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../item/net.minecraft.world.item.h" #include "../../phys/net.minecraft.world.phys.h" @@ -12,7 +12,7 @@ #include "../../damageSource/net.minecraft.world.damagesource.h" #include "../monster/net.minecraft.world.entity.monster.h" #include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" -#include "../../../../../ConsoleJavaLibs/Random.h" +#include "java/Random.h" #include "Animal.h" Animal::Animal(Level* level) : AgableMob(level) { @@ -65,7 +65,7 @@ void Animal::checkHurtTarget(std::shared_ptr target, float d) { if (d < 3) { double xd = target->x - x; double zd = target->z - z; - yRot = (float)(atan2(zd, xd) * 180 / PI) - 90; + yRot = (float)(atan2(zd, xd) * 180 / M_PI) - 90; holdGround = true; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp index 95d608c28..7aa99a326 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Chicken.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" #include "../ai/goal/net.minecraft.world.entity.ai.goal.h" #include "../monster/net.minecraft.world.entity.monster.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp index db23caa65..419f1b0c5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Cow.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" #include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" #include "../ai/goal/net.minecraft.world.entity.ai.goal.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp index 21e11c53f..1f021d109 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.cpp @@ -1120,8 +1120,8 @@ void EntityHorse::travel(float xa, float ya) { hasImpulse = true; if (ya > 0) { - float sin = Mth::sin(yRot * PI / 180); - float cos = Mth::cos(yRot * PI / 180); + float sin = Mth::sin(yRot * M_PI / 180); + float cos = Mth::cos(yRot * M_PI / 180); xd += -0.4f * sin * playerJumpPendingScale; zd += 0.4f * cos * playerJumpPendingScale; @@ -1465,8 +1465,8 @@ void EntityHorse::positionRider() { Animal::positionRider(); if (standAnimO > 0) { - float sin = Mth::sin(yBodyRot * PI / 180); - float cos = Mth::cos(yBodyRot * PI / 180); + float sin = Mth::sin(yBodyRot * M_PI / 180); + float cos = Mth::cos(yBodyRot * M_PI / 180); float dist = .7f * standAnimO; float height = .15f * standAnimO; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp index 29fe5eb72..7e30faa15 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Pig.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../../stats/net.minecraft.stats.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../phys/net.minecraft.world.phys.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp index 0db18579d..041053a60 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Sheep.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../phys/net.minecraft.world.phys.h" #include "../../level/net.minecraft.world.level.h" @@ -135,12 +135,12 @@ float Sheep::getHeadEatAngleScale(float a) { if (eatAnimationTick > 4 && eatAnimationTick <= (EAT_ANIMATION_TICKS - 4)) { float scale = ((float)(eatAnimationTick - 4) - a) / (float)(EAT_ANIMATION_TICKS - 8); - return PI * .20f + PI * .07f * Mth::sin(scale * 28.7f); + return M_PI * .20f + M_PI * .07f * Mth::sin(scale * 28.7f); } if (eatAnimationTick > 0) { - return PI * .20f; + return M_PI * .20f; } - return ((xRot / (180.0f / PI))); + return ((xRot / (180.0f / M_PI))); } bool Sheep::mobInteract(std::shared_ptr player) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp index 4b8a1fdb3..c6cbe59f5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Squid.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../phys/net.minecraft.world.phys.h" #include "../../level/net.minecraft.world.level.h" @@ -80,17 +80,17 @@ void Squid::aiStep() { oldTentacleAngle = tentacleAngle; tentacleMovement += tentacleSpeed; - if (tentacleMovement > (float)PI * 2.0f) { - tentacleMovement -= (float)PI * 2.0f; + if (tentacleMovement > (float)M_PI * 2.0f) { + tentacleMovement -= (float)M_PI * 2.0f; if (random->nextInt(10) == 0) tentacleSpeed = 1 / (random->nextFloat() + 1) * 0.2f; } if (isInWater()) { - if (tentacleMovement < PI) { - float tentacleScale = tentacleMovement / PI; + if (tentacleMovement < M_PI) { + float tentacleScale = tentacleMovement / M_PI; tentacleAngle = - Mth::sin(tentacleScale * tentacleScale * PI) * PI * 0.25f; + Mth::sin(tentacleScale * tentacleScale * M_PI) * M_PI * 0.25f; if (tentacleScale > .75) { speed = 1.0f; @@ -112,14 +112,14 @@ void Squid::aiStep() { double horizontalMovement = sqrt(xd * xd + zd * zd); - yBodyRot += ((-(float)atan2(xd, zd) * 180 / PI) - yBodyRot) * 0.1f; + yBodyRot += ((-(float)atan2(xd, zd) * 180 / M_PI) - yBodyRot) * 0.1f; yRot = yBodyRot; - zBodyRot = zBodyRot + (float)PI * rotateSpeed * 1.5f; + zBodyRot = zBodyRot + (float)M_PI * rotateSpeed * 1.5f; xBodyRot += - ((-(float)atan2(horizontalMovement, yd) * 180 / PI) - xBodyRot) * + ((-(float)atan2(horizontalMovement, yd) * 180 / M_PI) - xBodyRot) * 0.1f; } else { - tentacleAngle = Mth::abs(Mth::sin(tentacleMovement)) * PI * 0.25f; + tentacleAngle = Mth::abs(Mth::sin(tentacleMovement)) * M_PI * 0.25f; if (!level->isClientSide) { // unable to move, apply gravity @@ -144,7 +144,7 @@ void Squid::serverAiStep() { tx = ty = tz = 0; } else if (random->nextInt(50) == 0 || !wasInWater || (tx == 0 && ty == 0 && tz == 0)) { - float angle = random->nextFloat() * PI * 2.0f; + float angle = random->nextFloat() * M_PI * 2.0f; tx = Mth::cos(angle) * 0.2f; ty = -0.1f + random->nextFloat() * 0.2f; tz = Mth::sin(angle) * 0.2f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp index 44432db4b..a972fb0aa 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/WaterAnimal.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../phys/net.minecraft.world.phys.h" #include "../../level/net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp index 82d2e030b..fa944963b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/animal/Wolf.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../phys/net.minecraft.world.phys.h" #include "../../level/net.minecraft.world.level.h" @@ -184,7 +184,7 @@ void Wolf::tick() { if (shakeAnim > 0.4f) { float yt = (float)bb.y0; int shakeCount = - (int)(Mth::sin((shakeAnim - 0.4f) * PI) * 7.0f); + (int)(Mth::sin((shakeAnim - 0.4f) * M_PI) * 7.0f); for (int i = 0; i < shakeCount; i++) { float xo = (random->nextFloat() * 2 - 1) * bbWidth * 0.5f; float zo = (random->nextFloat() * 2 - 1) * bbWidth * 0.5f; @@ -210,13 +210,13 @@ float Wolf::getBodyRollAngle(float a, float offset) { } else if (progress > 1) { progress = 1; } - return Mth::sin(progress * PI) * Mth::sin(progress * PI * 11.0f) * 0.15f * - PI; + return Mth::sin(progress * M_PI) * Mth::sin(progress * M_PI * 11.0f) * 0.15f * + M_PI; } float Wolf::getHeadRollAngle(float a) { return (interestedAngleO + (interestedAngle - interestedAngleO) * a) * - 0.15f * PI; + 0.15f * M_PI; } float Wolf::getHeadHeight() { return bbHeight * 0.8f; } @@ -382,13 +382,13 @@ void Wolf::handleEntityEvent(uint8_t id) { float Wolf::getTailAngle() { if (isAngry()) { - return 0.49f * PI; + return 0.49f * M_PI; } else if (isTame()) { return (0.55f - (MAX_HEALTH - entityData->getFloat(DATA_HEALTH_ID)) * 0.02f) * - PI; + M_PI; } - return 0.20f * PI; + return 0.20f * M_PI; } bool Wolf::isFood(std::shared_ptr item) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp index a9a408d89..7c00d8bbe 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/boss/enderdragon/EnderDragon.cpp @@ -199,8 +199,8 @@ void EnderDragon::aiStep() { // previously saved at point of hes death setHealth(getHealth()); - float flap = Mth::cos(flapTime * PI * 2); - float oldFlap = Mth::cos(oFlapTime * PI * 2); + float flap = Mth::cos(flapTime * M_PI * 2); + float oldFlap = Mth::cos(oFlapTime * M_PI * 2); if (oldFlap <= -0.3f && flap >= -0.3f) { level->playLocalSound(x, y, z, eSoundType_MOB_ENDERDRAGON_MOVE, 1, @@ -316,7 +316,7 @@ void EnderDragon::aiStep() { // d < 3; ++d) { Vec3 vN = Vec3{v.x, v.y, v.z}.normalize(); - vN.yRot(-PI / 4); + vN.yRot(-M_PI / 4); for (unsigned int i = 0; i < 8; ++i) { if (getSynchedAction() == e_EnderdragonAction_Landing) { @@ -363,7 +363,7 @@ void EnderDragon::aiStep() { -vN.z * xzVelocity * j); } } - vN.yRot(PI / (2 * 8)); + vN.yRot(M_PI / (2 * 8)); } } } else if (getSynchedAction() == @@ -481,11 +481,11 @@ void EnderDragon::aiStep() { Vec3 aim = Vec3((attackTarget->x - x), 0, (attackTarget->z - z)) .normalize(); - Vec3 dir = Vec3(sin(yRot * PI / 180), 0, -cos(yRot * PI / 180)) + Vec3 dir = Vec3(sin(yRot * M_PI / 180), 0, -cos(yRot * M_PI / 180)) .normalize(); float dot = (float)dir.dot(aim); - float angleDegs = acos(dot) * 180 / PI; + float angleDegs = acos(dot) * 180 / M_PI; angleDegs = angleDegs + 0.5f; if (angleDegs < 0 || angleDegs > 10) { @@ -495,7 +495,7 @@ void EnderDragon::aiStep() { // 2); double zdd = attackTarget->z - head->z; - double yRotT = (180) - atan2(xdd, zdd) * 180 / PI; + double yRotT = (180) - atan2(xdd, zdd) * 180 / M_PI; double yRotD = Mth::wrapDegrees(yRotT - yRot); if (yRotD > 50) yRotD = 50; @@ -554,7 +554,7 @@ void EnderDragon::aiStep() { while (yRot < -180) yRot += 180 * 2; while (yRot >= 180) yRot -= 180 * 2; - double yRotT = (180) - atan2(xdd, zdd) * 180 / PI; + double yRotT = (180) - atan2(xdd, zdd) * 180 / M_PI; double yRotD = yRotT - yRot; while (yRotD < -180) yRotD += 180 * 2; while (yRotD >= 180) yRotD -= 180 * 2; @@ -565,7 +565,7 @@ void EnderDragon::aiStep() { Vec3 aim = Vec3((xTarget - x), (yTarget - y), (zTarget - z)).normalize(); - Vec3 dir = Vec3(sin(yRot * PI / 180), yd, -cos(yRot * PI / 180)) + Vec3 dir = Vec3(sin(yRot * M_PI / 180), yd, -cos(yRot * M_PI / 180)) .normalize(); float dot = (float)(dir.dot(aim) + 0.5f) / 1.5f; if (dot < 0) dot = 0; @@ -623,8 +623,8 @@ void EnderDragon::aiStep() { // getLatencyPos(latencyPosB, 10, 1); // float tilt = (float) (latencyPosA[1] - latencyPosB[1]) * 10 / 180.0f * - // PI; - float tilt = (float)getTilt(1) / 180.0f * PI; + // M_PI; + float tilt = (float)getTilt(1) / 180.0f * M_PI; float ccTilt = cos(tilt); // 4J Stu - ssTilt was negative sin(tilt), but this causes the bounding @@ -632,7 +632,7 @@ void EnderDragon::aiStep() { // when tilting forward, and down when tilting backwards float ssTilt = sin(tilt); - float rot1 = yRot * PI / 180; + float rot1 = yRot * M_PI / 180; float ss1 = sin(rot1); float cc1 = cos(rot1); @@ -667,8 +667,8 @@ void EnderDragon::aiStep() { double yRotDiff = getHeadYRotDiff(1); - float ss = sin((yRot + yRotDiff) * PI / 180 - yRotA * 0.01f); - float cc = cos((yRot + yRotDiff) * PI / 180 - yRotA * 0.01f); + float ss = sin((yRot + yRotDiff) * M_PI / 180 - yRotA * 0.01f); + float cc = cos((yRot + yRotDiff) * M_PI / 180 - yRotA * 0.01f); head->tick(); neck->tick(); double yOffset = getHeadYOffset(1); // (p0[1] - p1[1]) * 1 @@ -715,7 +715,7 @@ void EnderDragon::aiStep() { doubleArray p0 = doubleArray(p0components, 3); getLatencyPos(p0, 12 + i * 2, 1); - float rot = yRot * PI / 180 + rotWrap(p0[0] - p1[0]) * PI / 180 * (1); + float rot = yRot * M_PI / 180 + rotWrap(p0[0] - p1[0]) * M_PI / 180 * (1); float ss = sin(rot); float cc = cos(rot); @@ -739,11 +739,11 @@ void EnderDragon::aiStep() { Vec3 aim = Vec3((attackTarget->x - x), 0, (attackTarget->z - z)) .normalize(); - Vec3 dir = Vec3(sin(yRot * PI / 180), 0, -cos(yRot * PI / 180)) + Vec3 dir = Vec3(sin(yRot * M_PI / 180), 0, -cos(yRot * M_PI / 180)) .normalize(); float dot = (float)dir.dot(aim); - float angleDegs = acos(dot) * 180 / PI; + float angleDegs = acos(dot) * 180 / M_PI; angleDegs = angleDegs + 0.5f; if (m_fireballCharge >= 20 && @@ -1116,7 +1116,7 @@ bool EnderDragon::hurt(std::shared_ptr MultiEntityMobPart, damage = damage / 4 + 1; } - // float rot1 = yRot * PI / 180; + // float rot1 = yRot * M_PI / 180; // float ss1 = sin(rot1); // float cc1 = cos(rot1); @@ -1529,18 +1529,18 @@ int EnderDragon::findClosestNode() { int yAdjustment = 5; multiplier = i; if (i < 12) { - nodeX = 60 * Mth::cos(2 * (-PI + (PI / 12) * multiplier)); - nodeZ = 60 * Mth::sin(2 * (-PI + (PI / 12) * multiplier)); + nodeX = 60 * Mth::cos(2 * (-M_PI + (M_PI / 12) * multiplier)); + nodeZ = 60 * Mth::sin(2 * (-M_PI + (M_PI / 12) * multiplier)); } else if (i < 20) { multiplier -= 12; - nodeX = 40 * Mth::cos(2 * (-PI + (PI / 8) * multiplier)); - nodeZ = 40 * Mth::sin(2 * (-PI + (PI / 8) * multiplier)); + nodeX = 40 * Mth::cos(2 * (-M_PI + (M_PI / 8) * multiplier)); + nodeZ = 40 * Mth::sin(2 * (-M_PI + (M_PI / 8) * multiplier)); yAdjustment += 10; // Make the target well above the top of the towers } else { multiplier -= 20; - nodeX = 20 * Mth::cos(2 * (-PI + (PI / 4) * multiplier)); - nodeZ = 20 * Mth::sin(2 * (-PI + (PI / 4) * multiplier)); + nodeX = 20 * Mth::cos(2 * (-M_PI + (M_PI / 4) * multiplier)); + nodeZ = 20 * Mth::sin(2 * (-M_PI + (M_PI / 4) * multiplier)); } // Fix for #77202 - TU9: Content: Gameplay: The Ender Dragon // sometimes flies through terrain Add minimum height diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp index 0760d39f6..a2ed6baee 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/boss/wither/WitherBoss.cpp @@ -156,8 +156,8 @@ void WitherBoss::aiStep() { double zd = e->z - hz; double sd = Mth::sqrt(xd * xd + zd * zd); - float yRotD = (float)(atan2(zd, xd) * 180 / PI) - 90; - float xRotD = (float)-(atan2(yd, sd) * 180 / PI); + float yRotD = (float)(atan2(zd, xd) * 180 / M_PI) - 90; + float xRotD = (float)-(atan2(yd, sd) * 180 / M_PI); xRotHeads[i] = rotlerp(xRotHeads[i], xRotD, 40); yRotHeads[i] = rotlerp(yRotHeads[i], yRotD, 10); @@ -348,7 +348,7 @@ double WitherBoss::getHeadX(int index) { if (index <= 0) { return x; } - float headAngle = (yBodyRot + 180 * (index - 1)) / 180.0f * PI; + float headAngle = (yBodyRot + 180 * (index - 1)) / 180.0f * M_PI; float cos = Mth::cos(headAngle); return x + cos * 1.3; } @@ -365,7 +365,7 @@ double WitherBoss::getHeadZ(int index) { if (index <= 0) { return z; } - float headAngle = (yBodyRot + 180 * (index - 1)) / 180.0f * PI; + float headAngle = (yBodyRot + 180 * (index - 1)) / 180.0f * M_PI; float sin = Mth::sin(headAngle); return z + sin * 1.3; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/Boat.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/Boat.cpp index 260547e33..3a62b903a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/Boat.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/Boat.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../net.minecraft.world.entity.h" #include "../player/net.minecraft.world.entity.player.h" #include "../../item/net.minecraft.world.item.h" @@ -175,8 +175,8 @@ void Boat::tick() { double lastSpeed = sqrt(xd * xd + zd * zd); if (lastSpeed > MAX_COLLISION_SPEED) { - double xa = cos(yRot * PI / 180); - double za = sin(yRot * PI / 180); + double xa = cos(yRot * M_PI / 180); + double za = sin(yRot * M_PI / 180); for (int i = 0; i < 1 + lastSpeed * 60; i++) { double side = (random->nextFloat() * 2 - 1); @@ -248,8 +248,8 @@ void Boat::tick() { double forward = livingRider->yya; if (forward > 0) { - double riderXd = -sin(livingRider->yRot * PI / 180); - double riderZd = cos(livingRider->yRot * PI / 180); + double riderXd = -sin(livingRider->yRot * M_PI / 180); + double riderZd = cos(livingRider->yRot * M_PI / 180); xd += riderXd * acceleration * 0.05f; zd += riderZd * acceleration * 0.05f; } @@ -301,7 +301,7 @@ void Boat::tick() { double xDiff = xo - x; double zDiff = zo - z; if (xDiff * xDiff + zDiff * zDiff > 0.001) { - yRotT = (float)(atan2(zDiff, xDiff) * 180 / PI); + yRotT = (float)(atan2(zDiff, xDiff) * 180 / M_PI); } double rotDiff = Mth::wrapDegrees(yRotT - yRot); @@ -352,8 +352,8 @@ void Boat::tick() { void Boat::positionRider() { if (rider.lock() == nullptr) return; - double xa = cos(yRot * PI / 180) * 0.4; - double za = sin(yRot * PI / 180) * 0.4; + double xa = cos(yRot * M_PI / 180) * 0.4; + double za = sin(yRot * M_PI / 180) * 0.4; rider.lock()->setPos( x + xa, y + getRideHeight() + rider.lock()->getRidingHeight(), z + za); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp index 50f893d53..8b226a6f6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/FallingTile.cpp @@ -3,7 +3,7 @@ #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../level/net.minecraft.world.level.h" #include "../../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "FallingTile.h" // 4J - added for common ctor code diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp index 2d2faae57..1a5de7665 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../stats/net.minecraft.stats.h" #include "../net.minecraft.world.entity.h" #include "../../level/net.minecraft.world.level.h" @@ -9,7 +9,7 @@ #include "../player/net.minecraft.world.entity.player.h" #include "../../level/material/net.minecraft.world.level.material.h" #include "../../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "ItemEntity.h" #include "../../../../../Header Files/SoundTypes.h" @@ -17,7 +17,7 @@ void ItemEntity::_init() { age = 0; throwTime = 0; health = 5; - bobOffs = (float)(Math::random() * PI * 2); + bobOffs = (float)(Math::random() * M_PI * 2); // 4J Stu - This function call had to be moved here from the Entity ctor to // ensure that the derived version of the function is called diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp index 5b1834fd5..a6080f98d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/Minecart.cpp @@ -11,7 +11,7 @@ #include "../../damageSource/net.minecraft.world.damagesource.h" #include "Minecraft.Client/net/minecraft/server/MinecraftServer.h" #include "Minecraft.Client/net/minecraft/server/level/ServerLevel.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Minecart.h" #include #include @@ -295,7 +295,7 @@ void Minecart::tick() { double xDiff = xo - x; double zDiff = zo - z; if (xDiff * xDiff + zDiff * zDiff > 0.001) { - yRot = (float)(atan2(zDiff, xDiff) * 180 / PI); + yRot = (float)(atan2(zDiff, xDiff) * 180 / M_PI); if (flipped) yRot += 180; } @@ -417,8 +417,8 @@ void Minecart::moveAlongTrack(int xt, int yt, int zt, double maxSpeed, double forward = living->yya; if (forward > 0) { - double riderXd = -sin(living->yRot * PI / 180); - double riderZd = cos(living->yRot * PI / 180); + double riderXd = -sin(living->yRot * M_PI / 180); + double riderZd = cos(living->yRot * M_PI / 180); double ownDist = xd * xd + zd * zd; @@ -736,7 +736,7 @@ void Minecart::push(std::shared_ptr e) { Vec3 dir(xo, 0, zo); dir = dir.normalize(); - Vec3 facing(cos(yRot * PI / 180), 0, sin(yRot * PI / 180)); + Vec3 facing(cos(yRot * M_PI / 180), 0, sin(yRot * M_PI / 180)); facing = facing.normalize(); double dot = abs(dir.dot(facing)); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp index e38f93e01..101291085 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.cpp @@ -7,7 +7,7 @@ #include "MinecartContainer.h" void MinecartContainer::_init() { - items = ItemInstanceArray(9 * 4); + items = arrayWithLength>(9 * 4); dropEquipment = true; // 4J Stu - This function call had to be moved here from the Entity ctor to @@ -181,7 +181,7 @@ void MinecartContainer::readAdditionalSaveData(CompoundTag* base) { ListTag* inventoryList = (ListTag*)base->getList(L"Items"); delete[] items.data; - items = ItemInstanceArray(getContainerSize()); + items = arrayWithLength>(getContainerSize()); for (int i = 0; i < inventoryList->size(); i++) { CompoundTag* tag = inventoryList->get(i); int slot = tag->getByte(L"Slot") & 0xff; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h b/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h index 88f900304..2b4595fec 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/MinecartContainer.h @@ -5,7 +5,7 @@ class MinecartContainer : public Minecart, public virtual Container { private: - ItemInstanceArray items; + arrayWithLength> items; bool dropEquipment; void _init(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp index 97d337b41..c81ea76ee 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/PrimedTnt.cpp @@ -1,6 +1,6 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "java/JavaMath.h" +#include "nbt/com.mojang.nbt.h" #include "../../level/net.minecraft.world.level.h" #include "PrimedTnt.h" @@ -30,7 +30,7 @@ PrimedTnt::PrimedTnt(Level* level, double x, double y, double z, setPos(x, y, z); - float rot = (float)(Math::random() * PI * 2); + float rot = (float)(Math::random() * M_PI * 2); xd = -sin(rot) * 0.02f; yd = +0.2f; zd = -cos(rot) * 0.02f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp index e38af435d..e200beabe 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Blaze.cpp @@ -139,7 +139,7 @@ void Blaze::checkHurtTarget(std::shared_ptr target, float d) { } } } - yRot = (float)(atan2(zd, xd) * 180 / PI) - 90; + yRot = (float)(atan2(zd, xd) * 180 / M_PI) - 90; holdGround = true; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp index dc3f5a467..37462ceb7 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/EnderMan.cpp @@ -8,7 +8,7 @@ #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../damageSource/net.minecraft.world.damagesource.h" #include "../../phys/net.minecraft.world.phys.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "EnderMan.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp index 9e365581b..b301becd8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Ghast.cpp @@ -121,7 +121,7 @@ void Ghast::serverAiStep() { double ydd = (target->bb.y0 + target->bbHeight / 2) - (y + bbHeight / 2); double zdd = target->z - z; - yBodyRot = yRot = -(float)atan2(xdd, zdd) * 180 / PI; + yBodyRot = yRot = -(float)atan2(xdd, zdd) * 180 / M_PI; if (canSee(target)) { if (charge == 10) { @@ -152,7 +152,7 @@ void Ghast::serverAiStep() { if (charge > 0) charge--; } } else { - yBodyRot = yRot = -(float)atan2(this->xd, this->zd) * 180 / PI; + yBodyRot = yRot = -(float)atan2(this->xd, this->zd) * 180 / M_PI; if (charge > 0) charge--; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp index 5d7456828..2cbf8c183 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Monster.cpp @@ -89,8 +89,8 @@ bool Monster::doHurtTarget(std::shared_ptr target) { if (wasHurt) { if (knockback > 0) { - target->push(-Mth::sin(yRot * PI / 180) * knockback * .5f, 0.1, - Mth::cos(yRot * PI / 180) * knockback * .5f); + target->push(-Mth::sin(yRot * M_PI / 180) * knockback * .5f, 0.1, + Mth::cos(yRot * M_PI / 180) * knockback * .5f); xd *= 0.6; zd *= 0.6; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp index 671281ad9..7dfc2dd6e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/PigZombie.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../net.minecraft.world.h" #include "../../level/net.minecraft.world.level.h" #include "../../phys/net.minecraft.world.phys.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp index 7d26184a0..4f2420259 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Slime.cpp @@ -11,7 +11,7 @@ #include "../player/net.minecraft.world.entity.player.h" #include "net.minecraft.world.entity.monster.h" #include "../../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Slime.h" #include "Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../../../../../Header Files/SoundTypes.h" @@ -87,7 +87,7 @@ void Slime::tick() { if (onGround && !wasOnGround) { int size = getSize(); for (int i = 0; i < size * 8; i++) { - float dir = random->nextFloat() * PI * 2; + float dir = random->nextFloat() * M_PI * 2; float d = random->nextFloat() * 0.5f + 0.5f; float xd = Mth::sin(dir) * size * 0.5f * d; float zd = Mth::cos(dir) * size * 0.5f * d; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp index b991baf35..a746de764 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Spider.cpp @@ -8,7 +8,7 @@ #include "../../effect/net.minecraft.world.effect.h" #include "../net.minecraft.world.entity.h" #include "net.minecraft.world.entity.monster.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Spider.h" #include #include "Minecraft.Client/net/minecraft/client/renderer/Textures.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp index 0b8db4426..5cfac3cd4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/monster/Zombie.cpp @@ -16,7 +16,7 @@ #include "../../../stats/GenericStats.h" #include "Minecraft.Client/net/minecraft/client/renderer/Textures.h" #include "../net.minecraft.world.entity.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../../../Header Files/SoundTypes.h" Attribute* Zombie::SPAWN_REINFORCEMENTS_CHANCE = diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp index 7f86b136c..2cd1abf49 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/npc/Villager.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../ai/attributes/net.minecraft.world.entity.ai.attributes.h" #include "../ai/goal/net.minecraft.world.entity.ai.goal.h" #include "../ai/navigation/net.minecraft.world.entity.ai.navigation.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp index bccbdcf08..d3798700b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Abilities.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Abilities.h" Abilities::Abilities() { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp index 8b682b0c8..ae2bcc920 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "net.minecraft.world.entity.player.h" #include "../../item/net.minecraft.world.item.h" #include "../../level/tile/net.minecraft.world.level.tile.h" @@ -17,8 +17,8 @@ const int Inventory::SELECTION_SIZE = 9; // we don't want to also keep a shared_ptr of it. If we pass it on we should use // shared_from_this() though Inventory::Inventory(Player* player) { - items = ItemInstanceArray(INVENTORY_SIZE); - armor = ItemInstanceArray(4); + items = arrayWithLength>(INVENTORY_SIZE); + armor = arrayWithLength>(4); selected = 0; @@ -344,7 +344,7 @@ bool Inventory::add(std::shared_ptr item) { std::shared_ptr Inventory::removeItem(unsigned int slot, int count) { - ItemInstanceArray pile = items; + arrayWithLength> pile = items; if (slot >= items.length) { pile = armor; slot -= items.length; @@ -365,7 +365,7 @@ std::shared_ptr Inventory::removeItem(unsigned int slot, } std::shared_ptr Inventory::removeItemNoUpdate(int slot) { - ItemInstanceArray pile = items; + arrayWithLength> pile = items; if (slot >= items.length) { pile = armor; slot -= items.length; @@ -403,7 +403,7 @@ void Inventory::setItem(unsigned int slot, std::shared_ptr item) { } player->handleCollectItem(item); /* - ItemInstanceArray& pile = items; + arrayWithLength>& pile = items; if (slot >= pile.length) { slot -= pile.length; @@ -450,8 +450,8 @@ void Inventory::load(ListTag* inventoryList) { delete[] armor.data; armor.data = nullptr; } - items = ItemInstanceArray(INVENTORY_SIZE); - armor = ItemInstanceArray(4); + items = arrayWithLength>(INVENTORY_SIZE); + armor = arrayWithLength>(4); for (int i = 0; i < inventoryList->size(); i++) { CompoundTag* tag = inventoryList->get(i); unsigned int slot = tag->getByte(L"Slot") & 0xff; @@ -475,7 +475,7 @@ std::shared_ptr Inventory::getItem(unsigned int slot) { return items[slot]; } /* - ItemInstanceArray pile = items; + arrayWithLength> pile = items; if (slot >= pile.length) { slot -= pile.length; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.h b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.h index 9af2a7d83..8d3dc01cd 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Inventory.h @@ -1,6 +1,6 @@ #pragma once #include "../../Container.h" -#include "../../../../../com/mojang/nbt/ListTag.h" +#include "nbt/ListTag.h" #include "../../item/ItemInstance.h" class Player; @@ -16,8 +16,8 @@ private: static const int SELECTION_SIZE; public: - ItemInstanceArray items; - ItemInstanceArray armor; + arrayWithLength> items; + arrayWithLength> armor; int selected; Player* player; // This is owned by shared_ptrs, but we are owned by it diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp index a69189c0c..47858f8d6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp @@ -8,7 +8,7 @@ // virtual GetType function) #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../net.minecraft.h" #include "../../net.minecraft.world.h" #include "../../../stats/net.minecraft.stats.h" @@ -425,13 +425,13 @@ void Player::spawnEatParticles(std::shared_ptr useItem, Vec3 d{(random->nextFloat() - 0.5) * 0.1, Math::random() * 0.1 + 0.1, 0}; - d.xRot(-xRot * PI / 180); - d.yRot(-yRot * PI / 180); + d.xRot(-xRot * M_PI / 180); + d.yRot(-yRot * M_PI / 180); Vec3 p{(random->nextFloat() - 0.5) * 0.3, -random->nextFloat() * 0.6 - 0.3, 0.6}; - p.xRot(-xRot * PI / 180); - p.yRot(-yRot * PI / 180); + p.xRot(-xRot * M_PI / 180); + p.yRot(-yRot * M_PI / 180); p = p.add(x, y + getHeadHeight(), z); level->addParticle(PARTICLE_ICONCRACK(useItem->getItem()->id, 0), @@ -899,8 +899,8 @@ void Player::die(DamageSource* source) { } if (source != nullptr) { - xd = -Mth::cos((hurtDir + yRot) * PI / 180) * 0.1f; - zd = -Mth::sin((hurtDir + yRot) * PI / 180) * 0.1f; + xd = -Mth::cos((hurtDir + yRot) * M_PI / 180) * 0.1f; + zd = -Mth::sin((hurtDir + yRot) * M_PI / 180) * 0.1f; } else { xd = zd = 0; } @@ -962,19 +962,19 @@ std::shared_ptr Player::drop(std::shared_ptr item, float pow = 0.1f; if (randomly) { float _pow = random->nextFloat() * 0.5f; - float dir = random->nextFloat() * PI * 2; + float dir = random->nextFloat() * M_PI * 2; thrownItem->xd = -sin(dir) * _pow; thrownItem->zd = cos(dir) * _pow; thrownItem->yd = 0.2f; } else { pow = 0.3f; - thrownItem->xd = -sin(yRot / 180 * PI) * cos(xRot / 180 * PI) * pow; - thrownItem->zd = cos(yRot / 180 * PI) * cos(xRot / 180 * PI) * pow; - thrownItem->yd = -sin(xRot / 180 * PI) * pow + 0.1f; + thrownItem->xd = -sin(yRot / 180 * M_PI) * cos(xRot / 180 * M_PI) * pow; + thrownItem->zd = cos(yRot / 180 * M_PI) * cos(xRot / 180 * M_PI) * pow; + thrownItem->yd = -sin(xRot / 180 * M_PI) * pow + 0.1f; pow = 0.02f; - float dir = random->nextFloat() * PI * 2; + float dir = random->nextFloat() * M_PI * 2; pow *= random->nextFloat(); thrownItem->xd += cos(dir) * pow; thrownItem->yd += (random->nextFloat() - random->nextFloat()) * 0.1f; @@ -1353,8 +1353,8 @@ void Player::attack(std::shared_ptr entity) { delete damageSource; if (wasHurt) { if (knockback > 0) { - entity->push(-Mth::sin(yRot * PI / 180) * knockback * .5f, 0.1, - Mth::cos(yRot * PI / 180) * knockback * .5f); + entity->push(-Mth::sin(yRot * M_PI / 180) * knockback * .5f, 0.1, + Mth::cos(yRot * M_PI / 180) * knockback * .5f); xd *= 0.6; zd *= 0.6; setSprinting(false); @@ -1429,7 +1429,7 @@ void Player::respawn() { deathFadeCounter = 0; } void Player::animateRespawn(std::shared_ptr player, Level* level) { for (int i = 0; i < 45; i++) { - float angle = i * PI * 4.0f / 25.0f; + float angle = i * M_PI * 4.0f / 25.0f; float xo = Mth::cos(angle) * 0.7f; float zo = Mth::sin(angle) * 0.7f; @@ -2200,7 +2200,7 @@ bool Player::isInvisibleTo(std::shared_ptr player) { return isInvisible(); } -ItemInstanceArray Player::getEquipmentSlots() { return inventory->armor; } +arrayWithLength> Player::getEquipmentSlots() { return inventory->armor; } bool Player::isCapeHidden() { return getPlayerFlag(FLAG_HIDE_CAPE); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.h b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.h index 4fbe69218..15bb74aa6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.h +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.h @@ -414,7 +414,7 @@ public: virtual std::shared_ptr getCarriedItem(); virtual void setEquippedSlot(int slot, std::shared_ptr item); virtual bool isInvisibleTo(std::shared_ptr player); - virtual ItemInstanceArray getEquipmentSlots(); + virtual arrayWithLength> getEquipmentSlots(); virtual bool isCapeHidden(); virtual bool isPushedByWater(); virtual Scoreboard* getScoreboard(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp index 36dfbf54a..d7efbb9c7 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Arrow.cpp @@ -10,7 +10,7 @@ #include "../../../network/packet/net.minecraft.network.packet.h" #include "Minecraft.Client/net/minecraft/server/level/ServerPlayer.h" #include "Minecraft.Client/net/minecraft/server/network/PlayerConnection.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Arrow.h" // 4J : WESTY : Added for other award, kill creeper with arrow. @@ -69,8 +69,8 @@ Arrow::Arrow(Level* level, std::shared_ptr mob, double sd = sqrt(xd * xd + zd * zd); if (sd < 0.0000001) return; - float yRot = (float)(atan2(zd, xd) * 180 / PI) - 90; - float xRot = (float)-(atan2(yd, sd) * 180 / PI); + float yRot = (float)(atan2(zd, xd) * 180 / M_PI) - 90; + float xRot = (float)-(atan2(yd, sd) * 180 / M_PI); double xdn = xd / sd; double zdn = zd / sd; @@ -103,15 +103,15 @@ Arrow::Arrow(Level* level, std::shared_ptr mob, float power) moveTo(mob->x, mob->y + mob->getHeadHeight(), mob->z, mob->yRot, mob->xRot); - x -= Mth::cos(yRot / 180 * PI) * 0.16f; + x -= Mth::cos(yRot / 180 * M_PI) * 0.16f; y -= 0.1f; - z -= Mth::sin(yRot / 180 * PI) * 0.16f; + z -= Mth::sin(yRot / 180 * M_PI) * 0.16f; setPos(x, y, z); heightOffset = 0; - xd = -Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); - zd = Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); - yd = -Mth::sin(xRot / 180 * PI); + xd = -Mth::sin(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI); + zd = Mth::cos(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI); + yd = -Mth::sin(xRot / 180 * M_PI); shoot(xd, yd, zd, power * 1.5f, 1); } @@ -143,8 +143,8 @@ void Arrow::shoot(double xd, double yd, double zd, float pow, double sd = sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, sd) * 180 / M_PI); life = 0; } @@ -160,8 +160,8 @@ void Arrow::lerpMotion(double xd, double yd, double zd) { this->zd = zd; if (xRotO == 0 && yRotO == 0) { double sd = sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, sd) * 180 / M_PI); xRotO = xRot; yRotO = yRot; app.DebugPrintf("%f %f : 0x%x\n", xRot, yRot, &yRot); @@ -175,8 +175,8 @@ void Arrow::tick() { if (xRotO == 0 && yRotO == 0) { double sd = sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, sd) * 180 / M_PI); } { @@ -401,8 +401,8 @@ void Arrow::tick() { z += zd; double sd = sqrt(xd * xd + zd * zd); - yRot = (float)(atan2(xd, zd) * 180 / PI); - xRot = (float)(atan2(yd, sd) * 180 / PI); + yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRot = (float)(atan2(yd, sd) * 180 / M_PI); while (xRot - xRotO < -180) xRotO -= 360; while (xRot - xRotO >= 180) xRotO += 360; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp index c68dfc4d0..e1f71bbf4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/DragonFireball.cpp @@ -4,7 +4,7 @@ #include "../../damageSource/net.minecraft.world.damagesource.h" #include "../../level/tile/net.minecraft.world.level.tile.h" #include "../../level/net.minecraft.world.level.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "DragonFireball.h" const double DragonFireball::SPLASH_RANGE = 4.0; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp index ac3e384ef..381b078be 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/EyeOfEnderSignal.cpp @@ -5,7 +5,7 @@ #include "../../item/net.minecraft.world.item.h" #include "../item/net.minecraft.world.entity.item.h" #include "../../../SharedConstants.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "EyeOfEnderSignal.h" void EyeOfEnderSignal::_init() { @@ -68,8 +68,8 @@ void EyeOfEnderSignal::lerpMotion(double xd, double yd, double zd) { this->zd = zd; if (xRotO == 0 && yRotO == 0) { float sd = (float)sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, (double)sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, (double)sd) * 180 / M_PI); } } @@ -84,8 +84,8 @@ void EyeOfEnderSignal::tick() { z += zd; float sd = (float)sqrt(xd * xd + zd * zd); - yRot = (float)(atan2(xd, zd) * 180 / PI); - xRot = (float)(atan2(yd, (double)sd) * 180 / PI); + yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRot = (float)(atan2(yd, (double)sd) * 180 / M_PI); while (xRot - xRotO < -180) xRotO -= 360; while (xRot - xRotO >= 180) xRotO += 360; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp index 0797e0d8f..90ec0240a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp @@ -5,7 +5,7 @@ #include "../../phys/net.minecraft.world.phys.h" #include "../../item/net.minecraft.world.item.h" #include "../../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Fireball.h" #include "../../level/dimension/net.minecraft.world.level.dimension.h" #include "../../../SharedConstants.h" @@ -215,8 +215,8 @@ void Fireball::tick() { z += zd; double sd = sqrt(xd * xd + zd * zd); - yRot = (float)(atan2(zd, xd) * 180 / PI) + 90; - xRot = (float)(atan2(sd, yd) * 180 / PI) - 90; + yRot = (float)(atan2(zd, xd) * 180 / M_PI) + 90; + xRot = (float)(atan2(sd, yd) * 180 / M_PI) - 90; while (xRot - xRotO < -180) xRotO -= 360; while (xRot - xRotO >= 180) xRotO += 360; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp index f0df394b1..33d6b92d2 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FireworksRocketEntity.cpp @@ -57,8 +57,8 @@ void FireworksRocketEntity::lerpMotion(double xd, double yd, double zd) { zd = zd; if (xRotO == 0 && yRotO == 0) { double sd = Mth::sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, sd) * 180 / M_PI); } } @@ -74,8 +74,8 @@ void FireworksRocketEntity::tick() { move(xd, yd, zd); double sd = Mth::sqrt(xd * xd + zd * zd); - yRot = (float)(atan2(xd, zd) * 180 / PI); - xRot = (float)(atan2(yd, sd) * 180 / PI); + yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRot = (float)(atan2(yd, sd) * 180 / M_PI); while (xRot - xRotO < -180) xRotO -= 360; while (xRot - xRotO >= 180) xRotO += 360; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp index e9923c3b9..2d500c14c 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/FishingHook.cpp @@ -8,7 +8,7 @@ #include "../item/net.minecraft.world.entity.item.h" #include "../net.minecraft.world.entity.h" #include "../../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "FishingHook.h" #include "../../../../../Header Files/SoundTypes.h" @@ -71,16 +71,16 @@ FishingHook::FishingHook(Level* level, std::shared_ptr mob) moveTo(mob->x, mob->y + 1.62 - mob->heightOffset, mob->z, mob->yRot, mob->xRot); - x -= Mth::cos(yRot / 180 * PI) * 0.16f; + x -= Mth::cos(yRot / 180 * M_PI) * 0.16f; y -= 0.1f; - z -= Mth::sin(yRot / 180 * PI) * 0.16f; + z -= Mth::sin(yRot / 180 * M_PI) * 0.16f; setPos(x, y, z); heightOffset = 0; float speed = 0.4f; - xd = (-Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI)) * speed; - zd = (Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI)) * speed; - yd = (-Mth::sin(xRot / 180 * PI)) * speed; + xd = (-Mth::sin(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI)) * speed; + zd = (Mth::cos(yRot / 180 * M_PI) * Mth::cos(xRot / 180 * M_PI)) * speed; + yd = (-Mth::sin(xRot / 180 * M_PI)) * speed; shoot(xd, yd, zd, 1.5f, 1); } @@ -115,8 +115,8 @@ void FishingHook::shoot(double xd, double yd, double zd, float pow, double sd = sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, sd) * 180 / M_PI); life = 0; } @@ -263,8 +263,8 @@ void FishingHook::tick() { move(xd, yd, zd); double sd = sqrt(xd * xd + zd * zd); - yRot = (float)(atan2(xd, zd) * 180 / PI); - xRot = (float)(atan2(yd, sd) * 180 / PI); + yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRot = (float)(atan2(yd, sd) * 180 / M_PI); while (xRot - xRotO < -180) xRotO -= 360; while (xRot - xRotO >= 180) xRotO += 360; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp index dd297c91f..7f59dcdb4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Throwable.cpp @@ -3,7 +3,7 @@ #include "../net.minecraft.world.entity.h" #include "../../level/net.minecraft.world.level.h" #include "../../level/tile/net.minecraft.world.level.tile.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "Throwable.h" void Throwable::_throwableInit() { @@ -41,16 +41,16 @@ Throwable::Throwable(Level* level, std::shared_ptr mob) moveTo(mob->x, mob->y + mob->getHeadHeight(), mob->z, mob->yRot, mob->xRot); - x -= cos(yRot / 180 * PI) * 0.16f; + x -= cos(yRot / 180 * M_PI) * 0.16f; y -= 0.1f; - z -= sin(yRot / 180 * PI) * 0.16f; + z -= sin(yRot / 180 * M_PI) * 0.16f; setPos(x, y, z); heightOffset = 0; float speed = 0.4f; - xd = (-sin(yRot / 180 * PI) * cos(xRot / 180 * PI)) * speed; - zd = (cos(yRot / 180 * PI) * cos(xRot / 180 * PI)) * speed; - yd = (-sin((xRot + getThrowUpAngleOffset()) / 180 * PI)) * speed; + xd = (-sin(yRot / 180 * M_PI) * cos(xRot / 180 * M_PI)) * speed; + zd = (cos(yRot / 180 * M_PI) * cos(xRot / 180 * M_PI)) * speed; + yd = (-sin((xRot + getThrowUpAngleOffset()) / 180 * M_PI)) * speed; shoot(xd, yd, zd, getThrowPower(), 1); } @@ -92,8 +92,8 @@ void Throwable::shoot(double xd, double yd, double zd, float pow, float sd = (float)sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, (double)sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, (double)sd) * 180 / M_PI); life = 0; } @@ -103,8 +103,8 @@ void Throwable::lerpMotion(double xd, double yd, double zd) { this->zd = zd; if (xRotO == 0 && yRotO == 0) { float sd = (float)sqrt(xd * xd + zd * zd); - yRotO = yRot = (float)(atan2(xd, zd) * 180 / PI); - xRotO = xRot = (float)(atan2(yd, (double)sd) * 180 / PI); + yRotO = yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRotO = xRot = (float)(atan2(yd, (double)sd) * 180 / M_PI); } } @@ -189,8 +189,8 @@ void Throwable::tick() { z += zd; float sd = (float)sqrt(xd * xd + zd * zd); - yRot = (float)(atan2(xd, zd) * 180 / PI); - xRot = (float)(atan2(yd, (double)sd) * 180 / PI); + yRot = (float)(atan2(xd, zd) * 180 / M_PI); + xRot = (float)(atan2(yd, (double)sd) * 180 / M_PI); while (xRot - xRotO < -180) xRotO -= 360; while (xRot - xRotO >= 180) xRotO += 360; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp index 99f7596f1..b3c298dcc 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownEgg.cpp @@ -3,7 +3,7 @@ #include "../../phys/net.minecraft.world.phys.h" #include "../animal/net.minecraft.world.entity.animal.h" #include "../../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "ThrownEgg.h" #include "../MobCategory.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp index 2d1d57240..7efd8537e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownExpBottle.cpp @@ -2,7 +2,7 @@ #include "../net.minecraft.world.entity.h" #include "../../level/net.minecraft.world.level.h" #include "../../level/tile/net.minecraft.world.level.tile.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "ThrownExpBottle.h" ThrownExpBottle::ThrownExpBottle(Level* level) : Throwable(level) {} diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp index ad6826707..f2f4df693 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/ThrownPotion.cpp @@ -5,7 +5,7 @@ #include "../../item/net.minecraft.world.item.h" #include "../../effect/net.minecraft.world.effect.h" #include "../../../SharedConstants.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "ThrownPotion.h" const double ThrownPotion::SPLASH_RANGE = 4.0; diff --git a/minecraft/Minecraft.World/net/minecraft/world/food/FoodData.cpp b/minecraft/Minecraft.World/net/minecraft/world/food/FoodData.cpp index 0138bbdd6..15b1b0c4d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/food/FoodData.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/food/FoodData.cpp @@ -4,7 +4,7 @@ #include "../level/net.minecraft.world.level.h" #include "../net.minecraft.world.h" #include "../damageSource/net.minecraft.world.damagesource.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "FoodConstants.h" #include "FoodData.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp b/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp index bfac470be..49648b898 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.cpp @@ -501,7 +501,7 @@ void AbstractContainerMenu::setItem(unsigned int slot, getSlot(slot)->set(item); } -void AbstractContainerMenu::setAll(ItemInstanceArray* items) { +void AbstractContainerMenu::setAll(arrayWithLength>* items) { for (unsigned int i = 0; i < items->length; i++) { getSlot(i)->set((*items)[i]); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h b/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h index 4bfb690c5..7fd0b48bc 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/AbstractContainerMenu.h @@ -90,7 +90,7 @@ public: // but wasn't using it, so removed to simplify things bool isPauseScreen(); void setItem(unsigned int slot, std::shared_ptr item); - void setAll(ItemInstanceArray* items); + void setAll(arrayWithLength>* items); virtual void setData(int id, int value); short backup(std::shared_ptr inventory); diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp b/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp index 8420a20ac..1de581167 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.cpp @@ -9,7 +9,7 @@ CraftingContainer::~CraftingContainer() {} CraftingContainer::CraftingContainer(AbstractContainerMenu* menu, unsigned int w, unsigned int h) { unsigned int size = w * h; - items = new ItemInstanceArray(size); + items = new arrayWithLength>(size); this->menu = menu; this->width = w; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h b/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h index cf5f04238..911e8dbd8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h @@ -6,7 +6,7 @@ class AbstractContainerMenu; class CraftingContainer : public Container { private: - ItemInstanceArray* items; + arrayWithLength>* items; unsigned int width; AbstractContainerMenu* menu; diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h b/minecraft/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h index 6f95b6467..04e7b4fe4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/EnchantmentMenu.h @@ -1,6 +1,6 @@ #pragma once #include "AbstractContainerMenu.h" -#include "../../../../ConsoleJavaLibs/Random.h" +#include "java/Random.h" class EnchantmentMenu : public AbstractContainerMenu { // 4J Stu Made these public for UI menus, perhaps should make friend class? diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp b/minecraft/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp index 359fbfdd7..23648c429 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/FurnaceResultSlot.cpp @@ -5,7 +5,7 @@ #include "../item/crafting/net.minecraft.world.item.crafting.h" #include "../level/net.minecraft.world.level.h" #include "../item/net.minecraft.world.item.h" -#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "FurnaceResultSlot.h" FurnaceResultSlot::FurnaceResultSlot(std::shared_ptr player, diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp b/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp index da4739832..1c4a0e60a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.cpp @@ -7,15 +7,15 @@ MenuBackup::MenuBackup(std::shared_ptr inventory, AbstractContainerMenu* menu) { - backups = new std::unordered_map(); + backups = new std::unordered_map>*>(); this->inventory = inventory; this->menu = menu; } void MenuBackup::save(short changeUid) { - ItemInstanceArray* backup = - new ItemInstanceArray((int)menu->slots.size() + 1); + arrayWithLength>* backup = + new arrayWithLength>((int)menu->slots.size() + 1); (*backup)[0] = ItemInstance::clone(inventory->getCarried()); for (unsigned int i = 0; i < menu->slots.size(); i++) { (*backup)[i + 1] = ItemInstance::clone(menu->slots.at(i)->getItem()); @@ -33,7 +33,7 @@ void MenuBackup::deleteBackup(short changeUid) { } void MenuBackup::rollback(short changeUid) { - ItemInstanceArray* backup = backups->at(changeUid); + arrayWithLength>* backup = backups->at(changeUid); backups->clear(); inventory->setCarried((*backup)[0]); for (unsigned int i = 0; i < menu->slots.size(); i++) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.h b/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.h index e2f4ea083..36dfa4fd0 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.h +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/MenuBackup.h @@ -5,7 +5,7 @@ class Inventory; class MenuBackup { private: - std::unordered_map* backups; + std::unordered_map>*>* backups; std::shared_ptr inventory; AbstractContainerMenu* menu; diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp b/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp index 813ef8309..8d26e501a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.cpp @@ -7,7 +7,7 @@ MerchantContainer::MerchantContainer(std::shared_ptr player, std::shared_ptr villager) { this->player = player; merchant = villager; - items = ItemInstanceArray(3); + items = arrayWithLength>(3); items[0] = nullptr; items[1] = nullptr; items[2] = nullptr; diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h b/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h index 48088e32c..63c8f5150 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/MerchantContainer.h @@ -10,7 +10,7 @@ class MerchantRecipe; class MerchantContainer : public Container { private: std::shared_ptr merchant; - ItemInstanceArray items; + arrayWithLength> items; std::shared_ptr player; MerchantRecipe* activeRecipe; int selectionHint; diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/ArmorItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/ArmorItem.cpp index 1d10e615c..e96d3bb6f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/ArmorItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/ArmorItem.cpp @@ -6,7 +6,7 @@ #include "../entity/net.minecraft.world.entity.h" #include "../phys/net.minecraft.world.phys.h" #include "../level/net.minecraft.world.level.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "ArmorItem.h" const int ArmorItem::healthPerSlot[] = {11, 16, 15, 13}; diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/BoatItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/BoatItem.cpp index deefca47f..1bb02698e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/BoatItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/BoatItem.cpp @@ -27,8 +27,8 @@ bool BoatItem::TestUse(std::shared_ptr itemInstance, Level* level, Vec3 from(x, y, z); - float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - PI); - float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - PI); + float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - M_PI); + float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - M_PI); float xCos = -Mth::cos(-xRot * Mth::RAD_TO_GRAD); float xSin = Mth::sin(-xRot * Mth::RAD_TO_GRAD); @@ -64,8 +64,8 @@ std::shared_ptr BoatItem::use( Vec3 from(x, y, z); - float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - PI); - float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - PI); + float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - M_PI); + float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - M_PI); float xCos = -Mth::cos(-xRot * Mth::RAD_TO_GRAD); float xSin = Mth::sin(-xRot * Mth::RAD_TO_GRAD); diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/BucketItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/BucketItem.cpp index 9a3d5ae0c..e28b23e3f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/BucketItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/BucketItem.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../entity/player/net.minecraft.world.entity.player.h" #include "../level/net.minecraft.world.level.h" #include "../level/dimension/net.minecraft.world.level.dimension.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp index acaab9123..f485122b3 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/DyePowderItem.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../level/tile/net.minecraft.world.level.tile.h" #include "../phys/net.minecraft.world.phys.h" #include "../level/net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/EggItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/EggItem.cpp index 32dcfa714..5c92b5601 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/EggItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/EggItem.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../level/tile/net.minecraft.world.level.tile.h" #include "../phys/net.minecraft.world.phys.h" #include "../level/net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/Item.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/Item.cpp index 3c6105e62..e88a66b98 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/Item.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/Item.cpp @@ -1607,8 +1607,8 @@ HitResult* Item::getPlayerPOVHitResult(Level* level, Vec3 from(x, y, z); - float yCos = (float)cos(-yRot * Mth::RAD_TO_GRAD - PI); - float ySin = (float)sin(-yRot * Mth::RAD_TO_GRAD - PI); + float yCos = (float)cos(-yRot * Mth::RAD_TO_GRAD - M_PI); + float ySin = (float)sin(-yRot * Mth::RAD_TO_GRAD - M_PI); float xCos = (float)-cos(-xRot * Mth::RAD_TO_GRAD); float xSin = (float)sin(-xRot * Mth::RAD_TO_GRAD); diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.cpp index 176de30cd..6b9c815a4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.cpp @@ -1,5 +1,5 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../locale/net.minecraft.locale.h" #include "../../stats/net.minecraft.stats.h" #include "../entity/net.minecraft.world.entity.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.h b/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.h index 43bee3f35..4e145f1cb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.h +++ b/minecraft/Minecraft.World/net/minecraft/world/item/ItemInstance.h @@ -1,7 +1,7 @@ #pragma once #include "UseAnim.h" -#include "../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../entity/ai/attributes/Attribute.h" class Entity; diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp index e6a384c81..bbb158e12 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp @@ -12,7 +12,7 @@ #include "net.minecraft.world.item.h" #include "MapItem.h" #include "../inventory/net.minecraft.world.inventory.h" -#include "../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" MapItem::MapItem(int id) : ComplexItem(id) { setStackedByData(true); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/PotionItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/PotionItem.cpp index 773dd18aa..df82721c4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/PotionItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/PotionItem.cpp @@ -385,9 +385,7 @@ std::vector >* PotionItem::getUniquePotionValues() { if (effects != nullptr) { if (!effects->empty()) { // 4J Stu - Based on implementation of Java List.hashCode() - // at - // http://docs.oracle.com/javase/6/docs/api/java/util/List.html#hashCode() - // and adding deleting to clear up as we go + // at hashCode() and adding deleting to clear up as we go int effectsHashCode = 1; for (auto it = effects->begin(); it != effects->end(); ++it) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp index a6621b496..ecff78112 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/alchemy/PotionBrewing.cpp @@ -1,7 +1,7 @@ #include "../../../../../Header Files/stdafx.h" #include "Minecraft.Client/net/minecraft/client/Minecraft.h" #include "../../effect/net.minecraft.world.effect.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../SharedConstants.h" #include "PotionBrewing.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp index bd84abde0..f0c869513 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/crafting/Recipes.cpp @@ -22,7 +22,7 @@ void Recipes::staticCtor() { Recipes::instance = new Recipes(); } void Recipes::_init() { // 4J Jev: instance = new Recipes(); - recipies = new RecipyList(); + recipies = new std::vector(); } Recipes::Recipes() { @@ -1178,7 +1178,7 @@ std::shared_ptr Recipes::getItemForRecipe(Recipy* r) { // 4J-PB - build the required ingredients for recipes void Recipes::buildRecipeIngredientsArray(void) { - // RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); + // std::vector *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); int iRecipeC = (int)recipies->size(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp index e7a75f8d9..042007161 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.cpp @@ -86,7 +86,7 @@ void EnchantmentHelper::setEnchantments( } int EnchantmentHelper::getEnchantmentLevel(int enchantmentId, - ItemInstanceArray inventory) { + arrayWithLength> inventory) { if (inventory.data == nullptr) return 0; int bestLevel = 0; // for (ItemInstance piece : inventory) @@ -121,7 +121,7 @@ void EnchantmentHelper::runIterationOnItem( } void EnchantmentHelper::runIterationOnInventory( - EnchantmentIterationMethod& method, ItemInstanceArray inventory) { + EnchantmentIterationMethod& method, arrayWithLength> inventory) { // for (ItemInstance piece : inventory) for (unsigned int i = 0; i < inventory.length; ++i) { runIterationOnItem(method, inventory[i]); @@ -143,7 +143,7 @@ EnchantmentHelper::GetDamageProtectionIteration * @param source * @return */ -int EnchantmentHelper::getDamageProtection(ItemInstanceArray armor, +int EnchantmentHelper::getDamageProtection(arrayWithLength> armor, DamageSource* source) { getDamageProtectionIteration.sum = 0; getDamageProtectionIteration.source = source; @@ -239,7 +239,7 @@ int EnchantmentHelper::getArmorThorns(std::shared_ptr source) { std::shared_ptr EnchantmentHelper::getRandomItemWith( Enchantment* enchantment, std::shared_ptr source) { - ItemInstanceArray items = source->getEquipmentSlots(); + arrayWithLength> items = source->getEquipmentSlots(); for (unsigned int i = 0; i < items.length; ++i) { std::shared_ptr item = items[i]; if (item != nullptr && getEnchantmentLevel(enchantment->id, item) > 0) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.h b/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.h index d7fe02a73..97588932d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.h +++ b/minecraft/Minecraft.World/net/minecraft/world/item/enchantment/EnchantmentHelper.h @@ -19,7 +19,7 @@ public: std::shared_ptr item); static int getEnchantmentLevel(int enchantmentId, - ItemInstanceArray inventory); + arrayWithLength> inventory); private: class EnchantmentIterationMethod { @@ -30,7 +30,7 @@ private: static void runIterationOnItem(EnchantmentIterationMethod& method, std::shared_ptr piece); static void runIterationOnInventory(EnchantmentIterationMethod& method, - ItemInstanceArray inventory); + arrayWithLength> inventory); class GetDamageProtectionIteration : public EnchantmentIterationMethod { public: @@ -50,7 +50,7 @@ private: * @return */ public: - static int getDamageProtection(ItemInstanceArray armor, + static int getDamageProtection(arrayWithLength> armor, DamageSource* source); private: diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp index 84a229e8f..5ff706c9f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp @@ -1,6 +1,6 @@ #include "../../../../Header Files/stdafx.h" -#include "../../../../ConsoleJavaLibs/System.h" -#include "../../../../ConsoleJavaLibs/File.h" +#include "java/System.h" +#include "java/File.h" #include "../../util/ProgressListener.h" #include "../../net.minecraft.h" #include "../net.minecraft.world.h" @@ -1726,7 +1726,7 @@ void Level::removeListener(LevelListener* listener) { } // 4J - added noEntities and blockAtEdge parameter -AABBList* Level::getCubes(std::shared_ptr source, AABB* box, +std::vector* Level::getCubes(std::shared_ptr source, AABB* box, bool noEntities /* = false*/, bool blockAtEdge /* = false*/) { boxes.clear(); @@ -1814,7 +1814,7 @@ AABBList* Level::getCubes(std::shared_ptr source, AABB* box, // 4J Stu - Brought forward from 12w36 to fix #46282 - TU5: Gameplay: Exiting // the minecart in a tight corridor damages the player -AABBList* Level::getTileCubes(AABB* box, bool blockAtEdge /* = false */) { +std::vector* Level::getTileCubes(AABB* box, bool blockAtEdge /* = false */) { return getCubes(nullptr, box, true, blockAtEdge); // boxes.clear(); // int x0 = Mth::floor(box->x0); @@ -1851,7 +1851,7 @@ AABBList* Level::getTileCubes(AABB* box, bool blockAtEdge /* = false */) { int Level::getOldSkyDarken(float a) { float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * PI * 2) * 2 + 0.5f); + float br = 1 - (Mth::cos(td * M_PI * 2) * 2 + 0.5f); if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; @@ -1867,7 +1867,7 @@ int Level::getOldSkyDarken(float a) { float Level::getSkyDarken(float a) { float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * PI * 2) * 2 + 0.2f); + float br = 1 - (Mth::cos(td * M_PI * 2) * 2 + 0.2f); if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; @@ -1883,7 +1883,7 @@ float Level::getSkyDarken(float a) { Vec3 Level::getSkyColor(std::shared_ptr source, float a) { float td = getTimeOfDay(a); - float br = Mth::cos(td * PI * 2) * 2 + 0.5f; + float br = Mth::cos(td * M_PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; @@ -1956,13 +1956,13 @@ float Level::getMoonBrightness() { float Level::getSunAngle(float a) { float td = getTimeOfDay(a); - return td * PI * 2; + return td * M_PI * 2; } Vec3 Level::getCloudColor(float a) { float td = getTimeOfDay(a); - float br = Mth::cos(td * PI * 2) * 2.0f + 0.5f; + float br = Mth::cos(td * M_PI * 2) * 2.0f + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; @@ -2048,7 +2048,7 @@ int Level::getLightDepth(int x, int z) { float Level::getStarBrightness(float a) { float td = getTimeOfDay(a); - float br = 1 - (Mth::cos(td * PI * 2) * 2 + 0.25f); + float br = 1 - (Mth::cos(td * M_PI * 2) * 2 + 0.25f); if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/Level.h b/minecraft/Minecraft.World/net/minecraft/world/level/Level.h index 4d069d31b..f52c6b870 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/Level.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/Level.h @@ -351,14 +351,14 @@ public: void removeListener(LevelListener* listener); private: - AABBList boxes; + std::vector boxes; public: - AABBList* getCubes( + std::vector* getCubes( std::shared_ptr source, AABB* box, bool noEntities = false, bool blockAtEdge = false); // 4J: Added noEntities & blockAtEdge parameters - AABBList* getTileCubes( + std::vector* getTileCubes( AABB* box, bool blockAtEdge = false); // 4J: Added noEntities & blockAtEdge parameters int getOldSkyDarken(float a); // 4J - change brought forward from 1.8.2 diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/LevelConflictException.h b/minecraft/Minecraft.World/net/minecraft/world/level/LevelConflictException.h index c063def27..be09b5c9f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/LevelConflictException.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/LevelConflictException.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../../ConsoleJavaLibs/Exceptions.h" +#include "java/Exceptions.h" class LevelConflictException : public RuntimeException { private: diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/Biome.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/Biome.cpp index a9fde72f8..cbd7c8a9e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/Biome.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/Biome.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/Color.h" +#include "java/Color.h" #include "Minecraft.Client/net/minecraft/client/Minecraft.h" #include "../levelgen/feature/net.minecraft.world.level.levelgen.feature.h" #include "../tile/net.minecraft.world.level.tile.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp index a32bbdaaa..84be648be 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp @@ -3,7 +3,7 @@ #include "Biome.h" #include "BiomeSource.h" #include "BiomeCache.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" BiomeCache::Block::Block(int x, int z, BiomeCache* parent) { // temps = floatArray(ZONE_SIZE * ZONE_SIZE, false); // MGH - diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h index f3a2f5b4c..cbf046c69 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../../../../../ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class BiomeCache { private: diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp index eaad3aff6..5561e5ed7 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp @@ -3,7 +3,7 @@ #include "../storage/net.minecraft.world.level.storage.h" #include "net.minecraft.world.level.biome.h" #include "../newbiome/layer/net.minecraft.world.level.newbiome.layer.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "BiomeSource.h" #include "Minecraft.Client/net/minecraft/client/Minecraft.h" #include "Minecraft.Client/net/minecraft/client/ProgressRenderer.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp index 74c8b057e..98ef08534 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/Arrays.h" +#include "java/Arrays.h" #include "FixedBiomeSource.h" FixedBiomeSource::FixedBiomeSource(Biome* fixed, float temperature, diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp index 86c7483b1..acb5cc4d1 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/TheEndBiomeDecorator.cpp @@ -8,8 +8,8 @@ // Spike centre positions, calculated using // for(int i=0;i<8;i++) // { -// int x=40 * Mth::cos(2*(-PI+(PI/8)*i)); -// int z=40* Mth::sin(2*(-PI+(PI/8)*i)); +// int x=40 * Mth::cos(2*(-M_PI +(PI/8)*i)); +// int z=40* Mth::sin(2*(-M_PI +(PI/8)*i)); // } TheEndBiomeDecorator::SPIKE TheEndBiomeDecorator::SpikeValA[8] = { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp index 4704acf13..519f2cee7 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/EmptyLevelChunk.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/Arrays.h" +#include "java/Arrays.h" #include "../net.minecraft.world.level.h" #include "../../phys/net.minecraft.world.phys.h" #include "EmptyLevelChunk.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp index 2941933af..e46b0c1e0 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "../../entity/net.minecraft.world.entity.h" #include "../net.minecraft.world.level.h" #include "../dimension/net.minecraft.world.level.dimension.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp index 31f58748a..81bf47386 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/WaterLevelChunk.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/Arrays.h" +#include "java/Arrays.h" #include "../net.minecraft.world.level.h" #include "../../phys/net.minecraft.world.phys.h" #include "WaterLevelChunk.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp index aea3a296c..3d2b520f8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ChunkStorageProfileDecorator.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "ChunkStorageProfileDecorator.h" ChunkStorageProfilerDecorator::ChunkStorageProfilerDecorator( diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h index de8002814..cbecdfa93 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.h @@ -5,7 +5,7 @@ #include "ChunkStorage.h" #include "../LevelChunk.h" #include "RegionFileCache.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "OldChunkStorage.h" class ConsoleSaveFile; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp index fbf26d18a..6b60cbb67 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "NbtSlotFile.h" namespace { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h index a2f2413b6..5abb42b74 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/NbtSlotFile.h @@ -1,9 +1,9 @@ #pragma once #include -#include "../../../../../../com/mojang/nbt/CompoundTag.h" +#include "nbt/CompoundTag.h" #include "ZonedChunkStorage.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" class NbtSlotFile { private: diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp index d3fad50ea..73eb75872 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.cpp @@ -1,7 +1,7 @@ #include "../../../../../../Header Files/stdafx.h" #include -#include "../../../../../../ConsoleJavaLibs/File.h" -#include "../../../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/File.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "../../../entity/net.minecraft.world.entity.h" #include "../../net.minecraft.world.level.h" #include "../net.minecraft.world.level.chunk.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h index 67d19e2c1..d11a948bd 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h @@ -1,9 +1,9 @@ #pragma once #include "ChunkStorage.h" #include "../LevelChunk.h" -#include "../../../../../../ConsoleJavaLibs/File.h" -#include "../../../../../../com/mojang/nbt/CompoundTag.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "java/File.h" +#include "nbt/CompoundTag.h" +#include "nbt/com.mojang.nbt.h" #include class Level; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp index da27e6071..288f3cf5e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp @@ -1,7 +1,7 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/System.h" -#include "../../../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" -#include "../../../../../../ConsoleJavaLibs/File.h" +#include "java/System.h" +#include "java/InputOutputStream/InputOutputStream.h" +#include "java/File.h" #include "RegionFile.h" #include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h index 619326b34..2308ecb3f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h @@ -1,6 +1,6 @@ #pragma once #include "../../../../../../Header Files/compression.h" -#include "../../../../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" class FileEntry; class ConsoleSaveFile; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp index c9fbda872..c5b9c784a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "RegionFileCache.h" #include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h index 804667bc0..ab83e6d05 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h @@ -1,7 +1,7 @@ #pragma once #include "RegionFile.h" -#include "../../../../../../ConsoleJavaLibs/Reference.h" -#include "../../../../../../ConsoleJavaLibs/File.h" +#include "java/Reference.h" +#include "java/File.h" class RegionFileCache { friend class ConsoleSaveFileOriginal; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp index d64964314..76387eceb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneFile.cpp @@ -1,6 +1,6 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/ByteBuffer.h" -#include "../../../../../../ConsoleJavaLibs/File.h" +#include "java/ByteBuffer.h" +#include "java/File.h" #include "ZoneFile.h" namespace { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp index 6559faff4..d987dc868 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZoneIo.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/ByteBuffer.h" +#include "java/ByteBuffer.h" #include "ZoneIo.h" namespace { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp index 230d472f7..fe6e4863f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.cpp @@ -1,7 +1,7 @@ #include "../../../../../../Header Files/stdafx.h" #include -#include "../../../../../../ConsoleJavaLibs/File.h" -#include "../../../../../../ConsoleJavaLibs/ByteBuffer.h" +#include "java/File.h" +#include "java/ByteBuffer.h" #include "../../../entity/net.minecraft.world.entity.h" #include "../../net.minecraft.world.level.h" #include "../../tile/entity/net.minecraft.world.level.tile.entity.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h index b928af665..a9529ca81 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/ZonedChunkStorage.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "ChunkStorage.h" #include "../LevelChunk.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp index d2e56fc96..e814e48f5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/dimension/Dimension.cpp @@ -115,7 +115,7 @@ float Dimension::getTimeOfDay(int64_t time, float a) const { if (td < 0) td += 1; if (td > 1) td -= 1; float tdo = td; - td = 1 - (float)((cos(td * PI) + 1) / 2); + td = 1 - (float)((cos(td * M_PI) + 1) / 2); td = tdo + (td - tdo) / 3.0f; return td; } @@ -138,11 +138,11 @@ float* Dimension::getSunriseColor(float td, float a) { g2 = ((clr2 >> 8) & 0xFF) / 255.0, b2 = (clr2 & 0xFF) / 255.0; float span = 0.4f; - float tt = Mth::cos(td * PI * 2) - 0.0f; + float tt = Mth::cos(td * M_PI * 2) - 0.0f; float mid = -0.0f; if (tt >= mid - span && tt <= mid + span) { float aa = ((tt - mid) / span) * 0.5f + 0.5f; - float mix = 1 - (((1 - sin(aa * PI))) * 0.99f); + float mix = 1 - (((1 - sin(aa * M_PI))) * 0.99f); mix = mix * mix; // sunriseCol[0] = (aa * 0.3f + 0.7f); // sunriseCol[1] = (aa * aa * 0.7f + 0.2f); @@ -158,7 +158,7 @@ float* Dimension::getSunriseColor(float td, float a) { } Vec3 Dimension::getFogColor(float td, float a) const { - float br = Mth::cos(td * PI * 2) * 2 + 0.5f; + float br = Mth::cos(td * M_PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp index 083e5d6b2..295675fb8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/dimension/TheEndDimension.cpp @@ -26,7 +26,7 @@ float* TheEndDimension::getSunriseColor(float td, float a) { return nullptr; } Vec3 TheEndDimension::getFogColor(float td, float a) const { int fogColor = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_End_Fog_Colour); // 0xa080a0; - float br = Mth::cos(td * PI * 2) * 2 + 0.5f; + float br = Mth::cos(td * M_PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp index ca1e67af2..243bc3033 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp @@ -39,7 +39,7 @@ void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, } for (; step < dist; step++) { - double rad = 1.5 + (Mth::sin(step * PI / dist) * thickness) * 1; + double rad = 1.5 + (Mth::sin(step * M_PI / dist) * thickness) * 1; double yRad = rad * yScale; rad *= (random->nextFloat() * 0.25 + 0.75); @@ -167,7 +167,7 @@ void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs, int tunnels = 1; for (int i = 0; i < tunnels; i++) { - float yRot = random->nextFloat() * PI * 2; + float yRot = random->nextFloat() * M_PI * 2; float xRot = ((random->nextFloat() - 0.5f) * 2) / 8; float thickness = (random->nextFloat() * 2 + random->nextFloat()) * 2; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp index ce4e57587..b89454122 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/DungeonFeature.cpp @@ -35,7 +35,7 @@ void DungeonFeature::addTunnel(int xOffs, int zOffs, byteArray blocks, bool steep = random->nextInt(6) == 0; for (; step < dist; step++) { - double rad = 1.5 + (Mth::sin(step * PI / dist) * thickness) * 1; + double rad = 1.5 + (Mth::sin(step * M_PI / dist) * thickness) * 1; double yRad = rad * yScale; float xc = Mth::cos(xRot); @@ -61,10 +61,10 @@ void DungeonFeature::addTunnel(int xOffs, int zOffs, byteArray blocks, if (!singleStep && step == splitPoint && thickness > 1) { addTunnel(xOffs, zOffs, blocks, xCave, yCave, zCave, - random->nextFloat() * 0.5f + 0.5f, yRot - PI / 2, + random->nextFloat() * 0.5f + 0.5f, yRot - M_PI / 2, xRot / 3, step, dist, 1.0); addTunnel(xOffs, zOffs, blocks, xCave, yCave, zCave, - random->nextFloat() * 0.5f + 0.5f, yRot + PI / 2, + random->nextFloat() * 0.5f + 0.5f, yRot + M_PI / 2, xRot / 3, step, dist, 1.0); return; } @@ -169,7 +169,7 @@ void DungeonFeature::addFeature(Level* level, int x, int z, int xOffs, } for (int i = 0; i < tunnels; i++) { - float yRot = random->nextFloat() * PI * 2; + float yRot = random->nextFloat() * M_PI * 2; float xRot = ((random->nextFloat() - 0.5f) * 2) / 8; float thickness = random->nextFloat() * 2 + random->nextFloat(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp index 9e318477d..be1884c7f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp @@ -351,7 +351,7 @@ doubleArray HellRandomLevelSource::getHeights(doubleArray buffer, int x, int y, int pp = 0; doubleArray yoffs = doubleArray(ySize); for (int yy = 0; yy < ySize; yy++) { - yoffs[yy] = cos(yy * PI * 6 / (double)ySize) * 2; + yoffs[yy] = cos(yy * M_PI * 6 / (double)ySize) * 2; double dd = yy; if (yy > ySize / 2) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp index 5b3edaa38..b04a7e263 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeCaveFeature.cpp @@ -38,7 +38,7 @@ void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, bool steep = random.nextInt(6) == 0; for (; step < dist; step++) { - double rad = 1.5 + (Mth::sin(step * PI / dist) * thickness) * 1; + double rad = 1.5 + (Mth::sin(step * M_PI / dist) * thickness) * 1; double yRad = rad * yScale; float xc = Mth::cos(xRot); @@ -64,10 +64,10 @@ void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, if (!singleStep && step == splitPoint && thickness > 1 && dist > 0) { addTunnel(random.nextLong(), xOffs, zOffs, blocks, xCave, yCave, - zCave, random.nextFloat() * 0.5f + 0.5f, yRot - PI / 2, + zCave, random.nextFloat() * 0.5f + 0.5f, yRot - M_PI / 2, xRot / 3, step, dist, 1.0); addTunnel(random.nextLong(), xOffs, zOffs, blocks, xCave, yCave, - zCave, random.nextFloat() * 0.5f + 0.5f, yRot + PI / 2, + zCave, random.nextFloat() * 0.5f + 0.5f, yRot + M_PI / 2, xRot / 3, step, dist, 1.0); return; } @@ -180,7 +180,7 @@ void LargeCaveFeature::addFeature(Level* level, int x, int z, int xOffs, } for (int i = 0; i < tunnels; i++) { - float yRot = random->nextFloat() * PI * 2; + float yRot = random->nextFloat() * M_PI * 2; float xRot = ((random->nextFloat() - 0.5f) * 2) / 8; float thickness = random->nextFloat() * 2 + random->nextFloat(); if (random->nextInt(10) == 0) diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp index 3fcd2f4d2..8f93e74be 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/LargeHellCaveFeature.cpp @@ -37,7 +37,7 @@ void LargeHellCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, bool steep = random.nextInt(6) == 0; for (; step < dist; step++) { - double rad = 1.5 + (Mth::sin(step * PI / dist) * thickness) * 1; + double rad = 1.5 + (Mth::sin(step * M_PI / dist) * thickness) * 1; double yRad = rad * yScale; float xc = Mth::cos(xRot); @@ -63,10 +63,10 @@ void LargeHellCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, if (!singleStep && step == splitPoint && thickness > 1) { addTunnel(random.nextLong(), xOffs, zOffs, blocks, xCave, yCave, - zCave, random.nextFloat() * 0.5f + 0.5f, yRot - PI / 2, + zCave, random.nextFloat() * 0.5f + 0.5f, yRot - M_PI / 2, xRot / 3, step, dist, 1.0); addTunnel(random.nextLong(), xOffs, zOffs, blocks, xCave, yCave, - zCave, random.nextFloat() * 0.5f + 0.5f, yRot + PI / 2, + zCave, random.nextFloat() * 0.5f + 0.5f, yRot + M_PI / 2, xRot / 3, step, dist, 1.0); return; } @@ -163,7 +163,7 @@ void LargeHellCaveFeature::addFeature(Level* level, int x, int z, int xOffs, } for (int i = 0; i < tunnels; i++) { - float yRot = random->nextFloat() * PI * 2; + float yRot = random->nextFloat() * M_PI * 2; float xRot = ((random->nextFloat() - 0.5f) * 2) / 8; float thickness = random->nextFloat() * 2 + random->nextFloat(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp index 780c22c5e..0b4b9cf1a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/CaveFeature.cpp @@ -4,7 +4,7 @@ #include "../../tile/net.minecraft.world.level.tile.h" bool CaveFeature::place(Level* level, Random* random, int x, int y, int z) { - float dir = random->nextFloat() * PI; + float dir = random->nextFloat() * M_PI; double rd = 8; double x0 = x + 8 + Mth::sin(dir) * rd; @@ -28,8 +28,8 @@ bool CaveFeature::place(Level* level, Random* random, int x, int y, int z) { double zz = z0 + (z1 - z0) * d / 16; double ss = random->nextDouble(); - double r = (Mth::sin(d / 16.0f * PI) * radius + 1) * ss + 1; - double hr = (Mth::sin(d / 16.0f * PI) * radius + 1) * ss + 1; + double r = (Mth::sin(d / 16.0f * M_PI) * radius + 1) * ss + 1; + double hr = (Mth::sin(d / 16.0f * M_PI) * radius + 1) * ss + 1; // 4J Stu Added to stop cave features generating areas previously place // by game rule generation diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp index 8e52bdfc1..8a7a7d495 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/MegaTreeFeature.cpp @@ -74,7 +74,7 @@ bool MegaTreeFeature::place(Level* level, Random* random, int x, int y, int z) { PIXBeginNamedEvent(0, "MegaTree placing branches"); int branchHeight = y + treeHeight - 2 - random->nextInt(4); while (branchHeight > y + treeHeight / 2) { - float angle = random->nextFloat() * PI * 2.0f; + float angle = random->nextFloat() * M_PI * 2.0f; int bx = x + (int)(0.5f + Mth::cos(angle) * 4.0f); int bz = z + (int)(0.5f + Mth::sin(angle) * 4.0f); placeLeaves(level, bx, bz, branchHeight, 0, random); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp index d0d50f83e..251ee4791 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/OreFeature.cpp @@ -19,7 +19,7 @@ OreFeature::OreFeature(int tile, int count, int targetTile) { bool OreFeature::place(Level* level, Random* random, int x, int y, int z) { PIXBeginNamedEvent(0, "Place Ore Feature"); - float dir = random->nextFloat() * PI; + float dir = random->nextFloat() * M_PI; double x0 = x + 8 + Mth::sin(dir) * count / 8; double x1 = x + 8 - Mth::sin(dir) * count / 8; @@ -42,8 +42,8 @@ bool OreFeature::place(Level* level, Random* random, int x, int y, int z) { int minZ = z0 - 1; double maxss = count / 16; - double maxr = (Mth::sin(PI) + 1) * maxss + 1; - double maxhr = (Mth::sin(PI) + 1) * maxss + 1; + double maxr = (Mth::sin(M_PI) + 1) * maxss + 1; + double maxhr = (Mth::sin(M_PI) + 1) * maxss + 1; int maxX = Mth::floor(x1 + maxr / 2); int maxY = Mth::floor(y1 + maxhr / 2); int maxZ = Mth::floor(z1 + maxr / 2); @@ -63,8 +63,8 @@ bool OreFeature::place(Level* level, Random* random, int x, int y, int z) { double zz = z0 + (z1 - z0) * d / count; double ss = random->nextDouble() * count / 16; - double r = (Mth::sin(d * PI / count) + 1) * ss + 1; - double hr = r; //(Mth::sin(d * PI / count) + 1) * ss + 1; + double r = (Mth::sin(d * M_PI / count) + 1) * ss + 1; + double hr = r; //(Mth::sin(d * M_PI / count) + 1) * ss + 1; double halfR = r / 2; double halfHR = halfR; // hr/2; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp index 483007727..3fdabef77 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/feature/SwampTreeFeature.cpp @@ -2,7 +2,7 @@ #include "SwampTreeFeature.h" #include "../../net.minecraft.world.level.h" #include "../../tile/net.minecraft.world.level.tile.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" bool SwampTreeFeature::place(Level* level, Random* random, int x, int y, int z) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp index 7a78a04ae..6bcffc5fe 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/BoundingBox.cpp @@ -1,7 +1,7 @@ #include "../../../../../../Header Files/stdafx.h" #include "BoundingBox.h" #include "../../../../Direction.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" BoundingBox::BoundingBox() { // 4J added initialisers diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp index 595ec0e45..aa922aa05 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftFeature.cpp @@ -1,6 +1,6 @@ #include "../../../../../../Header Files/stdafx.h" #include "net.minecraft.world.level.levelgen.structure.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../../util/Mth.h" const std::wstring MineShaftFeature::OPTION_CHANCE = L"chance"; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp index 37b947ca0..709e58bc8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp @@ -5,7 +5,7 @@ #include "../../tile/net.minecraft.world.level.tile.h" #include "../../tile/entity/net.minecraft.world.level.tile.entity.h" #include "../../../item/net.minecraft.world.item.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../../util/WeighedTreasure.h" #include "MineShaftPieces.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp index fe3ac136c..cf0639a8f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/SkyIslandDimension.cpp @@ -24,7 +24,7 @@ float* SkyIslandDimension::getSunriseColor(float td, float a) { Vec3 SkyIslandDimension::getFogColor(float td, float a) const { int fogColor = 0x8080a0; - float br = Mth::cos(td * PI * 2) * 2 + 0.5f; + float br = Mth::cos(td * M_PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp index 23060c63d..ec14668d4 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp @@ -6,7 +6,7 @@ #include "../../dimension/net.minecraft.world.level.dimension.h" #include "../../../../util/Mth.h" #include "../../../../../../ConsoleHelpers/ConsoleSaveFileIO/FileHeader.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" const std::wstring StrongholdFeature::OPTION_DISTANCE = L"distance"; const std::wstring StrongholdFeature::OPTION_COUNT = L"count"; @@ -76,7 +76,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z, bool bIsSuperflat) { Random random; random.setSeed(level->getSeed()); - double angle = random.nextDouble() * PI * 2.0; + double angle = random.nextDouble() * M_PI * 2.0; int circle = 1; // 4J Stu - Changed so that we keep trying more until we have found @@ -158,7 +158,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z, bool bIsSuperflat) { delete strongholdPos[i]; strongholdPos[i] = new ChunkPos(selectedX, selectedZ); - angle += PI * 2.0 / (double)strongholdPos_length; + angle += M_PI * 2.0 / (double)strongholdPos_length; } // 4J Stu - We want to make sure that we have at least one @@ -167,7 +167,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z, bool bIsSuperflat) { // 4J Stu - Randomise the angles for retries as well #ifdef _LARGE_WORLDS - angle = random.nextDouble() * PI * 2.0 * circle / (double)spread; + angle = random.nextDouble() * M_PI * 2.0 * circle / (double)spread; #endif } while (!hasFoundValidPos && findAttempts < MAX_STRONGHOLD_ATTEMPTS); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp index ed90d75ac..23d8aa558 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.cpp @@ -9,7 +9,7 @@ #include "StructurePiece.h" #include "BoundingBox.h" #include "../../../../Direction.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../../Facing.h" #include "../../../item/DoorItem.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp index 3ab843dbb..c896744db 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/VillagePieces.cpp @@ -12,7 +12,7 @@ #include "VillagePieces.h" #include "VillageFeature.h" #include "../../../../Direction.h" -#include "../../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../biome/BiomeSource.h" WeighedTreasureArray VillagePieces::Smithy::treasureItems; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp index dff37e1ad..95bc9edbc 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/FuzzyZoomLayer.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "net.minecraft.world.level.newbiome.layer.h" FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, std::shared_ptr parent) diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp index db751befe..fbf590fa6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/SmoothZoomLayer.cpp @@ -1,6 +1,6 @@ #include "../../../../../../Header Files/stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -#include "../../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, std::shared_ptr parent) diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp index f5b55018d..b554d3d59 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.cpp @@ -1,6 +1,6 @@ #include "../../../../../../Header Files/stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -#include "../../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" VoronoiZoom::VoronoiZoom(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp index a02577d67..9efda1ece 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.cpp @@ -1,6 +1,6 @@ #include "../../../../../../Header Files/stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -#include "../../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" ZoomLayer::ZoomLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp index 4b44508e8..0aff3db91 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.cpp @@ -1,6 +1,6 @@ #include "../../../../../Header Files/stdafx.h" #include "Node.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "BinaryHeap.h" #include diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h index 9ddc11da2..91951c4af 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/BinaryHeap.h @@ -2,7 +2,7 @@ #include "../../../../../Header Files/stdafx.h" #include "Node.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" class BinaryHeap { private: diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h index 34ca9c220..639f89369 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../../../ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class LevelSource; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp index ec1cee7bf..fbc06b8d2 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../entity/player/net.minecraft.world.entity.player.h" #include "../../item/net.minecraft.world.item.h" #include "MapItemSavedData.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h b/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h index da3876015..0571bf103 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/SavedData.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../../../ConsoleJavaLibs/Class.h" +#include "java/Class.h" class CompoundTag; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp index 882f29360..c4db7855f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.cpp @@ -1,13 +1,13 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "../../entity/player/net.minecraft.world.entity.player.h" #include "../net.minecraft.world.level.h" #include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" #include "../dimension/net.minecraft.world.level.dimension.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" -#include "../../../../../ConsoleJavaLibs/File.h" -#include "../../../../../ConsoleJavaLibs/InputOutputStream/DataInputStream.h" -#include "../../../../../ConsoleJavaLibs/InputOutputStream/FileInputStream.h" +#include "nbt/com.mojang.nbt.h" +#include "java/File.h" +#include "java/InputOutputStream/DataInputStream.h" +#include "java/InputOutputStream/FileInputStream.h" #include "LevelData.h" #include "DirectoryLevelStorage.h" #include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h index 3bca465b4..4300de599 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorage.h @@ -25,7 +25,7 @@ // The save file version in which we added the End dimension map mappings #define END_DIMENSION_MAP_MAPPINGS_SAVE_VERSION 5 -#include "../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "LevelStorage.h" #include "PlayerIO.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp index 79be0d2dc..f87295b54 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.cpp @@ -1,8 +1,8 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "LevelData.h" #include "LevelSummary.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "DirectoryLevelStorage.h" #include "DirectoryLevelStorageSource.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h index ed0e7e147..7b97630dc 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/DirectoryLevelStorageSource.h @@ -1,7 +1,7 @@ #pragma once #include "LevelStorageSource.h" -#include "../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" class ProgressListener; class LevelData; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp index b79676e02..36d6cb29a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/LevelData.cpp @@ -1,7 +1,7 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/System.h" +#include "java/System.h" #include "../../entity/player/net.minecraft.world.entity.player.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "LevelData.h" #include "../LevelType.h" #include "../LevelSettings.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp index c88a27306..a7f8d3d1a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp @@ -4,7 +4,7 @@ #include "../dimension/net.minecraft.world.level.dimension.h" #include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" #include "LevelData.h" -#include "../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "McRegionLevelStorage.h" McRegionLevelStorage::McRegionLevelStorage(ConsoleSaveFile* saveFile, File dir, diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp index 923c8d212..f2a18db4b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.cpp @@ -1,11 +1,11 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../util/ProgressListener.h" #include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" #include "../chunk/net.minecraft.world.level.chunk.h" #include "LevelSummary.h" #include "McRegionLevelStorage.h" -#include "../../../../../ConsoleJavaLibs/File.h" +#include "java/File.h" #include "LevelData.h" #include "McRegionLevelStorageSource.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h index 09bb38a72..37a05473e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorageSource.h @@ -1,8 +1,8 @@ #pragma once #include "DirectoryLevelStorageSource.h" -#include "../../../../../ConsoleJavaLibs/FileFilter.h" -#include "../../../../../ConsoleJavaLibs/FilenameFilter.h" +#include "java/FileFilter.h" +#include "java/FilenameFilter.h" class ProgressListener; class LevelStorage; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp index f46b86bc5..52542e55f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.cpp @@ -3,7 +3,7 @@ #include "../net.minecraft.world.level.h" #include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" #include "../dimension/net.minecraft.world.level.dimension.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "MemoryLevelStorage.h" #include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h b/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h index 6f2b93c11..a2ae75edf 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/MemoryLevelStorage.h @@ -8,7 +8,7 @@ #include "../net.minecraft.world.level.h" #include "../chunk/storage/net.minecraft.world.level.chunk.storage.h" #include "../dimension/net.minecraft.world.level.dimension.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFile.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp index 30ae16d4f..58ddfc21f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/SavedDataStorage.cpp @@ -2,8 +2,8 @@ #include "../saveddata/net.minecraft.world.level.saveddata.h" #include "net.minecraft.world.level.storage.h" #include "../../entity/ai/village/net.minecraft.world.entity.ai.village.h" -#include "../../../../../com/mojang/nbt/com.mojang.nbt.h" -#include "../../../../../ConsoleJavaLibs/File.h" +#include "nbt/com.mojang.nbt.h" +#include "java/File.h" #include "SavedDataStorage.h" #include "../../../../../ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileIO.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp index 8644e786c..2dd6e1c48 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.cpp @@ -26,7 +26,7 @@ std::shared_ptr BrewingStandTile::newTileEntity(Level* level) { bool BrewingStandTile::isCubeShaped() { return false; } void BrewingStandTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, + std::vector* boxes, std::shared_ptr source) { setShape(7.0f / 16.0f, 0, 7.0f / 16.0f, 9.0f / 16.0f, 14.0f / 16.0f, 9.0f / 16.0f); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.h index 30ae2bd7b..418593057 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/BrewingStandTile.h @@ -19,7 +19,7 @@ public: virtual std::shared_ptr newTileEntity(Level* level); virtual bool isCubeShaped(); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual void updateDefaultShape(); virtual bool use(Level* level, int x, int y, int z, std::shared_ptr player, int clickedFace, diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp index 4e3903d2e..71f07c622 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.cpp @@ -41,7 +41,7 @@ Icon* CauldronTile::getTexture(const std::wstring& name) { } void CauldronTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 5.0f / 16.0f, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); float thickness = 2.0f / 16.0f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.h index 09cde15cd..43ca060e8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/CauldronTile.h @@ -21,7 +21,7 @@ public: void registerIcons(IconRegister* iconRegister); static Icon* getTexture(const std::wstring& name); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual void updateDefaultShape(); virtual bool isSolidRender(bool isServerLevel = false); virtual int getRenderShape(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp index a1b3a7b81..a3daa3390 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/DaylightDetectorTile.cpp @@ -5,7 +5,7 @@ #include "../redstone/net.minecraft.world.level.redstone.h" #include "entity/net.minecraft.world.level.tile.entity.h" #include "../../net.minecraft.world.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "DaylightDetectorTile.h" DaylightDetectorTile::DaylightDetectorTile(int id) @@ -53,10 +53,10 @@ void DaylightDetectorTile::updateSignalStrength(Level* level, int x, int y, // tilt sunAngle towards zenith (to make the transition to night // smoother) - if (sunAngle < PI) { + if (sunAngle < M_PI) { sunAngle = sunAngle + (0 - sunAngle) * .2f; } else { - sunAngle = sunAngle + (PI * 2.0f - sunAngle) * .2f; + sunAngle = sunAngle + (M_PI * 2.0f - sunAngle) * .2f; } target = Math::round((float)target * Mth::cos(sunAngle)); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp index 4163b0444..3051baf76 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.cpp @@ -10,7 +10,7 @@ FenceTile::FenceTile(int id, const std::wstring& texture, Material* material) } void FenceTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { bool n = connectsTo(level, x, y, z - 1); bool s = connectsTo(level, x, y, z + 1); bool w = connectsTo(level, x - 1, y, z); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.h index f5dad4016..64ff18b72 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/FenceTile.h @@ -9,7 +9,7 @@ private: public: FenceTile(int id, const std::wstring& texture, Material* material); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual void updateShape( LevelSource* level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr< diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp index 4b7f4d4a8..06d8e9e9a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/FireTile.cpp @@ -10,7 +10,7 @@ #include "../../phys/AABB.h" // AP - added for Vita to set Alpha Cut out -#include "../../../../../ConsoleJavaLibs/IntBuffer.h" +#include "java/IntBuffer.h" #include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h" const std::wstring FireTile::TEXTURE_FIRST = L"fire_0"; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp index dbff15bca..489bed889 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/GrassTile.cpp @@ -7,7 +7,7 @@ #include "../../net.minecraft.world.h" // AP - included for PSVita Alpha cut out optimisation -#include "../../../../../ConsoleJavaLibs/IntBuffer.h" +#include "java/IntBuffer.h" #include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h" GrassTile::GrassTile(int id) : Tile(id, Material::grass) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp index f48a2fb4f..18b9d6fed 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.cpp @@ -44,7 +44,7 @@ void HalfSlabTile::updateDefaultShape() { } void HalfSlabTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { updateShape(level, x, y, z); Tile::addAABBs(level, x, y, z, box, boxes, source); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.h index d2e87a648..a54027a48 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HalfSlabTile.h @@ -18,7 +18,7 @@ public: TileEntity>()); // 4J added forceData, forceEntity param virtual void updateDefaultShape(); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual bool isSolidRender(bool isServerLevel); virtual int getPlacedOnFaceDataValue(Level* level, int x, int y, int z, int face, float clickX, float clickY, diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp index 983f91805..224215bcc 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.cpp @@ -22,7 +22,7 @@ void HopperTile::updateShape(LevelSource* level, int x, int y, int z, } void HopperTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 10.0f / 16.0f, 1); BaseEntityTile::addAABBs(level, x, y, z, box, boxes, source); float thickness = 2.0f / 16.0f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.h index cf0a47cbf..96220dded 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/HopperTile.h @@ -31,7 +31,7 @@ public: std::shared_ptr forceEntity = std::shared_ptr()); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual int getPlacedOnFaceDataValue(Level* level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h index 3807a4998..9925b6fff 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/JukeboxTile.h @@ -1,7 +1,7 @@ #pragma once #include "BaseEntityTile.h" -#include "../../../../../com/mojang/nbt/CompoundTag.h" +#include "nbt/CompoundTag.h" #include "entity/TileEntity.h" class CompoundTag; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp index 077e30e62..df401c0b5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp @@ -1,5 +1,5 @@ #include "../../../../../Header Files/stdafx.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../net.minecraft.world.level.h" #include "../dimension/net.minecraft.world.level.dimension.h" #include "../biome/net.minecraft.world.level.biome.h" @@ -314,7 +314,7 @@ double LiquidTile::getSlopeAngle(LevelSource* level, int x, int y, int z, if (m == Material::water) flow = Tile::water->getFlow(level, x, y, z); if (m == Material::lava) flow = Tile::lava->getFlow(level, x, y, z); if (flow.x == 0 && flow.z == 0) return -1000; - return atan2(flow.z, flow.x) - PI / 2; + return atan2(flow.z, flow.x) - M_PI / 2; } void LiquidTile::onPlace(Level* level, int x, int y, int z) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp index f9db389bd..c7debfa79 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/RedStoneDustTile.cpp @@ -14,7 +14,7 @@ #include "../../phys/AABB.h" // AP - added for Vita to set Alpha Cut out -#include "../../../../../ConsoleJavaLibs/IntBuffer.h" +#include "java/IntBuffer.h" #include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h" const std::wstring RedStoneDustTile::TEXTURE_CROSS = L"_cross"; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp index a32b78392..646ecc310 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.cpp @@ -269,7 +269,7 @@ bool StairTile::setInnerPieceShape(LevelSource* level, int x, int y, int z) { } void StairTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { setBaseShape(level, x, y, z); Tile::addAABBs(level, x, y, z, box, boxes, source); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.h index 690b52bd2..bad39f7b5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/StairTile.h @@ -48,7 +48,7 @@ private: public: bool setStepShape(LevelSource* level, int x, int y, int z); bool setInnerPieceShape(LevelSource* level, int x, int y, int z); - void addAABBs(Level* level, int x, int y, int z, AABB* box, AABBList* boxes, + void addAABBs(Level* level, int x, int y, int z, AABB* box, std::vector* boxes, std::shared_ptr source); /** DELEGATES: **/ diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp index 4fe615f56..e75e7a0fb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.cpp @@ -40,7 +40,7 @@ void TheEndPortalFrameTile::updateDefaultShape() { } void TheEndPortalFrameTile::addAABBs(Level* level, int x, int y, int z, - AABB* box, AABBList* boxes, + AABB* box, std::vector* boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 13.0f / 16.0f, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.h index 1e30d495d..72fa3beaa 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/TheEndPortalFrameTile.h @@ -19,7 +19,7 @@ public: virtual int getRenderShape(); virtual void updateDefaultShape(); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); static bool hasEye(int data); virtual int getResource(int data, Random* random, int playerBonusLevel); virtual void setPlacedBy(Level* level, int x, int y, int z, diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp index 7b0257264..a4388c41e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.cpp @@ -37,7 +37,7 @@ bool ThinFenceTile::shouldRenderFace(LevelSource* level, int x, int y, int z, } void ThinFenceTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { bool n = attachsTo(level->getTile(x, y, z - 1)); bool s = attachsTo(level->getTile(x, y, z + 1)); bool w = attachsTo(level->getTile(x - 1, y, z)); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h index 324cdf66b..0d3ab9717 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/ThinFenceTile.h @@ -19,7 +19,7 @@ public: virtual bool shouldRenderFace(LevelSource* level, int x, int y, int z, int face); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual void updateDefaultShape(); virtual void updateShape( LevelSource* level, int x, int y, int z, int forceData = -1, diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.cpp index 5fa259587..5d4f4c87e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.cpp @@ -2015,7 +2015,7 @@ AABB Tile::getTileAABB(Level* level, int x, int y, int z) { } void Tile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { auto aabb = getAABB(level, x, y, z); if (aabb.has_value() && box->intersects(*aabb)) boxes->push_back(*aabb); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.h index 61c0e2283..c83e9bda6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/Tile.h @@ -634,7 +634,7 @@ public: virtual Icon* getTexture(int face); virtual AABB getTileAABB(Level* level, int x, int y, int z); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual std::optional getAABB(Level* level, int x, int y, int z); virtual bool isSolidRender( bool isServerLevel = false); // 4J - Added isServerLevel param diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp index 1f9fcf8b6..b00af2841 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/VineTile.cpp @@ -1,7 +1,7 @@ #include "../../../../../Header Files/stdafx.h" #include "VineTile.h" #include "../material/Material.h" -#include "../../../../../ConsoleJavaLibs/JavaMath.h" +#include "java/JavaMath.h" #include "../../../Facing.h" #include "../net.minecraft.world.level.h" #include "../../item/net.minecraft.world.item.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp index 484ec36c4..7dc75862a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.cpp @@ -17,7 +17,7 @@ void WaterlilyTile::updateDefaultShape() { int WaterlilyTile::getRenderShape() { return Tile::SHAPE_LILYPAD; } void WaterlilyTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { if (source == nullptr || !source->instanceof(eTYPE_BOAT)) { Bush::addAABBs(level, x, y, z, box, boxes, source); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.h index 23b39fdc0..532693c2a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/WaterLilyTile.h @@ -11,7 +11,7 @@ public: virtual int getRenderShape(); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual std::optional getAABB(Level* level, int x, int y, int z); virtual int getColor() const; virtual int getColor(int auxData); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp index 8c0c2a067..595be360b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "BrewingStandTileEntity.h" #include "../../../../SharedConstants.h" #include "../../../../net.minecraft.h" @@ -16,7 +16,7 @@ intArray BrewingStandTileEntity::SLOTS_FOR_OTHER_FACES = BrewingStandTileEntity::BrewingStandTileEntity() { brewTime = 0; - items = ItemInstanceArray(4); + items = arrayWithLength>(4); name = L""; } @@ -261,7 +261,7 @@ void BrewingStandTileEntity::load(CompoundTag* base) { ListTag* inventoryList = (ListTag*)base->getList(L"Items"); delete[] items.data; - items = ItemInstanceArray(getContainerSize()); + items = arrayWithLength>(getContainerSize()); for (int i = 0; i < inventoryList->size(); i++) { CompoundTag* tag = inventoryList->get(i); int slot = tag->getByte(L"Slot"); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h index 313e5d56c..a4cba533d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/BrewingStandTileEntity.h @@ -10,7 +10,7 @@ public: static const int INGREDIENT_SLOT = 3; private: - ItemInstanceArray items; + arrayWithLength> items; static intArray SLOTS_FOR_UP; static intArray SLOTS_FOR_OTHER_FACES; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp index e7945c4a5..126d08260 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../../net.minecraft.world.h" #include "../../net.minecraft.world.level.h" #include "TileEntity.h" @@ -21,7 +21,7 @@ int ChestTileEntity::getContainerType() { } void ChestTileEntity::_init(bool isBonusChest) { - items = new ItemInstanceArray(9 * 4); + items = new arrayWithLength>(9 * 4); hasCheckedNeighbors = false; this->isBonusChest = isBonusChest; @@ -119,7 +119,7 @@ void ChestTileEntity::load(CompoundTag* base) { delete[] items->data; delete items; } - items = new ItemInstanceArray(getContainerSize()); + items = new arrayWithLength>(getContainerSize()); if (base->contains(L"CustomName")) name = base->getString(L"CustomName"); for (int i = 0; i < inventoryList->size(); i++) { CompoundTag* tag = inventoryList->get(i); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h index 9d9ade4f8..a4e2e9c3d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/ChestTileEntity.h @@ -3,7 +3,7 @@ #include "TileEntity.h" #include "../../../Container.h" -#include "../../../../../../com/mojang/nbt/ListTag.h" +#include "nbt/ListTag.h" class Player; class CompoundTag; @@ -26,7 +26,7 @@ public: virtual ~ChestTileEntity(); private: - ItemInstanceArray* items; + arrayWithLength>* items; public: bool isBonusChest; // 4J added diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp index 3e4ed16b9..85997d6ac 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "TileEntity.h" #include "../../net.minecraft.world.level.h" #include "../../../entity/item/net.minecraft.world.entity.item.h" @@ -8,7 +8,7 @@ #include "DispenserTileEntity.h" DispenserTileEntity::DispenserTileEntity() : TileEntity() { - items = ItemInstanceArray(9); + items = arrayWithLength>(9); random = new Random(); name = L""; } @@ -140,7 +140,7 @@ void DispenserTileEntity::load(CompoundTag* base) { ListTag* inventoryList = (ListTag*)base->getList(L"Items"); delete[] items.data; - items = ItemInstanceArray(getContainerSize()); + items = arrayWithLength>(getContainerSize()); for (int i = 0; i < inventoryList->size(); i++) { CompoundTag* tag = inventoryList->get(i); unsigned int slot = tag->getByte(L"Slot") & 0xff; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h index e09d0bd6a..470b7ef4f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/DispenserTileEntity.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "TileEntity.h" #include "../../../Container.h" @@ -17,7 +17,7 @@ public: using TileEntity::setChanged; private: - ItemInstanceArray items; + arrayWithLength> items; Random* random; protected: diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp index d8bd9d74a..9f706511b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/EnchantmentTableTileEntity.cpp @@ -58,13 +58,13 @@ void EnchantmentTableEntity::tick() { open -= 0.1f; } - while (rot >= PI) rot -= PI * 2; - while (rot < -PI) rot += PI * 2; - while (tRot >= PI) tRot -= PI * 2; - while (tRot < -PI) tRot += PI * 2; + while (rot >= M_PI) rot -= M_PI * 2; + while (rot < -M_PI ) rot += M_PI * 2; + while (tRot >= M_PI) tRot -= M_PI * 2; + while (tRot < -M_PI ) tRot += M_PI * 2; float rotDir = tRot - rot; - while (rotDir >= PI) rotDir -= PI * 2; - while (rotDir < -PI) rotDir += PI * 2; + while (rotDir >= M_PI) rotDir -= M_PI * 2; + while (rotDir < -M_PI ) rotDir += M_PI * 2; rot += rotDir * 0.4f; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp index 9f615a745..0cec50a3b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../../../net.minecraft.h" #include "../../../entity/player/net.minecraft.world.entity.player.h" #include "../../../item/net.minecraft.world.item.h" @@ -24,7 +24,7 @@ const int FurnaceTileEntity::BURN_INTERVAL = 10 * 20; // 4J Stu - Need a ctor to initialise member variables FurnaceTileEntity::FurnaceTileEntity() : TileEntity() { - items = ItemInstanceArray(3); + items = arrayWithLength>(3); litTime = 0; litDuration = 0; @@ -100,7 +100,7 @@ void FurnaceTileEntity::load(CompoundTag* base) { ListTag* inventoryList = (ListTag*)base->getList(L"Items"); delete[] items.data; - items = ItemInstanceArray(getContainerSize()); + items = arrayWithLength>(getContainerSize()); for (int i = 0; i < inventoryList->size(); i++) { CompoundTag* tag = inventoryList->get(i); unsigned int slot = tag->getByte(L"Slot"); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h index 9f2eb8af6..6e01f7b2a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/FurnaceTileEntity.h @@ -24,7 +24,7 @@ private: static const intArray SLOTS_FOR_SIDES; static const int BURN_INTERVAL; - ItemInstanceArray items; + arrayWithLength> items; // 4J-JEV: Added for 'Renewable Energy' achievement. // Should be true iff characoal was consumed whilst cooking the current diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp index 244adadf3..684b1976c 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.cpp @@ -11,7 +11,7 @@ #include "HopperTileEntity.h" HopperTileEntity::HopperTileEntity() { - items = ItemInstanceArray(5); + items = arrayWithLength>(5); name = L""; cooldownTime = -1; } @@ -24,7 +24,7 @@ void HopperTileEntity::load(CompoundTag* base) { ListTag* inventoryList = (ListTag*)base->getList(L"Items"); delete[] items.data; - items = ItemInstanceArray(getContainerSize()); + items = arrayWithLength>(getContainerSize()); if (base->contains(L"CustomName")) name = base->getString(L"CustomName"); cooldownTime = base->getInt(L"TransferCooldown"); for (int i = 0; i < inventoryList->size(); i++) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h index c1dc92c88..7ea27c8cd 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/HopperTileEntity.h @@ -14,7 +14,7 @@ public: static const int MOVE_ITEM_SPEED = 8; private: - ItemInstanceArray items; + arrayWithLength> items; std::wstring name; int cooldownTime; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp index f8c2cd463..9c700af24 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/MusicTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../../entity/player/net.minecraft.world.entity.player.h" #include "../../../item/net.minecraft.world.item.h" #include "../../net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp index 8b0dc4037..985123e67 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/PistonPieceTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "PistonPieceTileEntity.h" #include "PistonMovingTileEntity.h" #include "../../net.minecraft.world.level.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp index 91362e3f7..0067e45ac 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SignTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../net.minecraft.world.level.h" #include "../../../entity/item/net.minecraft.world.entity.item.h" #include "../../../entity/player/net.minecraft.world.entity.player.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp index 1b8be9e21..f8c09e625 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/SkullTileEntity.cpp @@ -1,5 +1,5 @@ #include "../../../../../../Header Files/stdafx.h" -#include "../../../../../../com/mojang/nbt/com.mojang.nbt.h" +#include "nbt/com.mojang.nbt.h" #include "../../../../network/packet/net.minecraft.network.packet.h" #include "SkullTileEntity.h" diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp index 82df7f7ed..27050e4fc 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.cpp @@ -42,7 +42,7 @@ bool TheEndPortal::shouldRenderFace(LevelSource* level, int x, int y, int z, } void TheEndPortal::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) {} + std::vector* boxes, std::shared_ptr source) {} bool TheEndPortal::isSolidRender(bool isServerLevel) { return false; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h index a413f5ca2..65551b02b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TheEndPortalTile.h @@ -21,7 +21,7 @@ public: virtual bool shouldRenderFace(LevelSource* level, int x, int y, int z, int face); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual int getResourceCount(Random* random); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h index ade37c7b2..06c229f8b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h @@ -1,7 +1,7 @@ #pragma once #include "../../../../../../ConsoleHelpers/HashExtension.h" -#include "../../../../../../ConsoleJavaLibs/JavaIntHash.h" +#include "java/JavaIntHash.h" class Level; class Packet; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp index 69b4522d0..0c039c1c2 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.cpp @@ -396,7 +396,7 @@ void PistonBaseTile::updateShape( void PistonBaseTile::updateDefaultShape() { setShape(0, 0, 0, 1, 1, 1); } void PistonBaseTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source) { + std::vector* boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 1, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h index 80c71ce71..0e6657702 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonBaseTile.h @@ -68,7 +68,7 @@ public: TileEntity>()); // 4J added forceData, forceEntity param virtual void updateDefaultShape(); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual std::optional getAABB(Level* level, int x, int y, int z); virtual bool isCubeShaped(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp index 837bc692c..fc018bdbb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.cpp @@ -99,7 +99,7 @@ bool PistonExtensionTile::mayPlace(Level* level, int x, int y, int z, int PistonExtensionTile::getResourceCount(Random* random) { return 0; } void PistonExtensionTile::addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, + std::vector* boxes, std::shared_ptr source) { int data = level->getData(x, y, z); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h index f2f64e336..35888829a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/piston/PistonExtensionTile.h @@ -25,7 +25,7 @@ public: virtual bool mayPlace(Level* level, int x, int y, int z, int face); virtual int getResourceCount(Random* random); virtual void addAABBs(Level* level, int x, int y, int z, AABB* box, - AABBList* boxes, std::shared_ptr source); + std::vector* boxes, std::shared_ptr source); virtual void updateShape( LevelSource* level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr< diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Arrays.h b/minecraft/java/include/java/Arrays.h similarity index 93% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Arrays.h rename to minecraft/java/include/java/Arrays.h index b55f11f4b..c317afde3 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Arrays.h +++ b/minecraft/java/include/java/Arrays.h @@ -1,6 +1,6 @@ #pragma once -#include "../ConsoleHelpers/ArrayWithLength.h" +#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO class Arrays { public: diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Buffer.h b/minecraft/java/include/java/Buffer.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Buffer.h rename to minecraft/java/include/java/Buffer.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/ByteBuffer.h b/minecraft/java/include/java/ByteBuffer.h similarity index 86% rename from minecraft/Minecraft.World/ConsoleJavaLibs/ByteBuffer.h rename to minecraft/java/include/java/ByteBuffer.h index a43ebb410..ab4311d42 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/ByteBuffer.h +++ b/minecraft/java/include/java/ByteBuffer.h @@ -1,7 +1,10 @@ #pragma once +#include + #include "Buffer.h" -#include "../ConsoleHelpers/Definitions.h" +#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO +#include "../../../Minecraft.World/ConsoleHelpers/Definitions.h" // 4jcraft TODO class IntBuffer; class FloatBuffer; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Class.h b/minecraft/java/include/java/Class.h similarity index 99% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Class.h rename to minecraft/java/include/java/Class.h index 752050ba3..c4e602d89 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Class.h +++ b/minecraft/java/include/java/Class.h @@ -169,7 +169,6 @@ enum eINSTANCEOF { eTYPE_VILLAGERGOLEM = eTYPE_GOLEM | 0x2, // 0x1000, // 4J Stu - If you add new hostile mobs here you should also update the - // std::string lookup function at CConsoleMinecraftApp::getEntityName eTYPE_MONSTER = eTYPE_ENEMY | eTYPE_PATHFINDER_MOB | BIT_MONSTER, eTYPE_SPIDER = eTYPE_MONSTER | eTYPE_VALID_IN_SPAWNER_FLAG | BIT_SPIDER, diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Color.h b/minecraft/java/include/java/Color.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Color.h rename to minecraft/java/include/java/Color.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Exceptions.h b/minecraft/java/include/java/Exceptions.h similarity index 92% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Exceptions.h rename to minecraft/java/include/java/Exceptions.h index d8d4ccbfd..b21a13250 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Exceptions.h +++ b/minecraft/java/include/java/Exceptions.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + class EOFException : public std::exception {}; class IllegalArgumentException : public std::exception { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/File.h b/minecraft/java/include/java/File.h similarity index 96% rename from minecraft/Minecraft.World/ConsoleJavaLibs/File.h rename to minecraft/java/include/java/File.h index 108dca8d8..f7a4807e7 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/File.h +++ b/minecraft/java/include/java/File.h @@ -1,5 +1,9 @@ #pragma once +#include +#include +#include + // 4J Stu - Represents java standard library class class FileFilter; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/FileFilter.h b/minecraft/java/include/java/FileFilter.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/FileFilter.h rename to minecraft/java/include/java/FileFilter.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/FilenameFilter.h b/minecraft/java/include/java/FilenameFilter.h similarity index 81% rename from minecraft/Minecraft.World/ConsoleJavaLibs/FilenameFilter.h rename to minecraft/java/include/java/FilenameFilter.h index 687412f5a..5cda31dd3 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/FilenameFilter.h +++ b/minecraft/java/include/java/FilenameFilter.h @@ -1,6 +1,6 @@ #pragma once -#include "../Header Files/stdafx.h" +#include class File; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/FloatBuffer.h b/minecraft/java/include/java/FloatBuffer.h similarity index 72% rename from minecraft/Minecraft.World/ConsoleJavaLibs/FloatBuffer.h rename to minecraft/java/include/java/FloatBuffer.h index db890c8d4..cbe3ae1af 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/FloatBuffer.h +++ b/minecraft/java/include/java/FloatBuffer.h @@ -1,5 +1,6 @@ #pragma once #include "Buffer.h" +#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO class FloatBuffer : public Buffer { private: @@ -12,6 +13,6 @@ public: FloatBuffer* flip(); FloatBuffer* put(float f); - void get(floatArray* dst); + void get(arrayWithLength* dst); float* _getDataPointer() { return buffer; } }; \ No newline at end of file diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.h b/minecraft/java/include/java/InputOutputStream/BufferedOutputStream.h similarity index 86% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.h rename to minecraft/java/include/java/InputOutputStream/BufferedOutputStream.h index 286879b33..642711ed4 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.h +++ b/minecraft/java/include/java/InputOutputStream/BufferedOutputStream.h @@ -1,6 +1,7 @@ #pragma once #include "OutputStream.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO class BufferedOutputStream : public OutputStream { private: diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.h b/minecraft/java/include/java/InputOutputStream/BufferedReader.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.h rename to minecraft/java/include/java/InputOutputStream/BufferedReader.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.h b/minecraft/java/include/java/InputOutputStream/ByteArrayInputStream.h similarity index 93% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.h rename to minecraft/java/include/java/InputOutputStream/ByteArrayInputStream.h index 28f2ece6f..8b72e692b 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.h +++ b/minecraft/java/include/java/InputOutputStream/ByteArrayInputStream.h @@ -2,6 +2,7 @@ // 4J Stu - Represents Java standard library class #include "InputStream.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO class ByteArrayInputStream : public InputStream { protected: diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h b/minecraft/java/include/java/InputOutputStream/ByteArrayOutputStream.h similarity index 89% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h rename to minecraft/java/include/java/InputOutputStream/ByteArrayOutputStream.h index e13fc201b..d2c57887c 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.h +++ b/minecraft/java/include/java/InputOutputStream/ByteArrayOutputStream.h @@ -1,6 +1,7 @@ #pragma once #include "OutputStream.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO class ByteArrayOutputStream : public OutputStream { // Note - when actually implementing, byteArray will need to grow as data is diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInput.h b/minecraft/java/include/java/InputOutputStream/DataInput.h similarity index 80% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInput.h rename to minecraft/java/include/java/InputOutputStream/DataInput.h index 0a924f1ab..cdc30ec87 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInput.h +++ b/minecraft/java/include/java/InputOutputStream/DataInput.h @@ -1,5 +1,7 @@ #pragma once +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + class DataInput { public: virtual int read() = 0; @@ -16,6 +18,6 @@ public: virtual short readShort() = 0; virtual wchar_t readChar() = 0; virtual std::wstring readUTF() = 0; - virtual PlayerUID readPlayerUID() = 0; // 4J Added + virtual unsigned long long readPlayerUID() = 0; // 4J Added virtual int skipBytes(int n) = 0; }; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h b/minecraft/java/include/java/InputOutputStream/DataInputStream.h similarity index 86% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h rename to minecraft/java/include/java/InputOutputStream/DataInputStream.h index ff4c8ba42..981a10a68 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.h +++ b/minecraft/java/include/java/InputOutputStream/DataInputStream.h @@ -2,9 +2,13 @@ // 4J Stu - Represents Java standard library class (although we miss out an // intermediate inheritance class that we don't care about) +#include + #include "InputStream.h" #include "DataInput.h" +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + class DataInputStream : public InputStream, public DataInput { private: InputStream* stream; @@ -30,7 +34,7 @@ public: virtual std::wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); - virtual PlayerUID readPlayerUID(); // 4J Added + virtual unsigned long long readPlayerUID(); // 4J Added virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutput.h b/minecraft/java/include/java/InputOutputStream/DataOutput.h similarity index 80% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutput.h rename to minecraft/java/include/java/InputOutputStream/DataOutput.h index 802b310ba..76973c02f 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutput.h +++ b/minecraft/java/include/java/InputOutputStream/DataOutput.h @@ -1,5 +1,7 @@ #pragma once +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + class DataOutput { public: virtual void write(unsigned int b) = 0; @@ -16,5 +18,5 @@ public: virtual void writeChar(wchar_t v) = 0; virtual void writeChars(const std::wstring& s) = 0; virtual void writeUTF(const std::wstring& a) = 0; - virtual void writePlayerUID(PlayerUID player) = 0; // 4J Added + virtual void writePlayerUID(unsigned long long player) = 0; // 4J Added }; \ No newline at end of file diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h b/minecraft/java/include/java/InputOutputStream/DataOutputStream.h similarity index 87% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h rename to minecraft/java/include/java/InputOutputStream/DataOutputStream.h index a261113ee..ccf6fc23c 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.h +++ b/minecraft/java/include/java/InputOutputStream/DataOutputStream.h @@ -2,6 +2,11 @@ // 4J Stu - Represents Java standard library class (although we miss out an // intermediate inheritance class that we don't care about) +#include + +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + + #include "OutputStream.h" #include "DataOutput.h" @@ -34,6 +39,6 @@ public: virtual void writeChars(const std::wstring& a); virtual void writeBoolean(bool b); virtual void writeUTF(const std::wstring& a); - virtual void writePlayerUID(PlayerUID player); + virtual void writePlayerUID(unsigned long long player); virtual void flush(); }; \ No newline at end of file diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h b/minecraft/java/include/java/InputOutputStream/FileInputStream.h similarity index 81% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h rename to minecraft/java/include/java/InputOutputStream/FileInputStream.h index 80d6aa91f..bee8741be 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.h +++ b/minecraft/java/include/java/InputOutputStream/FileInputStream.h @@ -2,6 +2,9 @@ // 4J Stu - Represents Java standard library class #include +#include + +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO #include "InputStream.h" diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h b/minecraft/java/include/java/InputOutputStream/FileOutputStream.h similarity index 84% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h rename to minecraft/java/include/java/InputOutputStream/FileOutputStream.h index 0df2cd6b4..7ddeab7d8 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.h +++ b/minecraft/java/include/java/InputOutputStream/FileOutputStream.h @@ -3,6 +3,8 @@ #include +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + #include "OutputStream.h" class File; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPInputStream.h b/minecraft/java/include/java/InputOutputStream/GZIPInputStream.h similarity index 85% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPInputStream.h rename to minecraft/java/include/java/InputOutputStream/GZIPInputStream.h index aaa6343f5..6a75ccae9 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPInputStream.h +++ b/minecraft/java/include/java/InputOutputStream/GZIPInputStream.h @@ -2,6 +2,10 @@ // 4J Stu - We are not using GZIP compression, so this is just a pass through // class +#include + +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + #include "InputStream.h" class GZIPInputStream : public InputStream { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPOutputStream.h b/minecraft/java/include/java/InputOutputStream/GZIPOutputStream.h similarity index 87% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPOutputStream.h rename to minecraft/java/include/java/InputOutputStream/GZIPOutputStream.h index 017d6a6ea..8454f492c 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/GZIPOutputStream.h +++ b/minecraft/java/include/java/InputOutputStream/GZIPOutputStream.h @@ -2,6 +2,8 @@ // 4J Stu - We are not using GZIP compression, so this is just a pass through // class +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + #include "OutputStream.h" class GZIPOutputStream : public OutputStream { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h b/minecraft/java/include/java/InputOutputStream/InputOutputStream.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputOutputStream.h rename to minecraft/java/include/java/InputOutputStream/InputOutputStream.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h b/minecraft/java/include/java/InputOutputStream/InputStream.h similarity index 76% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h rename to minecraft/java/include/java/InputOutputStream/InputStream.h index 5ec00bd5f..a42f18e97 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.h +++ b/minecraft/java/include/java/InputOutputStream/InputStream.h @@ -1,5 +1,10 @@ #pragma once +#include +#include + +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + // 4J Stu - Represents Java standard lib abstract class InputStream { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h b/minecraft/java/include/java/InputOutputStream/InputStreamReader.h similarity index 91% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h rename to minecraft/java/include/java/InputOutputStream/InputStreamReader.h index 26fb7783c..15e2a388c 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.h +++ b/minecraft/java/include/java/InputOutputStream/InputStreamReader.h @@ -1,6 +1,7 @@ #pragma once #include "Reader.h" +#include "DataInputStream.h" class InputStream; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/OutputStream.h b/minecraft/java/include/java/InputOutputStream/OutputStream.h similarity index 80% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/OutputStream.h rename to minecraft/java/include/java/InputOutputStream/OutputStream.h index 6abb3e4cf..abf8ff483 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/OutputStream.h +++ b/minecraft/java/include/java/InputOutputStream/OutputStream.h @@ -1,4 +1,7 @@ #pragma once + +#include "../../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + // 4J Stu - Represents Java standard lib abstract class OutputStream { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/Reader.h b/minecraft/java/include/java/InputOutputStream/Reader.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/Reader.h rename to minecraft/java/include/java/InputOutputStream/Reader.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/IntBuffer.h b/minecraft/java/include/java/IntBuffer.h similarity index 84% rename from minecraft/Minecraft.World/ConsoleJavaLibs/IntBuffer.h rename to minecraft/java/include/java/IntBuffer.h index 18dc5ae33..baed526bc 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/IntBuffer.h +++ b/minecraft/java/include/java/IntBuffer.h @@ -1,5 +1,7 @@ #pragma once +#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO + #include "Buffer.h" class IntBuffer : public Buffer { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/JavaIntHash.h b/minecraft/java/include/java/JavaIntHash.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/JavaIntHash.h rename to minecraft/java/include/java/JavaIntHash.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/JavaMath.h b/minecraft/java/include/java/JavaMath.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/JavaMath.h rename to minecraft/java/include/java/JavaMath.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Random.h b/minecraft/java/include/java/Random.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Random.h rename to minecraft/java/include/java/Random.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Reference.h b/minecraft/java/include/java/Reference.h similarity index 100% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Reference.h rename to minecraft/java/include/java/Reference.h diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/System.h b/minecraft/java/include/java/System.h similarity index 96% rename from minecraft/Minecraft.World/ConsoleJavaLibs/System.h rename to minecraft/java/include/java/System.h index 82321cdf2..f2dc95ab0 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/System.h +++ b/minecraft/java/include/java/System.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../ConsoleHelpers/ArrayWithLength.h" +#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO // 4J Jev, just thought it would be easier this way. #define ArrayCopyFunctionDeclaration(x) \ diff --git a/minecraft/java/meson.build b/minecraft/java/meson.build new file mode 100644 index 000000000..9edc1d664 --- /dev/null +++ b/minecraft/java/meson.build @@ -0,0 +1,35 @@ +java_sources = files( + 'src/InputOutputStream/BufferedOutputStream.cpp', + 'src/InputOutputStream/BufferedReader.cpp', + 'src/InputOutputStream/ByteArrayInputStream.cpp', + 'src/InputOutputStream/ByteArrayOutputStream.cpp', + 'src/InputOutputStream/DataInputStream.cpp', + 'src/InputOutputStream/DataOutputStream.cpp', + 'src/InputOutputStream/FileInputStream.cpp', + 'src/InputOutputStream/FileOutputStream.cpp', + 'src/InputOutputStream/InputStream.cpp', + 'src/InputOutputStream/InputStreamReader.cpp', + 'src/Buffer.cpp', + 'src/ByteBuffer.cpp', + 'src/Class.cpp', + 'src/Color.cpp', + 'src/File.cpp', + 'src/FloatBuffer.cpp', + 'src/IntBuffer.cpp', + 'src/JavaMath.cpp', + 'src/Random.cpp', + 'src/system.cpp', + # 'src/Socket.cpp', +) + +lib_java = static_library('java', + java_sources, + # TODO: remove the .. path once arrayWithLength are evaporated + include_directories: include_directories('include/java'), + cpp_args : global_cpp_args + global_cpp_defs, +) + +java_dep = declare_dependency( + link_with : lib_java, + include_directories: include_directories('include') +) diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Buffer.cpp b/minecraft/java/src/Buffer.cpp similarity index 98% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Buffer.cpp rename to minecraft/java/src/Buffer.cpp index 86c0b8746..814f42485 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Buffer.cpp +++ b/minecraft/java/src/Buffer.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "Buffer.h" Buffer::Buffer(unsigned int capacity) diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/ByteBuffer.cpp b/minecraft/java/src/ByteBuffer.cpp similarity index 99% rename from minecraft/Minecraft.World/ConsoleJavaLibs/ByteBuffer.cpp rename to minecraft/java/src/ByteBuffer.cpp index 9bf801557..73417a5ea 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/ByteBuffer.cpp +++ b/minecraft/java/src/ByteBuffer.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "IntBuffer.h" #include "FloatBuffer.h" diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Class.cpp b/minecraft/java/src/Class.cpp similarity index 81% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Class.cpp rename to minecraft/java/src/Class.cpp index 9880131ee..40cea335a 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Class.cpp +++ b/minecraft/java/src/Class.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "Class.h" // 4J Stu - To ensure that other classes can get the _class object of it's diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Color.cpp b/minecraft/java/src/Color.cpp similarity index 95% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Color.cpp rename to minecraft/java/src/Color.cpp index 15ad6c77e..9b75c2dce 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Color.cpp +++ b/minecraft/java/src/Color.cpp @@ -1,4 +1,5 @@ -#include "../Header Files/stdafx.h" +#include +#include #include "Color.h" @@ -41,8 +42,8 @@ Color Color::getHSBColor(float hue, float saturation, float brightness) { if (saturation == 0) { r = g = b = (int)(brightness * 255.0f + 0.5f); } else { - float h = (hue - (float)floor(hue)) * 6.0f; - float f = h - (float)floor(h); + float h = (hue - (float)std::floor(hue)) * 6.0f; + float f = h - (float)std::floor(h); float p = brightness * (1.0f - saturation); float q = brightness * (1.0f - saturation * f); float t = brightness * (1.0f - (saturation * (1.0f - f))); diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/File.cpp b/minecraft/java/src/File.cpp similarity index 98% rename from minecraft/Minecraft.World/ConsoleJavaLibs/File.cpp rename to minecraft/java/src/File.cpp index 0d17436ba..be99fca50 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/File.cpp +++ b/minecraft/java/src/File.cpp @@ -1,8 +1,8 @@ -#include "../Header Files/stdafx.h" #include "FileFilter.h" -#include "../net/minecraft/world/level/storage/McRegionLevelStorageSource.h" #include "File.h" -#include "../Header Files/PathHelper.h" + +#include "../../../Minecraft.World/ConsoleHelpers/PathHelper.h" // 4jcraft TODO +#include "../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" // 4jcraft TODO #include #include @@ -75,7 +75,7 @@ File::File(const std::wstring& pathname) { "/Common/Media/", "/Common/res/", "/Common/", - "/Minecraft.Assets/"}; + "Minecraft.Assets/"}; for (const char* base : bases) { std::string tryFull = exeDir + base + request; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/FloatBuffer.cpp b/minecraft/java/src/FloatBuffer.cpp similarity index 97% rename from minecraft/Minecraft.World/ConsoleJavaLibs/FloatBuffer.cpp rename to minecraft/java/src/FloatBuffer.cpp index 0a0c1e916..3cdc576f8 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/FloatBuffer.cpp +++ b/minecraft/java/src/FloatBuffer.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "FloatBuffer.h" // Allocates a new float buffer. diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.cpp b/minecraft/java/src/InputOutputStream/BufferedOutputStream.cpp similarity index 96% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.cpp rename to minecraft/java/src/InputOutputStream/BufferedOutputStream.cpp index 99e0cc9e6..9815e9541 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedOutputStream.cpp +++ b/minecraft/java/src/InputOutputStream/BufferedOutputStream.cpp @@ -1,6 +1,4 @@ -#include "../../Header Files/stdafx.h" - -#include "BufferedOutputStream.h" +#include "InputOutputStream/BufferedOutputStream.h" // Creates a new buffered output stream to write data to the specified // underlying output stream with the specified buffer size. Parameters: out - @@ -23,7 +21,7 @@ BufferedOutputStream::~BufferedOutputStream() { // be written out to the underlying output stream. void BufferedOutputStream::flush() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "BufferedOutputStream::flush() called but underlying stream is " "nullptr\n"); return; @@ -41,7 +39,7 @@ void BufferedOutputStream::flush() { void BufferedOutputStream::close() { flush(); if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "BufferedOutputStream::close() called but underlying stream is " "nullptr\n"); return; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.cpp b/minecraft/java/src/InputOutputStream/BufferedReader.cpp similarity index 98% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.cpp rename to minecraft/java/src/InputOutputStream/BufferedReader.cpp index ad440c228..f7298c461 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/BufferedReader.cpp +++ b/minecraft/java/src/InputOutputStream/BufferedReader.cpp @@ -1,6 +1,4 @@ -#include "../../Header Files/stdafx.h" - -#include "BufferedReader.h" +#include "InputOutputStream/BufferedReader.h" // Creates a buffering character-input stream that uses a default-sized input // buffer. Parameters: in - A Reader diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.cpp b/minecraft/java/src/InputOutputStream/ByteArrayInputStream.cpp similarity index 97% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.cpp rename to minecraft/java/src/InputOutputStream/ByteArrayInputStream.cpp index 96c94f350..71edab8d6 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayInputStream.cpp +++ b/minecraft/java/src/InputOutputStream/ByteArrayInputStream.cpp @@ -1,6 +1,4 @@ -#include "../../Header Files/stdafx.h" - -#include "InputOutputStream.h" +#include "InputOutputStream/InputOutputStream.h" // Creates ByteArrayInputStream that uses buf as its buffer array. The initial // value of pos is offset and the initial value of count is the minimum of @@ -75,7 +73,7 @@ int ByteArrayInputStream::read(byteArray b, unsigned int offset, if (pos == count) return -1; int k = std::min(length, count - pos); - XMemCpy(&b[offset], &buf[pos], k); + std::memcpy(&b[offset], &buf[pos], k); // std::copy( buf->data+pos, buf->data+pos+k, b->data + offset ); // Or this // instead? diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.cpp b/minecraft/java/src/InputOutputStream/ByteArrayOutputStream.cpp similarity index 95% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.cpp rename to minecraft/java/src/InputOutputStream/ByteArrayOutputStream.cpp index e6bd50dfd..41f8460dc 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/ByteArrayOutputStream.cpp +++ b/minecraft/java/src/InputOutputStream/ByteArrayOutputStream.cpp @@ -1,6 +1,4 @@ -#include "../../Header Files/stdafx.h" - -#include "ByteArrayOutputStream.h" +#include "InputOutputStream/ByteArrayOutputStream.h" // Creates a new byte array output stream. The buffer capacity is initially 32 // bytes, though its size increases if necessary. @@ -47,7 +45,7 @@ void ByteArrayOutputStream::write(byteArray b, unsigned int offset, if (count + length >= buf.length) buf.resize(std::max(count + length + 1, buf.length * 2)); - XMemCpy(&buf[count], &b[offset], length); + std::memcpy(&buf[count], &b[offset], length); // std::copy( b->data+offset, b->data+offset+length, buf->data + count ); // // Or this instead? diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.cpp b/minecraft/java/src/InputOutputStream/DataInputStream.cpp similarity index 97% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.cpp rename to minecraft/java/src/InputOutputStream/DataInputStream.cpp index 8c70b3a79..308c926d6 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataInputStream.cpp +++ b/minecraft/java/src/InputOutputStream/DataInputStream.cpp @@ -1,6 +1,4 @@ -#include "../../Header Files/stdafx.h" - -#include "DataInputStream.h" +#include "InputOutputStream/DataInputStream.h" #include #include @@ -17,7 +15,7 @@ DataInputStream::DataInputStream(InputStream* in) : stream(in) {} // result. int DataInputStream::read() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::read() called but underlying stream is " "nullptr\n"); return -1; @@ -52,7 +50,7 @@ int DataInputStream::read() { // data because the end of the stream has been reached. int DataInputStream::read(byteArray b) { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::read(byteArray) called but underlying stream is " "nullptr\n"); return -1; @@ -92,7 +90,7 @@ int DataInputStream::read(byteArray b) { int DataInputStream::read(byteArray b, unsigned int offset, unsigned int length) { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::read(byteArray,offset,length) called but " "underlying stream is nullptr\n"); return -1; @@ -104,7 +102,7 @@ int DataInputStream::read(byteArray b, unsigned int offset, // the stream. This method simply performs in.close() void DataInputStream::close() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::close() called but underlying stream is " "nullptr\n"); return; @@ -117,7 +115,7 @@ void DataInputStream::close() { // writeBoolean method of interface DataOutput. Returns: the bool value read. bool DataInputStream::readBoolean() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readBoolean() but underlying stream is " "nullptr\n"); return false; @@ -131,7 +129,7 @@ bool DataInputStream::readBoolean() { // the 8-bit value read. uint8_t DataInputStream::readByte() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readByte() but underlying stream is nullptr\n"); return 0; } @@ -140,7 +138,7 @@ uint8_t DataInputStream::readByte() { unsigned char DataInputStream::readUnsignedByte() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readUnsignedByte() but underlying stream is " "nullptr\n"); return 0; @@ -156,7 +154,7 @@ unsigned char DataInputStream::readUnsignedByte() { // interface DataOutput. Returns: the char value read. wchar_t DataInputStream::readChar() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readChar() but underlying stream is nullptr\n"); return 0; } @@ -186,7 +184,7 @@ bool DataInputStream::readFully(byteArray b) { // TODO 4J Stu - Need to handle exceptions here is we throw them in other // InputStreams if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readFully(byteArray) but underlying stream is " "nullptr\n"); return false; @@ -208,7 +206,7 @@ bool DataInputStream::readFully(charArray b) { // TODO 4J Stu - Need to handle exceptions here is we throw them in other // InputStreams if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readFully(charArray) but underlying stream is " "nullptr\n"); return false; @@ -257,7 +255,7 @@ float DataInputStream::readFloat() { // interface DataOutput. Returns: the int value read. int DataInputStream::readInt() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readInt() but underlying stream is nullptr\n"); return 0; } @@ -289,7 +287,7 @@ int DataInputStream::readInt() { // the long value read. int64_t DataInputStream::readLong() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readLong() but underlying stream is nullptr\n"); return 0; } @@ -318,7 +316,7 @@ int64_t DataInputStream::readLong() { // method of interface DataOutput. Returns: the 16-bit value read. short DataInputStream::readShort() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readShort() but underlying stream is nullptr\n"); return 0; } @@ -329,7 +327,7 @@ short DataInputStream::readShort() { unsigned short DataInputStream::readUnsignedShort() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readUnsignedShort() but underlying stream is " "nullptr\n"); return 0; @@ -388,7 +386,7 @@ unsigned short DataInputStream::readUnsignedShort() { std::wstring DataInputStream::readUTF() { std::wstring outputString; if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readUTF() but underlying stream is nullptr\n"); return outputString; } @@ -515,7 +513,7 @@ std::wstring DataInputStream::readUTF() { int DataInputStream::readUTFChar() { int returnValue = -1; if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataInputStream::readUTFChar() but underlying stream is " "nullptr\n"); return returnValue; @@ -592,8 +590,8 @@ int DataInputStream::readUTFChar() { } // 4J Added -PlayerUID DataInputStream::readPlayerUID() { - PlayerUID returnValue; +unsigned long long DataInputStream::readPlayerUID() { + unsigned long long returnValue; returnValue = readLong(); return returnValue; } diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.cpp b/minecraft/java/src/InputOutputStream/DataOutputStream.cpp similarity index 97% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.cpp rename to minecraft/java/src/InputOutputStream/DataOutputStream.cpp index 3b14dbfa7..c087ab108 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/DataOutputStream.cpp +++ b/minecraft/java/src/InputOutputStream/DataOutputStream.cpp @@ -1,6 +1,5 @@ -#include "../../Header Files/stdafx.h" -#include "DataOutputStream.h" +#include "InputOutputStream/DataOutputStream.h" #include #include @@ -21,7 +20,7 @@ void DataOutputStream::deleteChildStream() { delete stream; } // - the byte to be written. void DataOutputStream::write(unsigned int b) { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataOutputStream::write(unsigned int) called but underlying " "stream is nullptr\n"); return; @@ -33,7 +32,7 @@ void DataOutputStream::write(unsigned int b) { void DataOutputStream::flush() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataOutputStream::flush() called but underlying stream is " "nullptr\n"); return; @@ -53,7 +52,7 @@ void DataOutputStream::write(byteArray b) { write(b, 0, b.length); } void DataOutputStream::write(byteArray b, unsigned int offset, unsigned int length) { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataOutputStream::write(byteArray,...) called but underlying " "stream is nullptr\n"); return; @@ -68,7 +67,7 @@ void DataOutputStream::write(byteArray b, unsigned int offset, // and then calls the close method of its underlying output stream. void DataOutputStream::close() { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataOutputStream::close() called but underlying stream is " "nullptr\n"); return; @@ -151,7 +150,7 @@ void DataOutputStream::writeShort(short a) { void DataOutputStream::writeUnsignedShort(unsigned short a) { if (stream == nullptr) { - app.DebugPrintf( + fprintf(stderr, "DataOutputStream::writeUnsignedShort() but underlying stream is " "nullptr\n"); return; @@ -256,4 +255,4 @@ void DataOutputStream::writeUTF(const std::wstring& str) { } // 4J Added -void DataOutputStream::writePlayerUID(PlayerUID player) { writeLong(player); } +void DataOutputStream::writePlayerUID(unsigned long long player) { writeLong(player); } diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.cpp b/minecraft/java/src/InputOutputStream/FileInputStream.cpp similarity index 91% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.cpp rename to minecraft/java/src/InputOutputStream/FileInputStream.cpp index 92348c197..33d3325fd 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileInputStream.cpp +++ b/minecraft/java/src/InputOutputStream/FileInputStream.cpp @@ -1,10 +1,9 @@ -#include "../../Header Files/stdafx.h" -#include "../File.h" -#include "FileInputStream.h" +#include "File.h" +#include "InputOutputStream/FileInputStream.h" #include -extern CConsoleMinecraftApp app; +#include "../../../Minecraft.World/ConsoleHelpers/StringHelpers.h" namespace { int64_t FileTell(std::FILE* file) { @@ -50,9 +49,7 @@ FileInputStream::FileInputStream(const File& file) : m_fileHandle(nullptr) { #endif if (m_fileHandle == nullptr) { - // TODO 4J Stu - Any form of error/exception handling - //__debugbreak(); - app.FatalLoadError(); + assert(0); } } @@ -74,9 +71,7 @@ int FileInputStream::read() { const size_t numberOfBytesRead = std::fread(&byteRead, 1, 1, m_fileHandle); if (std::ferror(m_fileHandle) != 0) { - // TODO 4J Stu - Some kind of error handling - app.FatalLoadError(); - // return -1; + assert(0); } else if (numberOfBytesRead == 0) { // File pointer is past the end of the file return -1; @@ -99,9 +94,7 @@ int FileInputStream::read(byteArray b) { std::fread(b.data, 1, b.length, m_fileHandle); if (std::ferror(m_fileHandle) != 0) { - // TODO 4J Stu - Some kind of error handling - app.FatalLoadError(); - // return -1; + assert(0); } else if (numberOfBytesRead == 0) { // File pointer is past the end of the file return -1; @@ -130,9 +123,7 @@ int FileInputStream::read(byteArray b, unsigned int offset, std::fread(&b[offset], 1, length, m_fileHandle); if (std::ferror(m_fileHandle) != 0) { - // TODO 4J Stu - Some kind of error handling - app.FatalLoadError(); - // return -1; + assert(0); } else if (numberOfBytesRead == 0) { // File pointer is past the end of the file return -1; diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.cpp b/minecraft/java/src/InputOutputStream/FileOutputStream.cpp similarity index 96% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.cpp rename to minecraft/java/src/InputOutputStream/FileOutputStream.cpp index e66ce451c..b4ef858c6 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/FileOutputStream.cpp +++ b/minecraft/java/src/InputOutputStream/FileOutputStream.cpp @@ -1,6 +1,7 @@ -#include "../../Header Files/stdafx.h" -#include "../File.h" -#include "FileOutputStream.h" +#include "File.h" +#include "InputOutputStream/FileOutputStream.h" + +#include "../../../Minecraft.World/ConsoleHelpers/ArrayWithLength.h" // 4jcraft TODO // Creates a file output stream to write to the file represented by the // specified File object. A new FileDescriptor object is created to represent diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.cpp b/minecraft/java/src/InputOutputStream/InputStream.cpp similarity index 59% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.cpp rename to minecraft/java/src/InputOutputStream/InputStream.cpp index 7798095f2..d3e1ae195 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStream.cpp +++ b/minecraft/java/src/InputOutputStream/InputStream.cpp @@ -1,7 +1,6 @@ -#include "../../Header Files/stdafx.h" -#include "../File.h" -#include "InputOutputStream.h" -#include "InputStream.h" +#include "File.h" +#include "InputOutputStream/InputOutputStream.h" +#include "InputOutputStream/InputStream.h" InputStream* InputStream::getResourceAsStream(const std::wstring& fileName) { File file(fileName); diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.cpp b/minecraft/java/src/InputOutputStream/InputStreamReader.cpp similarity index 91% rename from minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.cpp rename to minecraft/java/src/InputOutputStream/InputStreamReader.cpp index 77c4223c0..4255bbc5d 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/InputOutputStream/InputStreamReader.cpp +++ b/minecraft/java/src/InputOutputStream/InputStreamReader.cpp @@ -1,8 +1,7 @@ -#include "../../Header Files/stdafx.h" -#include "InputStream.h" -#include "DataInputStream.h" -#include "InputStreamReader.h" +#include "InputOutputStream/InputStream.h" +#include "InputOutputStream/DataInputStream.h" +#include "InputOutputStream/InputStreamReader.h" // Creates an InputStreamReader that uses the default charset. // Parameters: diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/IntBuffer.cpp b/minecraft/java/src/IntBuffer.cpp similarity index 98% rename from minecraft/Minecraft.World/ConsoleJavaLibs/IntBuffer.cpp rename to minecraft/java/src/IntBuffer.cpp index 87c6ccf0a..ccab18458 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/IntBuffer.cpp +++ b/minecraft/java/src/IntBuffer.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "IntBuffer.h" diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/JavaMath.cpp b/minecraft/java/src/JavaMath.cpp similarity index 97% rename from minecraft/Minecraft.World/ConsoleJavaLibs/JavaMath.cpp rename to minecraft/java/src/JavaMath.cpp index 70bb230bc..b39020c45 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/JavaMath.cpp +++ b/minecraft/java/src/JavaMath.cpp @@ -1,7 +1,7 @@ -#include "../Header Files/stdafx.h" - #include "JavaMath.h" +#include + Random Math::rand = Random(); // Returns a double value with a positive sign, greater than or equal to 0.0 and @@ -38,7 +38,7 @@ int64_t Math::round(double d) { // 4jcraft fixes the fact that if double is a huge // number than the cast of d to int64_t overflows - d = floor(d + 0.5); + d = std::floor(d + 0.5); // if smaller or bigger than representable int64 than return the max if (d >= (double)INT64_MAX) { diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/Random.cpp b/minecraft/java/src/Random.cpp similarity index 98% rename from minecraft/Minecraft.World/ConsoleJavaLibs/Random.cpp rename to minecraft/java/src/Random.cpp index 0e305835f..3e828db54 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/Random.cpp +++ b/minecraft/java/src/Random.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "Random.h" #include #include // for int64_t diff --git a/minecraft/Minecraft.World/ConsoleJavaLibs/system.cpp b/minecraft/java/src/system.cpp similarity index 99% rename from minecraft/Minecraft.World/ConsoleJavaLibs/system.cpp rename to minecraft/java/src/system.cpp index 74a4af283..bf24d084d 100644 --- a/minecraft/Minecraft.World/ConsoleJavaLibs/system.cpp +++ b/minecraft/java/src/system.cpp @@ -1,4 +1,3 @@ -#include "../Header Files/stdafx.h" #include "System.h" #if defined(__linux__) #include diff --git a/minecraft/Minecraft.World/com/mojang/nbt/ByteArrayTag.h b/minecraft/nbt/include/nbt/ByteArrayTag.h similarity index 97% rename from minecraft/Minecraft.World/com/mojang/nbt/ByteArrayTag.h rename to minecraft/nbt/include/nbt/ByteArrayTag.h index 35bb29314..27aa6f08c 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/ByteArrayTag.h +++ b/minecraft/nbt/include/nbt/ByteArrayTag.h @@ -1,6 +1,6 @@ #pragma once #include "Tag.h" -#include "../../../ConsoleJavaLibs/System.h" +#include "java/System.h" class ByteArrayTag : public Tag { public: diff --git a/minecraft/Minecraft.World/com/mojang/nbt/ByteTag.h b/minecraft/nbt/include/nbt/ByteTag.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/ByteTag.h rename to minecraft/nbt/include/nbt/ByteTag.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/CompoundTag.h b/minecraft/nbt/include/nbt/CompoundTag.h similarity index 99% rename from minecraft/Minecraft.World/com/mojang/nbt/CompoundTag.h rename to minecraft/nbt/include/nbt/CompoundTag.h index 26fbd90af..0e8587d0a 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/CompoundTag.h +++ b/minecraft/nbt/include/nbt/CompoundTag.h @@ -11,6 +11,8 @@ #include "ByteArrayTag.h" #include "IntArrayTag.h" +#include + class CompoundTag : public Tag { private: std::unordered_map tags; @@ -33,7 +35,6 @@ public: #ifndef _CONTENT_PACKAGE printf("Tried to read NBT tag with too high complexity, depth > %d", MAX_DEPTH); - __debugbreak(); #endif return; } diff --git a/minecraft/Minecraft.World/com/mojang/nbt/DoubleTag.h b/minecraft/nbt/include/nbt/DoubleTag.h similarity index 91% rename from minecraft/Minecraft.World/com/mojang/nbt/DoubleTag.h rename to minecraft/nbt/include/nbt/DoubleTag.h index 7999b7b57..215786c33 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/DoubleTag.h +++ b/minecraft/nbt/include/nbt/DoubleTag.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Tag.h" class DoubleTag : public Tag { diff --git a/minecraft/Minecraft.World/com/mojang/nbt/EndTag.h b/minecraft/nbt/include/nbt/EndTag.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/EndTag.h rename to minecraft/nbt/include/nbt/EndTag.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/FloatTag.h b/minecraft/nbt/include/nbt/FloatTag.h similarity index 91% rename from minecraft/Minecraft.World/com/mojang/nbt/FloatTag.h rename to minecraft/nbt/include/nbt/FloatTag.h index d9b2cb24e..1d96901e5 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/FloatTag.h +++ b/minecraft/nbt/include/nbt/FloatTag.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "Tag.h" class FloatTag : public Tag { diff --git a/minecraft/Minecraft.World/com/mojang/nbt/IntArrayTag.h b/minecraft/nbt/include/nbt/IntArrayTag.h similarity index 97% rename from minecraft/Minecraft.World/com/mojang/nbt/IntArrayTag.h rename to minecraft/nbt/include/nbt/IntArrayTag.h index 40420b3e2..2658f399d 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/IntArrayTag.h +++ b/minecraft/nbt/include/nbt/IntArrayTag.h @@ -1,7 +1,7 @@ #pragma once #include "Tag.h" -#include "../../../ConsoleJavaLibs/System.h" +#include "java/System.h" class IntArrayTag : public Tag { public: diff --git a/minecraft/Minecraft.World/com/mojang/nbt/IntTag.h b/minecraft/nbt/include/nbt/IntTag.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/IntTag.h rename to minecraft/nbt/include/nbt/IntTag.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/ListTag.h b/minecraft/nbt/include/nbt/ListTag.h similarity index 99% rename from minecraft/Minecraft.World/com/mojang/nbt/ListTag.h rename to minecraft/nbt/include/nbt/ListTag.h index 3177964de..c6b76d7ae 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/ListTag.h +++ b/minecraft/nbt/include/nbt/ListTag.h @@ -1,6 +1,8 @@ #pragma once #include "Tag.h" +#include + template class ListTag : public Tag { private: @@ -29,7 +31,6 @@ public: #ifndef _CONTENT_PACKAGE printf("Tried to read NBT tag with too high complexity, depth > %d", MAX_DEPTH); - __debugbreak(); #endif return; } diff --git a/minecraft/Minecraft.World/com/mojang/nbt/LongTag.h b/minecraft/nbt/include/nbt/LongTag.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/LongTag.h rename to minecraft/nbt/include/nbt/LongTag.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/NbtIo.h b/minecraft/nbt/include/nbt/NbtIo.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/NbtIo.h rename to minecraft/nbt/include/nbt/NbtIo.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/ShortTag.h b/minecraft/nbt/include/nbt/ShortTag.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/ShortTag.h rename to minecraft/nbt/include/nbt/ShortTag.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/StringTag.h b/minecraft/nbt/include/nbt/StringTag.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/StringTag.h rename to minecraft/nbt/include/nbt/StringTag.h diff --git a/minecraft/Minecraft.World/com/mojang/nbt/Tag.h b/minecraft/nbt/include/nbt/Tag.h similarity index 95% rename from minecraft/Minecraft.World/com/mojang/nbt/Tag.h rename to minecraft/nbt/include/nbt/Tag.h index 3c32df1c1..a044eab18 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/Tag.h +++ b/minecraft/nbt/include/nbt/Tag.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" class Tag { public: diff --git a/minecraft/Minecraft.World/com/mojang/nbt/com.mojang.nbt.h b/minecraft/nbt/include/nbt/com.mojang.nbt.h similarity index 100% rename from minecraft/Minecraft.World/com/mojang/nbt/com.mojang.nbt.h rename to minecraft/nbt/include/nbt/com.mojang.nbt.h diff --git a/minecraft/nbt/meson.build b/minecraft/nbt/meson.build new file mode 100644 index 000000000..893a82c6b --- /dev/null +++ b/minecraft/nbt/meson.build @@ -0,0 +1,16 @@ +nbt_sources = files( + 'src/NbtIo.cpp', + 'src/Tag.cpp', +) + +lib_nbt = static_library('nbt', + nbt_sources, + dependencies: [java_dep], + include_directories : include_directories('include/nbt'), + cpp_args : global_cpp_args + global_cpp_defs, +) + +nbt_dep = declare_dependency( + link_with : lib_nbt, + include_directories : include_directories('include'), +) diff --git a/minecraft/Minecraft.World/com/mojang/nbt/NbtIo.cpp b/minecraft/nbt/src/NbtIo.cpp similarity index 93% rename from minecraft/Minecraft.World/com/mojang/nbt/NbtIo.cpp rename to minecraft/nbt/src/NbtIo.cpp index eda1841ec..568b4ed3b 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/NbtIo.cpp +++ b/minecraft/nbt/src/NbtIo.cpp @@ -1,15 +1,14 @@ -#include "../../../Header Files/stdafx.h" -#include "../../../ConsoleJavaLibs/InputOutputStream/InputOutputStream.h" +#include "java/InputOutputStream/InputOutputStream.h" #include "NbtIo.h" CompoundTag* NbtIo::readCompressed(InputStream* in) { - MemSect(26); + // MemSect(26); // 4J - this was using a try/finally block DataInputStream dis = DataInputStream(in); // 4J - was new GZIPInputStream as well CompoundTag* ret = NbtIo::read((DataInput*)&dis); dis.close(); - MemSect(0); + // MemSect(0); return ret; } diff --git a/minecraft/Minecraft.World/com/mojang/nbt/Tag.cpp b/minecraft/nbt/src/Tag.cpp similarity index 96% rename from minecraft/Minecraft.World/com/mojang/nbt/Tag.cpp rename to minecraft/nbt/src/Tag.cpp index 8d7f89bce..a7ce5f6f2 100644 --- a/minecraft/Minecraft.World/com/mojang/nbt/Tag.cpp +++ b/minecraft/nbt/src/Tag.cpp @@ -1,4 +1,3 @@ -#include "../../../Header Files/stdafx.h" #include "Tag.h" #include "EndTag.h" #include "ByteTag.h" @@ -12,6 +11,8 @@ #include "ListTag.h" #include "CompoundTag.h" +#include + Tag::Tag(const std::wstring& name) { if (name.empty()) { this->name = L""; @@ -70,10 +71,7 @@ Tag* Tag::readNamedTag(DataInput* dis, int tagDepth) { // 4J Stu - readByte can return -1, so if it's that then also mark as the // end tag if (static_cast(type) == 255) { - app.DebugPrintf("readNamedTag read a type of 255\n"); -#ifndef _CONTENT_PACKAGE - __debugbreak(); -#endif + fprintf(stderr, "readNamedTag read a type of 255\n"); return new EndTag(); }