restore include paths for cross-platform builds because i messed absolutely every #include up. dont worry that everything is modified, all i did was normalize line endings because CLRF snuck into the repo and this prevents fake diffs

This commit is contained in:
2026-03-24 19:07:55 -04:00
parent 7d485fdcd7
commit bfecad40be
1340 changed files with 264990 additions and 264996 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="com/mojang/minecraftpe/Minecraft_Verizon.java|com/mojang/minecraftpe/stats/|com/mojang/minecraftpe/Receiver.java|com/mojang/minecraftpe/Minecraft_Market.java" kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="com/mojang/minecraftpe/Minecraft_Verizon.java|com/mojang/minecraftpe/stats/|com/mojang/minecraftpe/Receiver.java|com/mojang/minecraftpe/Minecraft_Market.java" kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MinecraftPocketEdition</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MinecraftPocketEdition</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -1,19 +1,19 @@
<!-- Verizon VCAST -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.START_BACKGROUND_SERVICE"/>
<uses-permission android:name="com.verizon.vcast.apps.VCAST_APPS_LICENSE_SERVICE"/>
android:debuggable="true"
<!-- Android MARKET -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-library android:name="xperiaplaycertified" android:required="false"/>
<receiver android:name="com.mojang.minecraftpe.Receiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- Verizon VCAST -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.START_BACKGROUND_SERVICE"/>
<uses-permission android:name="com.verizon.vcast.apps.VCAST_APPS_LICENSE_SERVICE"/>
android:debuggable="true"
<!-- Android MARKET -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-library android:name="xperiaplaycertified" android:required="false"/>
<receiver android:name="com.mojang.minecraftpe.Receiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

File diff suppressed because it is too large Load Diff

View File

@@ -1,281 +1,281 @@
LOCAL_PATH := $(call my-dir)
# Convert Windows backslashes to forward slashes so NDK toolchain doesnt treat them as escapes.
LOCAL_PATH := $(subst \,/,$(LOCAL_PATH))
include $(CLEAR_VARS)
LOCAL_MODULE := minecraftpe
LOCAL_SRC_FILES := ../../../src/main.cpp \
../../../src/main_android_java.cpp \
../../../src/platform/audio/SoundSystemSL.cpp \
../../../src/platform/input/Controller.cpp \
../../../src/platform/input/Keyboard.cpp \
../../../src/platform/input/Mouse.cpp \
../../../src/platform/input/Multitouch.cpp \
../../../src/platform/time.cpp \
../../../src/platform/CThread.cpp \
../../../src/platform/HttpClient.cpp \
../../../src/NinecraftApp.cpp \
../../../src/Performance.cpp \
../../../src/SharedConstants.cpp \
../../../src/client/IConfigListener.cpp \
../../../src/client/Minecraft.cpp \
../../../src/client/MouseHandler.cpp \
../../../src/client/Options.cpp \
../../../src/client/OptionsFile.cpp \
../../../src/client/OptionStrings.cpp \
../../../src/client/Option.cpp \
../../../src/client/gamemode/GameMode.cpp \
../../../src/client/gamemode/CreativeMode.cpp \
../../../src/client/gamemode/SurvivalMode.cpp \
../../../src/client/gui/components/Button.cpp \
../../../src/client/gui/components/GuiElement.cpp \
../../../src/client/gui/components/GuiElementContainer.cpp \
../../../src/client/gui/components/ImageButton.cpp \
../../../src/client/gui/components/ItemPane.cpp \
../../../src/client/gui/components/InventoryPane.cpp \
../../../src/client/gui/components/LargeImageButton.cpp \
../../../src/client/gui/components/NinePatch.cpp \
../../../src/client/gui/components/OptionsGroup.cpp \
../../../src/client/gui/components/OptionsItem.cpp \
../../../src/client/gui/components/KeyOption.cpp \
../../../src/client/gui/components/TextOption.cpp \
../../../src/client/gui/components/RolledSelectionListH.cpp \
../../../src/client/gui/components/RolledSelectionListV.cpp \
../../../src/client/gui/components/ScrolledSelectionList.cpp \
../../../src/client/gui/components/ScrollingPane.cpp \
../../../src/client/gui/components/Slider.cpp \
../../../src/client/gui/components/TextBox.cpp \
../../../src/client/gui/Font.cpp \
../../../src/client/gui/Gui.cpp \
../../../src/client/gui/GuiComponent.cpp \
../../../src/client/gui/Screen.cpp \
../../../src/client/gui/screens/ScreenChooser.cpp \
../../../src/client/gui/screens/ArmorScreen.cpp \
../../../src/client/gui/screens/ChatScreen.cpp \
../../../src/client/gui/screens/ChooseLevelScreen.cpp \
../../../src/client/gui/screens/SimpleChooseLevelScreen.cpp \
../../../src/client/gui/screens/ConsoleScreen.cpp \
../../../src/client/gui/screens/UsernameScreen.cpp \
../../../src/client/gui/screens/ConfirmScreen.cpp \
../../../src/client/gui/screens/ChestScreen.cpp \
../../../src/client/gui/screens/DeathScreen.cpp \
../../../src/client/gui/screens/FurnaceScreen.cpp \
../../../src/client/gui/screens/InBedScreen.cpp \
../../../src/client/gui/screens/IngameBlockSelectionScreen.cpp \
../../../src/client/gui/screens/JoinGameScreen.cpp \
../../../src/client/gui/screens/OptionsScreen.cpp \
../../../src/client/gui/screens/CreditsScreen.cpp \
../../../src/client/gui/screens/PauseScreen.cpp \
../../../src/client/gui/screens/ProgressScreen.cpp \
../../../src/client/gui/screens/RenameMPLevelScreen.cpp \
../../../src/client/gui/screens/SelectWorldScreen.cpp \
../../../src/client/gui/screens/StartMenuScreen.cpp \
../../../src/client/gui/screens/TextEditScreen.cpp \
../../../src/client/gui/screens/JoinByIPScreen.cpp \
../../../src/client/gui/screens/touch/TouchIngameBlockSelectionScreen.cpp \
../../../src/client/gui/screens/touch/TouchJoinGameScreen.cpp \
../../../src/client/gui/screens/touch/TouchSelectWorldScreen.cpp \
../../../src/client/gui/screens/touch/TouchStartMenuScreen.cpp \
../../../src/client/gui/screens/UploadPhotoScreen.cpp \
../../../src/client/gui/screens/crafting/CraftingFilters.cpp \
../../../src/client/gui/screens/crafting/PaneCraftingScreen.cpp \
../../../src/client/gui/screens/crafting/StonecutterScreen.cpp \
../../../src/client/gui/screens/crafting/WorkbenchScreen.cpp \
../../../src/client/model/ChickenModel.cpp \
../../../src/client/model/CowModel.cpp \
../../../src/client/model/HumanoidModel.cpp \
../../../src/client/model/PigModel.cpp \
../../../src/client/model/SheepFurModel.cpp \
../../../src/client/model/SheepModel.cpp \
../../../src/client/model/QuadrupedModel.cpp \
../../../src/client/model/geom/Cube.cpp \
../../../src/client/model/geom/ModelPart.cpp \
../../../src/client/model/geom/Polygon.cpp \
../../../src/client/particle/Particle.cpp \
../../../src/client/particle/ParticleEngine.cpp \
../../../src/client/player/LocalPlayer.cpp \
../../../src/client/player/RemotePlayer.cpp \
../../../src/client/player/input/KeyboardInput.cpp \
../../../src/client/player/input/touchscreen/TouchscreenInput.cpp \
../../../src/client/renderer/Chunk.cpp \
../../../src/client/renderer/EntityTileRenderer.cpp \
../../../src/client/renderer/GameRenderer.cpp \
../../../src/client/renderer/ItemInHandRenderer.cpp \
../../../src/client/renderer/LevelRenderer.cpp \
../../../src/client/renderer/RenderChunk.cpp \
../../../src/client/renderer/RenderList.cpp \
../../../src/client/renderer/Tesselator.cpp \
../../../src/client/renderer/Textures.cpp \
../../../src/client/renderer/TileRenderer.cpp \
../../../src/client/renderer/gles.cpp \
../../../src/client/renderer/culling/Frustum.cpp \
../../../src/client/renderer/entity/ArrowRenderer.cpp \
../../../src/client/renderer/entity/ChickenRenderer.cpp \
../../../src/client/renderer/entity/EntityRenderDispatcher.cpp \
../../../src/client/renderer/entity/EntityRenderer.cpp \
../../../src/client/renderer/entity/FallingTileRenderer.cpp \
../../../src/client/renderer/entity/HumanoidMobRenderer.cpp \
../../../src/client/renderer/entity/ItemRenderer.cpp \
../../../src/client/renderer/entity/ItemSpriteRenderer.cpp \
../../../src/client/renderer/entity/MobRenderer.cpp \
../../../src/client/renderer/entity/PaintingRenderer.cpp \
../../../src/client/renderer/entity/PlayerRenderer.cpp \
../../../src/client/renderer/entity/SheepRenderer.cpp \
../../../src/client/renderer/entity/TntRenderer.cpp \
../../../src/client/renderer/entity/TripodCameraRenderer.cpp \
../../../src/client/renderer/ptexture/DynamicTexture.cpp \
../../../src/client/renderer/tileentity/ChestRenderer.cpp \
../../../src/client/renderer/tileentity/SignRenderer.cpp \
../../../src/client/renderer/tileentity/TileEntityRenderDispatcher.cpp \
../../../src/client/renderer/tileentity/TileEntityRenderer.cpp \
../../../src/client/sound/Sound.cpp \
../../../src/client/sound/SoundEngine.cpp \
../../../src/locale/I18n.cpp \
../../../src/nbt/Tag.cpp \
../../../src/network/command/CommandServer.cpp \
../../../src/network/ClientSideNetworkHandler.cpp \
../../../src/network/NetEventCallback.cpp \
../../../src/network/Packet.cpp \
../../../src/network/RakNetInstance.cpp \
../../../src/network/ServerSideNetworkHandler.cpp \
../../../src/server/ServerLevel.cpp \
../../../src/server/ServerPlayer.cpp \
../../../src/util/DataIO.cpp \
../../../src/util/Mth.cpp \
../../../src/util/StringUtils.cpp \
../../../src/util/PerfTimer.cpp \
../../../src/util/PerfRenderer.cpp \
../../../src/world/Direction.cpp \
../../../src/world/entity/AgableMob.cpp \
../../../src/world/entity/Entity.cpp \
../../../src/world/entity/EntityFactory.cpp \
../../../src/world/entity/FlyingMob.cpp \
../../../src/world/entity/HangingEntity.cpp \
../../../src/world/entity/Mob.cpp \
../../../src/world/entity/MobCategory.cpp \
../../../src/world/entity/Motive.cpp \
../../../src/world/entity/Painting.cpp \
../../../src/world/entity/PathfinderMob.cpp \
../../../src/world/entity/SynchedEntityData.cpp \
../../../src/world/entity/ai/control/MoveControl.cpp \
../../../src/world/entity/animal/Animal.cpp \
../../../src/world/entity/animal/Chicken.cpp \
../../../src/world/entity/animal/Cow.cpp \
../../../src/world/entity/animal/Pig.cpp \
../../../src/world/entity/animal/Sheep.cpp \
../../../src/world/entity/animal/WaterAnimal.cpp \
../../../src/world/entity/item/FallingTile.cpp \
../../../src/world/entity/item/ItemEntity.cpp \
../../../src/world/entity/item/PrimedTnt.cpp \
../../../src/world/entity/item/TripodCamera.cpp \
../../../src/world/entity/monster/Creeper.cpp \
../../../src/world/entity/monster/Monster.cpp \
../../../src/world/entity/monster/PigZombie.cpp \
../../../src/world/entity/monster/Skeleton.cpp \
../../../src/world/entity/monster/Spider.cpp \
../../../src/world/entity/monster/Zombie.cpp \
../../../src/world/entity/projectile/Arrow.cpp \
../../../src/world/entity/projectile/Throwable.cpp \
../../../src/world/entity/player/Inventory.cpp \
../../../src/world/entity/player/Player.cpp \
../../../src/world/food/SimpleFoodData.cpp \
../../../src/world/inventory/BaseContainerMenu.cpp \
../../../src/world/inventory/ContainerMenu.cpp \
../../../src/world/inventory/FillingContainer.cpp \
../../../src/world/inventory/FurnaceMenu.cpp \
../../../src/world/item/ArmorItem.cpp \
../../../src/world/item/BedItem.cpp \
../../../src/world/item/DyePowderItem.cpp \
../../../src/world/item/Item.cpp \
../../../src/world/item/ItemInstance.cpp \
../../../src/world/item/HangingEntityItem.cpp \
../../../src/world/item/HatchetItem.cpp \
../../../src/world/item/HoeItem.cpp \
../../../src/world/item/PickaxeItem.cpp \
../../../src/world/item/ShovelItem.cpp \
../../../src/world/item/crafting/ArmorRecipes.cpp \
../../../src/world/item/crafting/Recipe.cpp \
../../../src/world/item/crafting/Recipes.cpp \
../../../src/world/item/crafting/FurnaceRecipes.cpp \
../../../src/world/item/crafting/OreRecipes.cpp \
../../../src/world/item/crafting/StructureRecipes.cpp \
../../../src/world/item/crafting/ToolRecipes.cpp \
../../../src/world/item/crafting/WeaponRecipes.cpp \
../../../src/world/level/Explosion.cpp \
../../../src/world/level/Level.cpp \
../../../src/world/level/LightLayer.cpp \
../../../src/world/level/LightUpdate.cpp \
../../../src/world/level/MobSpawner.cpp \
../../../src/world/level/Region.cpp \
../../../src/world/level/TickNextTickData.cpp \
../../../src/world/level/biome/Biome.cpp \
../../../src/world/level/biome/BiomeSource.cpp \
../../../src/world/level/chunk/LevelChunk.cpp \
../../../src/world/level/dimension/Dimension.cpp \
../../../src/world/level/levelgen/CanyonFeature.cpp \
../../../src/world/level/levelgen/DungeonFeature.cpp \
../../../src/world/level/levelgen/LargeCaveFeature.cpp \
../../../src/world/level/levelgen/LargeFeature.cpp \
../../../src/world/level/levelgen/RandomLevelSource.cpp \
../../../src/world/level/levelgen/feature/Feature.cpp \
../../../src/world/level/levelgen/synth/ImprovedNoise.cpp \
../../../src/world/level/levelgen/synth/PerlinNoise.cpp \
../../../src/world/level/levelgen/synth/Synth.cpp \
../../../src/world/level/material/Material.cpp \
../../../src/world/level/pathfinder/Path.cpp \
../../../src/world/level/storage/ExternalFileLevelStorage.cpp \
../../../src/world/level/storage/ExternalFileLevelStorageSource.cpp \
../../../src/world/level/storage/FolderMethods.cpp \
../../../src/world/level/storage/LevelData.cpp \
../../../src/world/level/storage/LevelStorageSource.cpp \
../../../src/world/level/storage/RegionFile.cpp \
../../../src/world/level/tile/BedTile.cpp \
../../../src/world/level/tile/ChestTile.cpp \
../../../src/world/level/tile/CropTile.cpp \
../../../src/world/level/tile/DoorTile.cpp \
../../../src/world/level/tile/EntityTile.cpp \
../../../src/world/level/tile/FurnaceTile.cpp \
../../../src/world/level/tile/GrassTile.cpp \
../../../src/world/level/tile/HeavyTile.cpp \
../../../src/world/level/tile/LightGemTile.cpp \
../../../src/world/level/tile/MelonTile.cpp \
../../../src/world/level/tile/Mushroom.cpp \
../../../src/world/level/tile/NetherReactor.cpp \
../../../src/world/level/tile/NetherReactorPattern.cpp \
../../../src/world/level/tile/StairTile.cpp \
../../../src/world/level/tile/StemTile.cpp \
../../../src/world/level/tile/StoneSlabTile.cpp \
../../../src/world/level/tile/TallGrass.cpp \
../../../src/world/level/tile/Tile.cpp \
../../../src/world/level/tile/TrapDoorTile.cpp \
../../../src/world/level/tile/entity/ChestTileEntity.cpp \
../../../src/world/level/tile/entity/NetherReactorTileEntity.cpp \
../../../src/world/level/tile/entity/SignTileEntity.cpp \
../../../src/world/level/tile/entity/TileEntity.cpp \
../../../src/world/level/tile/entity/FurnaceTileEntity.cpp \
../../../src/world/phys/HitResult.cpp
LOCAL_CFLAGS := -DPLATFORM_ANDROID -DPRE_ANDROID23 -Wno-narrowing $(LOCAL_CFLAGS)
LOCAL_CPPFLAGS := -std=c++14 -frtti
LOCAL_CPPFLAGS += -frtti
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../src
#LOCAL_CFLAGS := -DANDROID_PUBLISH -DDEMO_MODE $(LOCAL_CFLAGS)
#LOCAL_CFLAGS := -DANDROID_PUBLISH $(LOCAL_CFLAGS)
#LOCAL_CFLAGS := -DDEMO_MODE -DGLDEBUG $(LOCAL_CFLAGS)
#LOCAL_CFLAGS := -DGLDEBUG $(LOCAL_CFLAGS)
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lOpenSLES
LOCAL_STATIC_LIBRARIES := android_native_app_glue RakNet
#LOCAL_CPP_FEATURES := exceptions
TARGET_ARCH_ABI := armeabi-v7a
include $(BUILD_SHARED_LIBRARY)
# NOTE: environment var NDK_MODULE_PATH needs to point to lib_projects folder
$(call import-module,android/native_app_glue)
$(call import-module, raknet/jni)
LOCAL_PATH := $(call my-dir)
# Convert Windows backslashes to forward slashes so NDK toolchain doesnt treat them as escapes.
LOCAL_PATH := $(subst \,/,$(LOCAL_PATH))
include $(CLEAR_VARS)
LOCAL_MODULE := minecraftpe
LOCAL_SRC_FILES := ../../../src/main.cpp \
../../../src/main_android_java.cpp \
../../../src/platform/audio/SoundSystemSL.cpp \
../../../src/platform/input/Controller.cpp \
../../../src/platform/input/Keyboard.cpp \
../../../src/platform/input/Mouse.cpp \
../../../src/platform/input/Multitouch.cpp \
../../../src/platform/time.cpp \
../../../src/platform/CThread.cpp \
../../../src/platform/HttpClient.cpp \
../../../src/NinecraftApp.cpp \
../../../src/Performance.cpp \
../../../src/SharedConstants.cpp \
../../../src/client/IConfigListener.cpp \
../../../src/client/Minecraft.cpp \
../../../src/client/MouseHandler.cpp \
../../../src/client/Options.cpp \
../../../src/client/OptionsFile.cpp \
../../../src/client/OptionStrings.cpp \
../../../src/client/Option.cpp \
../../../src/client/gamemode/GameMode.cpp \
../../../src/client/gamemode/CreativeMode.cpp \
../../../src/client/gamemode/SurvivalMode.cpp \
../../../src/client/gui/components/Button.cpp \
../../../src/client/gui/components/GuiElement.cpp \
../../../src/client/gui/components/GuiElementContainer.cpp \
../../../src/client/gui/components/ImageButton.cpp \
../../../src/client/gui/components/ItemPane.cpp \
../../../src/client/gui/components/InventoryPane.cpp \
../../../src/client/gui/components/LargeImageButton.cpp \
../../../src/client/gui/components/NinePatch.cpp \
../../../src/client/gui/components/OptionsGroup.cpp \
../../../src/client/gui/components/OptionsItem.cpp \
../../../src/client/gui/components/KeyOption.cpp \
../../../src/client/gui/components/TextOption.cpp \
../../../src/client/gui/components/RolledSelectionListH.cpp \
../../../src/client/gui/components/RolledSelectionListV.cpp \
../../../src/client/gui/components/ScrolledSelectionList.cpp \
../../../src/client/gui/components/ScrollingPane.cpp \
../../../src/client/gui/components/Slider.cpp \
../../../src/client/gui/components/TextBox.cpp \
../../../src/client/gui/Font.cpp \
../../../src/client/gui/Gui.cpp \
../../../src/client/gui/GuiComponent.cpp \
../../../src/client/gui/Screen.cpp \
../../../src/client/gui/screens/ScreenChooser.cpp \
../../../src/client/gui/screens/ArmorScreen.cpp \
../../../src/client/gui/screens/ChatScreen.cpp \
../../../src/client/gui/screens/ChooseLevelScreen.cpp \
../../../src/client/gui/screens/SimpleChooseLevelScreen.cpp \
../../../src/client/gui/screens/ConsoleScreen.cpp \
../../../src/client/gui/screens/UsernameScreen.cpp \
../../../src/client/gui/screens/ConfirmScreen.cpp \
../../../src/client/gui/screens/ChestScreen.cpp \
../../../src/client/gui/screens/DeathScreen.cpp \
../../../src/client/gui/screens/FurnaceScreen.cpp \
../../../src/client/gui/screens/InBedScreen.cpp \
../../../src/client/gui/screens/IngameBlockSelectionScreen.cpp \
../../../src/client/gui/screens/JoinGameScreen.cpp \
../../../src/client/gui/screens/OptionsScreen.cpp \
../../../src/client/gui/screens/CreditsScreen.cpp \
../../../src/client/gui/screens/PauseScreen.cpp \
../../../src/client/gui/screens/ProgressScreen.cpp \
../../../src/client/gui/screens/RenameMPLevelScreen.cpp \
../../../src/client/gui/screens/SelectWorldScreen.cpp \
../../../src/client/gui/screens/StartMenuScreen.cpp \
../../../src/client/gui/screens/TextEditScreen.cpp \
../../../src/client/gui/screens/JoinByIPScreen.cpp \
../../../src/client/gui/screens/touch/TouchIngameBlockSelectionScreen.cpp \
../../../src/client/gui/screens/touch/TouchJoinGameScreen.cpp \
../../../src/client/gui/screens/touch/TouchSelectWorldScreen.cpp \
../../../src/client/gui/screens/touch/TouchStartMenuScreen.cpp \
../../../src/client/gui/screens/UploadPhotoScreen.cpp \
../../../src/client/gui/screens/crafting/CraftingFilters.cpp \
../../../src/client/gui/screens/crafting/PaneCraftingScreen.cpp \
../../../src/client/gui/screens/crafting/StonecutterScreen.cpp \
../../../src/client/gui/screens/crafting/WorkbenchScreen.cpp \
../../../src/client/model/ChickenModel.cpp \
../../../src/client/model/CowModel.cpp \
../../../src/client/model/HumanoidModel.cpp \
../../../src/client/model/PigModel.cpp \
../../../src/client/model/SheepFurModel.cpp \
../../../src/client/model/SheepModel.cpp \
../../../src/client/model/QuadrupedModel.cpp \
../../../src/client/model/geom/Cube.cpp \
../../../src/client/model/geom/ModelPart.cpp \
../../../src/client/model/geom/Polygon.cpp \
../../../src/client/particle/Particle.cpp \
../../../src/client/particle/ParticleEngine.cpp \
../../../src/client/player/LocalPlayer.cpp \
../../../src/client/player/RemotePlayer.cpp \
../../../src/client/player/input/KeyboardInput.cpp \
../../../src/client/player/input/touchscreen/TouchscreenInput.cpp \
../../../src/client/renderer/Chunk.cpp \
../../../src/client/renderer/EntityTileRenderer.cpp \
../../../src/client/renderer/GameRenderer.cpp \
../../../src/client/renderer/ItemInHandRenderer.cpp \
../../../src/client/renderer/LevelRenderer.cpp \
../../../src/client/renderer/RenderChunk.cpp \
../../../src/client/renderer/RenderList.cpp \
../../../src/client/renderer/Tesselator.cpp \
../../../src/client/renderer/Textures.cpp \
../../../src/client/renderer/TileRenderer.cpp \
../../../src/client/renderer/gles.cpp \
../../../src/client/renderer/culling/Frustum.cpp \
../../../src/client/renderer/entity/ArrowRenderer.cpp \
../../../src/client/renderer/entity/ChickenRenderer.cpp \
../../../src/client/renderer/entity/EntityRenderDispatcher.cpp \
../../../src/client/renderer/entity/EntityRenderer.cpp \
../../../src/client/renderer/entity/FallingTileRenderer.cpp \
../../../src/client/renderer/entity/HumanoidMobRenderer.cpp \
../../../src/client/renderer/entity/ItemRenderer.cpp \
../../../src/client/renderer/entity/ItemSpriteRenderer.cpp \
../../../src/client/renderer/entity/MobRenderer.cpp \
../../../src/client/renderer/entity/PaintingRenderer.cpp \
../../../src/client/renderer/entity/PlayerRenderer.cpp \
../../../src/client/renderer/entity/SheepRenderer.cpp \
../../../src/client/renderer/entity/TntRenderer.cpp \
../../../src/client/renderer/entity/TripodCameraRenderer.cpp \
../../../src/client/renderer/ptexture/DynamicTexture.cpp \
../../../src/client/renderer/tileentity/ChestRenderer.cpp \
../../../src/client/renderer/tileentity/SignRenderer.cpp \
../../../src/client/renderer/tileentity/TileEntityRenderDispatcher.cpp \
../../../src/client/renderer/tileentity/TileEntityRenderer.cpp \
../../../src/client/sound/Sound.cpp \
../../../src/client/sound/SoundEngine.cpp \
../../../src/locale/I18n.cpp \
../../../src/nbt/Tag.cpp \
../../../src/network/command/CommandServer.cpp \
../../../src/network/ClientSideNetworkHandler.cpp \
../../../src/network/NetEventCallback.cpp \
../../../src/network/Packet.cpp \
../../../src/network/RakNetInstance.cpp \
../../../src/network/ServerSideNetworkHandler.cpp \
../../../src/server/ServerLevel.cpp \
../../../src/server/ServerPlayer.cpp \
../../../src/util/DataIO.cpp \
../../../src/util/Mth.cpp \
../../../src/util/StringUtils.cpp \
../../../src/util/PerfTimer.cpp \
../../../src/util/PerfRenderer.cpp \
../../../src/world/Direction.cpp \
../../../src/world/entity/AgableMob.cpp \
../../../src/world/entity/Entity.cpp \
../../../src/world/entity/EntityFactory.cpp \
../../../src/world/entity/FlyingMob.cpp \
../../../src/world/entity/HangingEntity.cpp \
../../../src/world/entity/Mob.cpp \
../../../src/world/entity/MobCategory.cpp \
../../../src/world/entity/Motive.cpp \
../../../src/world/entity/Painting.cpp \
../../../src/world/entity/PathfinderMob.cpp \
../../../src/world/entity/SynchedEntityData.cpp \
../../../src/world/entity/ai/control/MoveControl.cpp \
../../../src/world/entity/animal/Animal.cpp \
../../../src/world/entity/animal/Chicken.cpp \
../../../src/world/entity/animal/Cow.cpp \
../../../src/world/entity/animal/Pig.cpp \
../../../src/world/entity/animal/Sheep.cpp \
../../../src/world/entity/animal/WaterAnimal.cpp \
../../../src/world/entity/item/FallingTile.cpp \
../../../src/world/entity/item/ItemEntity.cpp \
../../../src/world/entity/item/PrimedTnt.cpp \
../../../src/world/entity/item/TripodCamera.cpp \
../../../src/world/entity/monster/Creeper.cpp \
../../../src/world/entity/monster/Monster.cpp \
../../../src/world/entity/monster/PigZombie.cpp \
../../../src/world/entity/monster/Skeleton.cpp \
../../../src/world/entity/monster/Spider.cpp \
../../../src/world/entity/monster/Zombie.cpp \
../../../src/world/entity/projectile/Arrow.cpp \
../../../src/world/entity/projectile/Throwable.cpp \
../../../src/world/entity/player/Inventory.cpp \
../../../src/world/entity/player/Player.cpp \
../../../src/world/food/SimpleFoodData.cpp \
../../../src/world/inventory/BaseContainerMenu.cpp \
../../../src/world/inventory/ContainerMenu.cpp \
../../../src/world/inventory/FillingContainer.cpp \
../../../src/world/inventory/FurnaceMenu.cpp \
../../../src/world/item/ArmorItem.cpp \
../../../src/world/item/BedItem.cpp \
../../../src/world/item/DyePowderItem.cpp \
../../../src/world/item/Item.cpp \
../../../src/world/item/ItemInstance.cpp \
../../../src/world/item/HangingEntityItem.cpp \
../../../src/world/item/HatchetItem.cpp \
../../../src/world/item/HoeItem.cpp \
../../../src/world/item/PickaxeItem.cpp \
../../../src/world/item/ShovelItem.cpp \
../../../src/world/item/crafting/ArmorRecipes.cpp \
../../../src/world/item/crafting/Recipe.cpp \
../../../src/world/item/crafting/Recipes.cpp \
../../../src/world/item/crafting/FurnaceRecipes.cpp \
../../../src/world/item/crafting/OreRecipes.cpp \
../../../src/world/item/crafting/StructureRecipes.cpp \
../../../src/world/item/crafting/ToolRecipes.cpp \
../../../src/world/item/crafting/WeaponRecipes.cpp \
../../../src/world/level/Explosion.cpp \
../../../src/world/level/Level.cpp \
../../../src/world/level/LightLayer.cpp \
../../../src/world/level/LightUpdate.cpp \
../../../src/world/level/MobSpawner.cpp \
../../../src/world/level/Region.cpp \
../../../src/world/level/TickNextTickData.cpp \
../../../src/world/level/biome/Biome.cpp \
../../../src/world/level/biome/BiomeSource.cpp \
../../../src/world/level/chunk/LevelChunk.cpp \
../../../src/world/level/dimension/Dimension.cpp \
../../../src/world/level/levelgen/CanyonFeature.cpp \
../../../src/world/level/levelgen/DungeonFeature.cpp \
../../../src/world/level/levelgen/LargeCaveFeature.cpp \
../../../src/world/level/levelgen/LargeFeature.cpp \
../../../src/world/level/levelgen/RandomLevelSource.cpp \
../../../src/world/level/levelgen/feature/Feature.cpp \
../../../src/world/level/levelgen/synth/ImprovedNoise.cpp \
../../../src/world/level/levelgen/synth/PerlinNoise.cpp \
../../../src/world/level/levelgen/synth/Synth.cpp \
../../../src/world/level/material/Material.cpp \
../../../src/world/level/pathfinder/Path.cpp \
../../../src/world/level/storage/ExternalFileLevelStorage.cpp \
../../../src/world/level/storage/ExternalFileLevelStorageSource.cpp \
../../../src/world/level/storage/FolderMethods.cpp \
../../../src/world/level/storage/LevelData.cpp \
../../../src/world/level/storage/LevelStorageSource.cpp \
../../../src/world/level/storage/RegionFile.cpp \
../../../src/world/level/tile/BedTile.cpp \
../../../src/world/level/tile/ChestTile.cpp \
../../../src/world/level/tile/CropTile.cpp \
../../../src/world/level/tile/DoorTile.cpp \
../../../src/world/level/tile/EntityTile.cpp \
../../../src/world/level/tile/FurnaceTile.cpp \
../../../src/world/level/tile/GrassTile.cpp \
../../../src/world/level/tile/HeavyTile.cpp \
../../../src/world/level/tile/LightGemTile.cpp \
../../../src/world/level/tile/MelonTile.cpp \
../../../src/world/level/tile/Mushroom.cpp \
../../../src/world/level/tile/NetherReactor.cpp \
../../../src/world/level/tile/NetherReactorPattern.cpp \
../../../src/world/level/tile/StairTile.cpp \
../../../src/world/level/tile/StemTile.cpp \
../../../src/world/level/tile/StoneSlabTile.cpp \
../../../src/world/level/tile/TallGrass.cpp \
../../../src/world/level/tile/Tile.cpp \
../../../src/world/level/tile/TrapDoorTile.cpp \
../../../src/world/level/tile/entity/ChestTileEntity.cpp \
../../../src/world/level/tile/entity/NetherReactorTileEntity.cpp \
../../../src/world/level/tile/entity/SignTileEntity.cpp \
../../../src/world/level/tile/entity/TileEntity.cpp \
../../../src/world/level/tile/entity/FurnaceTileEntity.cpp \
../../../src/world/phys/HitResult.cpp
LOCAL_CFLAGS := -DPLATFORM_ANDROID -DPRE_ANDROID23 -Wno-narrowing $(LOCAL_CFLAGS)
LOCAL_CPPFLAGS := -std=c++14 -frtti
LOCAL_CPPFLAGS += -frtti
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../src
#LOCAL_CFLAGS := -DANDROID_PUBLISH -DDEMO_MODE $(LOCAL_CFLAGS)
#LOCAL_CFLAGS := -DANDROID_PUBLISH $(LOCAL_CFLAGS)
#LOCAL_CFLAGS := -DDEMO_MODE -DGLDEBUG $(LOCAL_CFLAGS)
#LOCAL_CFLAGS := -DGLDEBUG $(LOCAL_CFLAGS)
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lOpenSLES
LOCAL_STATIC_LIBRARIES := android_native_app_glue RakNet
#LOCAL_CPP_FEATURES := exceptions
TARGET_ARCH_ABI := armeabi-v7a
include $(BUILD_SHARED_LIBRARY)
# NOTE: environment var NDK_MODULE_PATH needs to point to lib_projects folder
$(call import-module,android/native_app_glue)
$(call import-module, raknet/jni)

View File

@@ -1,68 +1,68 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-printseeds
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class com.mojang.minecraftpe.GameModeButton
-keep public class com.mojang.android.StringValue
-keep public class * extends android.app.Activity
-keep public class * extends com.mojang.minecraftpe.MainActivity
-keep public class * extends MainActivity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.android.vending.licensing.ILicensingService
-keep,allowobfuscation class com.mojang.** { *** *(...); }
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * extends android.app.Activity {
static public void saveScreenshot(java.lang.String, int, int, int[]);
public int[] getImageData(java.lang.String);
public byte[] getFileDataBytes(java.lang.String);
public java.lang.String getPlatformStringVar(int);
public int getScreenWidth();
public int getScreenHeight();
public float getPixelsPerMillimeter();
public int checkLicense();
public boolean isNetworkEnabled(boolean);
public java.lang.String getDateString(int);
public boolean hasBuyButtonWhenInvalidLicense();
public void postScreenshotToFacebook(java.lang.String, int, int, int[]);
public int getKeyFromKeyCode(int, int, int);
public void quit();
public void displayDialog(int);
public void tick();
public java.lang.String[] getOptionStrings();
public void buyGame();
public boolean isTouchscreen();
public void setIsPowerVR(boolean);
public void initiateUserInput(int);
public int getUserInputStatus();
public java.lang.String[] getUserInputString();
public void vibrate(int);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-printseeds
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class com.mojang.minecraftpe.GameModeButton
-keep public class com.mojang.android.StringValue
-keep public class * extends android.app.Activity
-keep public class * extends com.mojang.minecraftpe.MainActivity
-keep public class * extends MainActivity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.android.vending.licensing.ILicensingService
-keep,allowobfuscation class com.mojang.** { *** *(...); }
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * extends android.app.Activity {
static public void saveScreenshot(java.lang.String, int, int, int[]);
public int[] getImageData(java.lang.String);
public byte[] getFileDataBytes(java.lang.String);
public java.lang.String getPlatformStringVar(int);
public int getScreenWidth();
public int getScreenHeight();
public float getPixelsPerMillimeter();
public int checkLicense();
public boolean isNetworkEnabled(boolean);
public java.lang.String getDateString(int);
public boolean hasBuyButtonWhenInvalidLicense();
public void postScreenshotToFacebook(java.lang.String, int, int, int[]);
public int getKeyFromKeyCode(int, int, int);
public void quit();
public void displayDialog(int);
public void tick();
public java.lang.String[] getOptionStrings();
public void buyGame();
public boolean isTouchscreen();
public void setIsPowerVR(boolean);
public void initiateUserInput(int);
public int getUserInputStatus();
public java.lang.String[] getUserInputString();
public void vibrate(int);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

View File

@@ -1,4 +1,4 @@
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg32"
android:tileMode="repeat"
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg32"
android:tileMode="repeat"
android:dither="false" />

View File

@@ -1,5 +1,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/cancel_1_3"
android:state_pressed="true" />
<item android:drawable="@drawable/cancel_0_3" />
</selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/cancel_1_3"
android:state_pressed="true" />
<item android:drawable="@drawable/cancel_0_3" />
</selector>

View File

@@ -1,5 +1,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/create_1_3"
android:state_pressed="true" />
<item android:drawable="@drawable/create_0_3" />
</selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/create_1_3"
android:state_pressed="true" />
<item android:drawable="@drawable/create_0_3" />
</selector>

View File

@@ -1,5 +1,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/survival_3" />
<item android:drawable="@drawable/creative_3" />
</selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/survival_3" />
<item android:drawable="@drawable/creative_3" />
</selector>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bgtiled"
android:tileMode="repeat" >
<TextView android:text="Multiplayer username"
android:layout_width="540px"
android:layout_height="24dp" />
<EditText android:id="@+id/editText_options_mpusername"
android:text=""
android:layout_width="fill_parent"
android:layout_height="48dp"
android:singleLine="true"
android:inputType="textNoSuggestions"
>
</EditText>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bgtiled"
android:tileMode="repeat" >
<TextView android:text="Multiplayer username"
android:layout_width="540px"
android:layout_height="24dp" />
<EditText android:id="@+id/editText_options_mpusername"
android:text=""
android:layout_width="fill_parent"
android:layout_height="48dp"
android:singleLine="true"
android:inputType="textNoSuggestions"
>
</EditText>
</LinearLayout>

View File

@@ -1,29 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bgtiled"
android:tileMode="repeat"
android:gravity="center_horizontal"
>
<TextView android:text = "@string/renameworld_title"
android:layout_width="360dp"
android:layout_height="24dp"
android:typeface="monospace"
/>
<com.mojang.android.EditTextAscii
android:id="@+id/editText_worldNameRename"
android:text="@string/renameworld_saved_world"
android:layout_width="360dp"
android:layout_height="48dp"
android:singleLine="true"
android:typeface="monospace"
android:maxLength="64"
android:imeActionLabel="Ok"
android:inputType="textNoSuggestions"
android:imeOptions="actionDone" />
<View
android:layout_width="360dp"
android:layout_height="10px" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bgtiled"
android:tileMode="repeat"
android:gravity="center_horizontal"
>
<TextView android:text = "@string/renameworld_title"
android:layout_width="360dp"
android:layout_height="24dp"
android:typeface="monospace"
/>
<com.mojang.android.EditTextAscii
android:id="@+id/editText_worldNameRename"
android:text="@string/renameworld_saved_world"
android:layout_width="360dp"
android:layout_height="48dp"
android:singleLine="true"
android:typeface="monospace"
android:maxLength="64"
android:imeActionLabel="Ok"
android:inputType="textNoSuggestions"
android:imeOptions="actionDone" />
<View
android:layout_width="360dp"
android:layout_height="10px" />
</LinearLayout>

View File

@@ -1,40 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Minecraft - Pocket Edition</string>
<string name="app_name_demo">Minecraft - Pocket Edition Demo</string>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Minecraft - Pocket Edition</string>
<string name="app_name_demo">Minecraft - Pocket Edition Demo</string>
<string name="xperiaplayoptimized_content">true</string>
<string name="app_name_short">Minecraft PE</string>
<string name="app_name_short_demo">Minecraft PE Demo</string>
<!-- CREATE NEW WORLD -->
<string name="createworld_name">World name</string>
<string name="createworld_new_world">Unnamed world</string>
<string name="createworld_seed">World Generator seed. Leave blank for random.</string>
<string name="createworld_seed_info">Leave blank for random seed</string>
<string name="gamemode_survival_summary">Mobs, health and gather resources</string>
<string name="gamemode_creative_summary">Unlimited resources and flying</string>
<!-- RENAME WORLD -->
<string name="renameworld_title">Save world as</string>
<string name="renameworld_saved_world">Saved World</string>
<!-- MAIN MENU OPTIONS -->
<string name="mmoptions_mp_username_title">Username</string>
<string name="mmoptions_mp_username_dialog">Enter your username</string>
<string name="mmoptions_mp_server_visible_default_title">Server visible by default</string>
<string name="mmoptions_ctrl_sensitivity_title">Sensitivity</string>
<string name="mmoptions_ctrl_invertmouse_title">Invert Y-axis</string>
<string name="mmoptions_ctrl_islefthanded_title">Lefty</string>
<string name="mmoptions_ctrl_usetouchscreen_title">Use touch screen</string>
<string name="mmoptions_ctrl_usetouchjoypad_title">Split touch controls</string>
<string name="mmoptions_feedback_vibration_title">Vibration</string>
<string name="mmoptions_feedback_vibration_summary">Slight vibration when blocks are destroyed</string>
<string name="mmoptions_gfx_fancygraphics_title">Fancy graphics</string>
<string name="mmoptions_gfx_fancygraphics_summary"></string>
<string name="mmoptions_gfx_fancygraphics_summary_powervr"></string>
<string name="mmoptions_gfx_lowquality_title">Lower graphics quality</string>
<string name="mmoptions_gfx_lowquality_summary">Shorter view distance and disables fancy rendering</string>
<string name="mmoptions_game_difficultypeaceful_title">Peaceful mode</string>
<string name="mmoptions_game_difficultypeaceful_summary">No hostile mobs, heal automatically</string>
</resources>
<string name="app_name_short">Minecraft PE</string>
<string name="app_name_short_demo">Minecraft PE Demo</string>
<!-- CREATE NEW WORLD -->
<string name="createworld_name">World name</string>
<string name="createworld_new_world">Unnamed world</string>
<string name="createworld_seed">World Generator seed. Leave blank for random.</string>
<string name="createworld_seed_info">Leave blank for random seed</string>
<string name="gamemode_survival_summary">Mobs, health and gather resources</string>
<string name="gamemode_creative_summary">Unlimited resources and flying</string>
<!-- RENAME WORLD -->
<string name="renameworld_title">Save world as</string>
<string name="renameworld_saved_world">Saved World</string>
<!-- MAIN MENU OPTIONS -->
<string name="mmoptions_mp_username_title">Username</string>
<string name="mmoptions_mp_username_dialog">Enter your username</string>
<string name="mmoptions_mp_server_visible_default_title">Server visible by default</string>
<string name="mmoptions_ctrl_sensitivity_title">Sensitivity</string>
<string name="mmoptions_ctrl_invertmouse_title">Invert Y-axis</string>
<string name="mmoptions_ctrl_islefthanded_title">Lefty</string>
<string name="mmoptions_ctrl_usetouchscreen_title">Use touch screen</string>
<string name="mmoptions_ctrl_usetouchjoypad_title">Split touch controls</string>
<string name="mmoptions_feedback_vibration_title">Vibration</string>
<string name="mmoptions_feedback_vibration_summary">Slight vibration when blocks are destroyed</string>
<string name="mmoptions_gfx_fancygraphics_title">Fancy graphics</string>
<string name="mmoptions_gfx_fancygraphics_summary"></string>
<string name="mmoptions_gfx_fancygraphics_summary_powervr"></string>
<string name="mmoptions_gfx_lowquality_title">Lower graphics quality</string>
<string name="mmoptions_gfx_lowquality_summary">Shorter view distance and disables fancy rendering</string>
<string name="mmoptions_game_difficultypeaceful_title">Peaceful mode</string>
<string name="mmoptions_game_difficultypeaceful_summary">No hostile mobs, heal automatically</string>
</resources>

View File

@@ -1,105 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Multiplayer">
<EditTextPreference
android:key="mp_username"
android:title="@string/mmoptions_mp_username_title"
android:summary=""
android:dialogTitle="@string/mmoptions_mp_username_dialog"
android:defaultValue="Steve"
android:singleLine="true" />
<CheckBoxPreference
android:key="mp_server_visible_default"
android:title="@string/mmoptions_mp_server_visible_default_title"
android:summary=""
android:defaultValue="true"
/>
</PreferenceCategory>
<PreferenceCategory
android:key="category_graphics"
android:title="Graphics">
<CheckBoxPreference
android:key="gfx_fancygraphics"
android:title="@string/mmoptions_gfx_fancygraphics_title"
android:summary="@string/mmoptions_gfx_fancygraphics_summary"
android:defaultValue="false"
/>
<CheckBoxPreference
android:key="gfx_lowquality"
android:title="@string/mmoptions_gfx_lowquality_title"
android:summary="@string/mmoptions_gfx_lowquality_summary"
android:defaultValue="false"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="Controls">
<com.mojang.android.preferences.SliderPreference
android:key="ctrl_sensitivity"
android:title="@string/mmoptions_ctrl_sensitivity_title"
android:max="100"
android:summary=""
android:defaultValue="50"
android:enabled="true"
/>
<CheckBoxPreference
android:key="ctrl_invertmouse"
android:title="@string/mmoptions_ctrl_invertmouse_title"
android:summary=""
android:defaultValue="false"
android:enabled="true"
/>
<CheckBoxPreference
android:key="ctrl_islefthanded"
android:title="@string/mmoptions_ctrl_islefthanded_title"
android:summary=""
android:defaultValue="false"
android:enabled="true"
/>
<CheckBoxPreference
android:key="ctrl_usetouchscreen"
android:title="@string/mmoptions_ctrl_usetouchscreen_title"
android:summary=""
android:defaultValue="true"
android:enabled="false"
/>
<CheckBoxPreference
android:key="ctrl_usetouchjoypad"
android:title="@string/mmoptions_ctrl_usetouchjoypad_title"
android:summary=""
android:defaultValue="false"
android:enabled="true"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="Feedback">
<CheckBoxPreference
android:key="feedback_vibration"
android:title="@string/mmoptions_feedback_vibration_title"
android:summary="@string/mmoptions_feedback_vibration_summary"
android:defaultValue="true"
android:enabled="true"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="Game">
<CheckBoxPreference
android:key="game_difficultypeaceful"
android:title="@string/mmoptions_game_difficultypeaceful_title"
android:summary="@string/mmoptions_game_difficultypeaceful_summary"
android:defaultValue="false"
/>
</PreferenceCategory>
</PreferenceScreen>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Multiplayer">
<EditTextPreference
android:key="mp_username"
android:title="@string/mmoptions_mp_username_title"
android:summary=""
android:dialogTitle="@string/mmoptions_mp_username_dialog"
android:defaultValue="Steve"
android:singleLine="true" />
<CheckBoxPreference
android:key="mp_server_visible_default"
android:title="@string/mmoptions_mp_server_visible_default_title"
android:summary=""
android:defaultValue="true"
/>
</PreferenceCategory>
<PreferenceCategory
android:key="category_graphics"
android:title="Graphics">
<CheckBoxPreference
android:key="gfx_fancygraphics"
android:title="@string/mmoptions_gfx_fancygraphics_title"
android:summary="@string/mmoptions_gfx_fancygraphics_summary"
android:defaultValue="false"
/>
<CheckBoxPreference
android:key="gfx_lowquality"
android:title="@string/mmoptions_gfx_lowquality_title"
android:summary="@string/mmoptions_gfx_lowquality_summary"
android:defaultValue="false"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="Controls">
<com.mojang.android.preferences.SliderPreference
android:key="ctrl_sensitivity"
android:title="@string/mmoptions_ctrl_sensitivity_title"
android:max="100"
android:summary=""
android:defaultValue="50"
android:enabled="true"
/>
<CheckBoxPreference
android:key="ctrl_invertmouse"
android:title="@string/mmoptions_ctrl_invertmouse_title"
android:summary=""
android:defaultValue="false"
android:enabled="true"
/>
<CheckBoxPreference
android:key="ctrl_islefthanded"
android:title="@string/mmoptions_ctrl_islefthanded_title"
android:summary=""
android:defaultValue="false"
android:enabled="true"
/>
<CheckBoxPreference
android:key="ctrl_usetouchscreen"
android:title="@string/mmoptions_ctrl_usetouchscreen_title"
android:summary=""
android:defaultValue="true"
android:enabled="false"
/>
<CheckBoxPreference
android:key="ctrl_usetouchjoypad"
android:title="@string/mmoptions_ctrl_usetouchjoypad_title"
android:summary=""
android:defaultValue="false"
android:enabled="true"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="Feedback">
<CheckBoxPreference
android:key="feedback_vibration"
android:title="@string/mmoptions_feedback_vibration_title"
android:summary="@string/mmoptions_feedback_vibration_summary"
android:defaultValue="true"
android:enabled="true"
/>
</PreferenceCategory>
<PreferenceCategory
android:title="Game">
<CheckBoxPreference
android:key="game_difficultypeaceful"
android:title="@string/mmoptions_game_difficultypeaceful_title"
android:summary="@string/mmoptions_game_difficultypeaceful_summary"
android:defaultValue="false"
/>
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -1,58 +1,58 @@
package com.mojang.android;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.widget.EditText;
public class EditTextAscii extends EditText
implements TextWatcher {
public EditTextAscii(Context context) {
super(context);
_init();
}
public EditTextAscii(Context context, AttributeSet attrs) {
super(context, attrs);
_init();
}
public EditTextAscii(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
_init();
}
private void _init() {
this.addTextChangedListener(this);
}
//
// TextWatcher
//
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
//@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
//@Override
public void afterTextChanged(Editable e) {
String s = e.toString();
String sanitized = sanitize(s);
if (!s.equals(sanitized)) {
e.replace(0, e.length(), sanitized);
}
}
static public String sanitize(String s) {
StringBuilder sb = new StringBuilder(s.length());
for (int i = 0; i < s.length(); ++i) {
char ch = s.charAt(i);
if (ch < 128)
sb.append(ch);
}
return sb.toString();
}
}
package com.mojang.android;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.widget.EditText;
public class EditTextAscii extends EditText
implements TextWatcher {
public EditTextAscii(Context context) {
super(context);
_init();
}
public EditTextAscii(Context context, AttributeSet attrs) {
super(context, attrs);
_init();
}
public EditTextAscii(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
_init();
}
private void _init() {
this.addTextChangedListener(this);
}
//
// TextWatcher
//
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
//@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
//@Override
public void afterTextChanged(Editable e) {
String s = e.toString();
String sanitized = sanitize(s);
if (!s.equals(sanitized)) {
e.replace(0, e.length(), sanitized);
}
}
static public String sanitize(String s) {
StringBuilder sb = new StringBuilder(s.length());
for (int i = 0; i < s.length(); ++i) {
char ch = s.charAt(i);
if (ch < 128)
sb.append(ch);
}
return sb.toString();
}
}

View File

@@ -1,5 +1,5 @@
package com.mojang.android;
public interface StringValue {
public String getStringValue();
}
package com.mojang.android;
public interface StringValue {
public String getStringValue();
}

View File

@@ -1,29 +1,29 @@
package com.mojang.android.licensing;
///see LicenseResult.h in C++ project
public class LicenseCodes {
// Something's not ready, call again later
public static final int WAIT_PLATFORM_NOT_READY = -2; // Note used from java
public static final int WAIT_SERVER_NOT_READY = -1;
// License is ok
public static final int LICENSE_OK = 0;
public static final int LICENSE_TRIAL_OK = 1;
// License is not working in one way or another
public static final int LICENSE_VALIDATION_FAILED = 50;
public static final int ITEM_NOT_FOUND = 51;
public static final int LICENSE_NOT_FOUND = 52;
public static final int ERROR_CONTENT_HANDLER = 100;
public static final int ERROR_ILLEGAL_ARGUMENT = 101;
public static final int ERROR_SECURITY = 102;
public static final int ERROR_INPUT_OUTPUT = 103;
public static final int ERROR_ILLEGAL_STATE = 104;
public static final int ERROR_NULL_POINTER = 105;
public static final int ERROR_GENERAL = 106;
public static final int ERROR_UNABLE_TO_CONNECT_TO_CDS = 107;
// The call went wrong so we didn't get a license value at all
public static final int LICENSE_CHECK_EXCEPTION = 200;
}
package com.mojang.android.licensing;
///see LicenseResult.h in C++ project
public class LicenseCodes {
// Something's not ready, call again later
public static final int WAIT_PLATFORM_NOT_READY = -2; // Note used from java
public static final int WAIT_SERVER_NOT_READY = -1;
// License is ok
public static final int LICENSE_OK = 0;
public static final int LICENSE_TRIAL_OK = 1;
// License is not working in one way or another
public static final int LICENSE_VALIDATION_FAILED = 50;
public static final int ITEM_NOT_FOUND = 51;
public static final int LICENSE_NOT_FOUND = 52;
public static final int ERROR_CONTENT_HANDLER = 100;
public static final int ERROR_ILLEGAL_ARGUMENT = 101;
public static final int ERROR_SECURITY = 102;
public static final int ERROR_INPUT_OUTPUT = 103;
public static final int ERROR_ILLEGAL_STATE = 104;
public static final int ERROR_NULL_POINTER = 105;
public static final int ERROR_GENERAL = 106;
public static final int ERROR_UNABLE_TO_CONNECT_TO_CDS = 107;
// The call went wrong so we didn't get a license value at all
public static final int LICENSE_CHECK_EXCEPTION = 200;
}

View File

@@ -1,233 +1,233 @@
package com.mojang.android.preferences;
import android.content.Context;
import android.content.res.Resources;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
public class SliderPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
private static final String androidns = "http://schemas.android.com/apk/res/android";
private Context _context;
//private TextView _minValueTextView;
private TextView _valueTextView;
//private TextView _maxValueTextView;
private SeekBar _seekBar;
private String _valueSuffix;
private int _defaultValue; // Stores the default preference value when none has been set
private int _maxValue; // Stores the upper preference value bound
private int _value; // Stores the value of the preference
private int _minValue; // Stores the minimum preference value bound
public SliderPreference(Context context, AttributeSet attrs) {
super(context, attrs);
_context = context;
_valueSuffix = getResourceValueFromAttribute(attrs, androidns, "text", "");
_defaultValue = getResourceValueFromAttribute(attrs, androidns, "defaultValue", 0);
_maxValue = getResourceValueFromAttribute(attrs, androidns, "max", 100);
_minValue = getResourceValueFromAttribute(attrs, null, "min", 0);
// Set the default value of the preference to the default value found in attribute
setDefaultValue((Integer) _defaultValue);
}
//public SliderPreference(Context context, AttributeSet attrs, int)
@Override
protected View onCreateDialogView() {
LinearLayout.LayoutParams params;
LinearLayout layout = new LinearLayout(getContext());
layout.setOrientation(LinearLayout.VERTICAL);
layout.setPadding(6,6,6,6);
// mSplashText = new TextView(_context);
// if (mDialogMessage != null)
// mSplashText.setText(mDialogMessage);
// layout.addView(mSplashText);
_valueTextView = new TextView(_context);
_valueTextView.setGravity(Gravity.CENTER_HORIZONTAL);
_valueTextView.setTextSize(32);
params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
layout.addView(_valueTextView, params);
_seekBar = new SeekBar(_context);
_seekBar.setOnSeekBarChangeListener(this);
layout.addView(_seekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
if (shouldPersist())
_value = getPersistedInt(_defaultValue);
_seekBar.setMax(_maxValue);
_seekBar.setProgress(_value);
return layout;
}
@Override
protected void onSetInitialValue(boolean restore, Object defaultValue) {
super.onSetInitialValue(restore, defaultValue);
if (restore)
_value = shouldPersist() ? getPersistedInt(_defaultValue) : 0;
else
_value = (Integer) defaultValue;
}
/*
@Override
protected void onBindView(View view) {
super.onBindView(view);
// Bind _seekBar to the layout's internal view
_seekBar = (SeekBar) view.findViewById(R.id.slider_preference_seekbar);
// Setup it's listeners and parameters
_seekBar.setMax(translateValueToSeekBar(_maxValue));
_seekBar.setProgress(translateValueToSeekBar(_value));
_seekBar.setOnSeekBarChangeListener(this);
// Bind mTextView to the layout's internal view
_valueTextView = (TextView) view.findViewById(R.id.slider_preference_value);
// Setup it's parameters
_valueTextView.setText(getValueText(_value));
// Setup min and max value text views
_minValueTextView = (TextView) view.findViewById(R.id.slider_preference_min_value);
_minValueTextView.setText(getValueText(_minValue));
_maxValueTextView = (TextView) view.findViewById(R.id.slider_preference_max_value);
_maxValueTextView.setText(getValueText(_maxValue));
}
*/
//@Override
public void onProgressChanged(SeekBar seekBar, int value, boolean fromUser) {
// Change mTextView and _value to the current seekbar value
_value = translateValueFro_seekBar(value);
_valueTextView.setText(getValueText(_value));
if (shouldPersist())
persistInt(translateValueFro_seekBar(value));
callChangeListener(new Integer(_value));
}
//@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// Not used
}
//@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// Not used
}
private String getValueText(int value) {
String t = String.valueOf(value);
return t.concat(_valueSuffix);
}
/**
* Retrieves a value from the resources of this slider preference's context
* based on an attribute pointing to that resource.
*
* @param attrs
* The attribute set to search
*
* @param namespace
* The namespace of the attribute
*
* @param name
* The name of the attribute
*
* @param defaultValue
* The default value returned if no resource is found
*
* @return
* The resource value
*/
private int getResourceValueFromAttribute(AttributeSet attrs, String namespace, String name, int defaultValue) {
Resources res = getContext().getResources();
int valueID = attrs.getAttributeResourceValue(namespace, name, 0);
if (valueID != 0) {
return res.getInteger(valueID);
}
else {
return attrs.getAttributeIntValue(namespace, name, defaultValue);
}
}
/**
* Retrieves a value from the resources of this slider preference's context
* based on an attribute pointing to that resource.
*
* @param attrs
* The attribute set to search
*
* @param namespace
* The namespace of the attribute
*
* @param name
* The name of the attribute
*
* @param defaultValue
* The default value returned if no resource is found
*
* @return
* The resource value
*/
private String getResourceValueFromAttribute(AttributeSet attrs, String namespace, String name, String defaultValue) {
Resources res = getContext().getResources();
int valueID = attrs.getAttributeResourceValue(namespace, name, 0);
if (valueID != 0) {
return res.getString(valueID);
}
else {
String value = attrs.getAttributeValue(namespace, name);
if (value != null) {
return value;
}
else {
return defaultValue;
}
}
}
/**
* Translates a value from this slider preference's seekbar by
* adjusting it for a set perceived minimum value.
*
* @param value
* The value to be translated from the seekbar
*
* @return
* A value equal to the value passed plus the currently set minimum value.
*/
private int translateValueFro_seekBar(int value) {
return value + _minValue;
}
/**
* Translates a value for when setting this slider preference's seekbar by
* adjusting it for a set perceived minimum value.
*
* @param value
* The value to be translated for use
*
* @return
* A value equal to the value passed minus the currently set minimum value.
*/
private int translateValueToSeekBar(int value) {
return value - _minValue;
}
}
package com.mojang.android.preferences;
import android.content.Context;
import android.content.res.Resources;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
public class SliderPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
private static final String androidns = "http://schemas.android.com/apk/res/android";
private Context _context;
//private TextView _minValueTextView;
private TextView _valueTextView;
//private TextView _maxValueTextView;
private SeekBar _seekBar;
private String _valueSuffix;
private int _defaultValue; // Stores the default preference value when none has been set
private int _maxValue; // Stores the upper preference value bound
private int _value; // Stores the value of the preference
private int _minValue; // Stores the minimum preference value bound
public SliderPreference(Context context, AttributeSet attrs) {
super(context, attrs);
_context = context;
_valueSuffix = getResourceValueFromAttribute(attrs, androidns, "text", "");
_defaultValue = getResourceValueFromAttribute(attrs, androidns, "defaultValue", 0);
_maxValue = getResourceValueFromAttribute(attrs, androidns, "max", 100);
_minValue = getResourceValueFromAttribute(attrs, null, "min", 0);
// Set the default value of the preference to the default value found in attribute
setDefaultValue((Integer) _defaultValue);
}
//public SliderPreference(Context context, AttributeSet attrs, int)
@Override
protected View onCreateDialogView() {
LinearLayout.LayoutParams params;
LinearLayout layout = new LinearLayout(getContext());
layout.setOrientation(LinearLayout.VERTICAL);
layout.setPadding(6,6,6,6);
// mSplashText = new TextView(_context);
// if (mDialogMessage != null)
// mSplashText.setText(mDialogMessage);
// layout.addView(mSplashText);
_valueTextView = new TextView(_context);
_valueTextView.setGravity(Gravity.CENTER_HORIZONTAL);
_valueTextView.setTextSize(32);
params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
layout.addView(_valueTextView, params);
_seekBar = new SeekBar(_context);
_seekBar.setOnSeekBarChangeListener(this);
layout.addView(_seekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
if (shouldPersist())
_value = getPersistedInt(_defaultValue);
_seekBar.setMax(_maxValue);
_seekBar.setProgress(_value);
return layout;
}
@Override
protected void onSetInitialValue(boolean restore, Object defaultValue) {
super.onSetInitialValue(restore, defaultValue);
if (restore)
_value = shouldPersist() ? getPersistedInt(_defaultValue) : 0;
else
_value = (Integer) defaultValue;
}
/*
@Override
protected void onBindView(View view) {
super.onBindView(view);
// Bind _seekBar to the layout's internal view
_seekBar = (SeekBar) view.findViewById(R.id.slider_preference_seekbar);
// Setup it's listeners and parameters
_seekBar.setMax(translateValueToSeekBar(_maxValue));
_seekBar.setProgress(translateValueToSeekBar(_value));
_seekBar.setOnSeekBarChangeListener(this);
// Bind mTextView to the layout's internal view
_valueTextView = (TextView) view.findViewById(R.id.slider_preference_value);
// Setup it's parameters
_valueTextView.setText(getValueText(_value));
// Setup min and max value text views
_minValueTextView = (TextView) view.findViewById(R.id.slider_preference_min_value);
_minValueTextView.setText(getValueText(_minValue));
_maxValueTextView = (TextView) view.findViewById(R.id.slider_preference_max_value);
_maxValueTextView.setText(getValueText(_maxValue));
}
*/
//@Override
public void onProgressChanged(SeekBar seekBar, int value, boolean fromUser) {
// Change mTextView and _value to the current seekbar value
_value = translateValueFro_seekBar(value);
_valueTextView.setText(getValueText(_value));
if (shouldPersist())
persistInt(translateValueFro_seekBar(value));
callChangeListener(new Integer(_value));
}
//@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// Not used
}
//@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// Not used
}
private String getValueText(int value) {
String t = String.valueOf(value);
return t.concat(_valueSuffix);
}
/**
* Retrieves a value from the resources of this slider preference's context
* based on an attribute pointing to that resource.
*
* @param attrs
* The attribute set to search
*
* @param namespace
* The namespace of the attribute
*
* @param name
* The name of the attribute
*
* @param defaultValue
* The default value returned if no resource is found
*
* @return
* The resource value
*/
private int getResourceValueFromAttribute(AttributeSet attrs, String namespace, String name, int defaultValue) {
Resources res = getContext().getResources();
int valueID = attrs.getAttributeResourceValue(namespace, name, 0);
if (valueID != 0) {
return res.getInteger(valueID);
}
else {
return attrs.getAttributeIntValue(namespace, name, defaultValue);
}
}
/**
* Retrieves a value from the resources of this slider preference's context
* based on an attribute pointing to that resource.
*
* @param attrs
* The attribute set to search
*
* @param namespace
* The namespace of the attribute
*
* @param name
* The name of the attribute
*
* @param defaultValue
* The default value returned if no resource is found
*
* @return
* The resource value
*/
private String getResourceValueFromAttribute(AttributeSet attrs, String namespace, String name, String defaultValue) {
Resources res = getContext().getResources();
int valueID = attrs.getAttributeResourceValue(namespace, name, 0);
if (valueID != 0) {
return res.getString(valueID);
}
else {
String value = attrs.getAttributeValue(namespace, name);
if (value != null) {
return value;
}
else {
return defaultValue;
}
}
}
/**
* Translates a value from this slider preference's seekbar by
* adjusting it for a set perceived minimum value.
*
* @param value
* The value to be translated from the seekbar
*
* @return
* A value equal to the value passed plus the currently set minimum value.
*/
private int translateValueFro_seekBar(int value) {
return value + _minValue;
}
/**
* Translates a value for when setting this slider preference's seekbar by
* adjusting it for a set perceived minimum value.
*
* @param value
* The value to be translated for use
*
* @return
* A value equal to the value passed minus the currently set minimum value.
*/
private int translateValueToSeekBar(int value) {
return value - _minValue;
}
}

View File

@@ -1,77 +1,77 @@
package com.mojang.minecraftpe;
import com.mojang.android.StringValue;
import com.mojang.minecraftpe.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.ToggleButton;
public class GameModeButton extends ToggleButton implements OnClickListener, StringValue {
public GameModeButton(Context context, AttributeSet attrs) {
super(context, attrs);
_init();
}
//@Override
public void onClick(View v) {
_update();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
_update();
}
@Override
protected void onAttachedToWindow() {
if (!_attached) {
_update();
_attached = true;
}
}
private boolean _attached = false;
private void _init() {
setOnClickListener(this);
}
private void _update() {
_setGameType(isChecked()?Survival:Creative);
}
private void _setGameType(int i) {
_type = _clamp(i);
int id = R.string.gamemode_creative_summary;
if (_type == Survival)
id = R.string.gamemode_survival_summary;
String desc = getContext().getString(id);
View v = getRootView().findViewById(R.id.labelGameModeDesc);
System.out.println("Mode: " + _type + ", view? " + (v!=null));
if (desc != null && v != null && v instanceof TextView) {
((TextView)v).setText(desc);
}
}
static private int _clamp(int i) {
if (i > Survival) return Survival;
if (i < Creative) return Creative;
return i;
}
public String getStringValue() {
return getStringForType(_type);
}
static public String getStringForType(int i) {
return new String[] {
"creative",
"survival"
} [_clamp(i)];
}
private int _type = 0;
static final int Creative = 0;
static final int Survival = 1;
}
package com.mojang.minecraftpe;
import com.mojang.android.StringValue;
import com.mojang.minecraftpe.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.ToggleButton;
public class GameModeButton extends ToggleButton implements OnClickListener, StringValue {
public GameModeButton(Context context, AttributeSet attrs) {
super(context, attrs);
_init();
}
//@Override
public void onClick(View v) {
_update();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
_update();
}
@Override
protected void onAttachedToWindow() {
if (!_attached) {
_update();
_attached = true;
}
}
private boolean _attached = false;
private void _init() {
setOnClickListener(this);
}
private void _update() {
_setGameType(isChecked()?Survival:Creative);
}
private void _setGameType(int i) {
_type = _clamp(i);
int id = R.string.gamemode_creative_summary;
if (_type == Survival)
id = R.string.gamemode_survival_summary;
String desc = getContext().getString(id);
View v = getRootView().findViewById(R.id.labelGameModeDesc);
System.out.println("Mode: " + _type + ", view? " + (v!=null));
if (desc != null && v != null && v instanceof TextView) {
((TextView)v).setText(desc);
}
}
static private int _clamp(int i) {
if (i > Survival) return Survival;
if (i < Creative) return Creative;
return i;
}
public String getStringValue() {
return getStringForType(_type);
}
static public String getStringForType(int i) {
return new String[] {
"creative",
"survival"
} [_clamp(i)];
}
private int _type = 0;
static final int Creative = 0;
static final int Survival = 1;
}

View File

@@ -1,197 +1,197 @@
package com.mojang.minecraftpe;
import java.util.ArrayList;
import com.mojang.android.EditTextAscii;
//import com.mojang.minecraftpe.R;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
public class MainMenuOptionsActivity extends PreferenceActivity implements
SharedPreferences.OnSharedPreferenceChangeListener
{
static public final String Multiplayer_Username = "mp_username";
static public final String Multiplayer_ServerVisible = "mp_server_visible_default";
static public final String Graphics_Fancy = "gfx_fancygraphics";
static public final String Graphics_LowQuality = "gfx_lowquality";
static public final String Controls_InvertMouse = "ctrl_invertmouse";
static public final String Controls_Sensitivity = "ctrl_sensitivity";
static public final String Controls_UseTouchscreen = "ctrl_usetouchscreen";
static public final String Controls_UseTouchJoypad = "ctrl_usetouchjoypad";
static public final String Controls_FeedbackVibration = "feedback_vibration";
static public final String Game_DifficultyLevel = "game_difficulty";
static public final String Internal_Game_DifficultyPeaceful = "game_difficultypeaceful";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
addPreferencesFromResource(extras.getInt("preferenceId"));//R.xml.preferences);
//getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
PreferenceScreen s = getPreferenceScreen();
if (PreferenceManager.getDefaultSharedPreferences(this).contains(Multiplayer_Username)) {
previousName = PreferenceManager.getDefaultSharedPreferences(this).getString(Multiplayer_Username, null);
}
_validator = new PreferenceValidator(this);
readBackAll(s);
_validator.commit();
}
private void readBackAll(PreferenceGroup g) {
traversePreferences(g, new PreferenceTraverser() {
void onPreference(Preference p) { readBack(p); _validator.validate(p); }
});
}
private void traversePreferences(PreferenceGroup g, PreferenceTraverser pt) {
int size = g.getPreferenceCount();
for (int i = 0; i < size; ++i) {
Preference p = g.getPreference(i);
if (p instanceof PreferenceGroup) {
PreferenceGroup pg = (PreferenceGroup)p;
pt.onPreferenceGroup(pg);
traversePreferences(pg, pt);
}
else
pt.onPreference(p);
}
}
private void readBack(Preference p) {
if (p == null)
return;
//System.out.println("pref: " + p.toString());
if (p instanceof EditTextPreference) {
EditTextPreference e = (EditTextPreference) p;
p.setSummary("'" + e.getText() + "'");
}
}
//@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
Preference p = findPreference(key);
_validator.validate(sharedPreferences, key);
if (p instanceof EditTextPreference) {
EditTextPreference e = (EditTextPreference) p;
Editor editor = sharedPreferences.edit();
String s = e.getText();
String sanitized = EditTextAscii.sanitize(s).trim();
if (key.equals(Multiplayer_Username) && sanitized == null || sanitized.length() == 0) {
sanitized = previousName;
if (sanitized == null || sanitized.equals("")) {
sanitized = "Steve";
previousName = sanitized;
}
}
if (!s.equals(sanitized)) {
editor.putString(key, sanitized);
editor.commit();
e.setText(sanitized);
}
}
readBack(p);
}
String previousName;
PreferenceValidator _validator;
}
class PreferenceValidator {
static private class Pref {
Pref(PreferenceGroup g, Preference p) {
this.g = g;
this.p = p;
}
PreferenceGroup g;
Preference p;
}
private PreferenceActivity _prefs;
private ArrayList<Pref> _arrayList = new ArrayList<Pref>();
public PreferenceValidator(PreferenceActivity prefs) {
_prefs = prefs;
}
public void commit() {
//System.err.println("ERR: " + _arrayList.size());
for (int i = 0; i < _arrayList.size(); ++i) {
PreferenceGroup g = _arrayList.get(i).g;
Preference p = _arrayList.get(i).p;
g.removePreference(p);
}
}
public void validate(Preference p) {
validate(PreferenceManager.getDefaultSharedPreferences(_prefs), p.getKey());
}
public void validate(SharedPreferences preferences, String key) {
Preference p = findPreference(key);
if (p instanceof CheckBoxPreference) {
//CheckBoxPreference e = (CheckBoxPreference) p;
if (key.equals(MainMenuOptionsActivity.Graphics_LowQuality)) {
boolean isShort = preferences.getBoolean(MainMenuOptionsActivity.Graphics_LowQuality, false);
CheckBoxPreference fancyPref = (CheckBoxPreference)findPreference(MainMenuOptionsActivity.Graphics_Fancy);
if (fancyPref != null) {
fancyPref.setEnabled(isShort == false);
if (isShort)
fancyPref.setChecked(false);
}
}
if (key.equals(MainMenuOptionsActivity.Graphics_Fancy)) {
CheckBoxPreference fancyPref = (CheckBoxPreference) p;
//System.err.println("Is PowerVR? : " + MainActivity.isPowerVR());
if (MainActivity.isPowerVR()) {
fancyPref.setSummary("Experimental on this device!");
}
}
if (p.getKey().equals(MainMenuOptionsActivity.Controls_UseTouchscreen)) {
boolean hasOtherPrimaryControls = MainActivity.isXperiaPlay();
if (!hasOtherPrimaryControls) {
PreferenceCategory mCategory = (PreferenceCategory) findPreference("category_graphics");
_arrayList.add(new Pref(mCategory, p));
}
p.setEnabled(hasOtherPrimaryControls);
p.setDefaultValue( !hasOtherPrimaryControls );
if (hasOtherPrimaryControls) {
CheckBoxPreference pp = (CheckBoxPreference) p;
CheckBoxPreference j = (CheckBoxPreference)findPreference(MainMenuOptionsActivity.Controls_UseTouchJoypad);
j.setEnabled(pp.isChecked());
}
}
}
}
private Preference findPreference(String key) {
return _prefs.findPreference(key);
}
}
abstract class PreferenceTraverser {
void onPreference(Preference p) {}
void onPreferenceGroup(PreferenceGroup p) {}
}
package com.mojang.minecraftpe;
import java.util.ArrayList;
import com.mojang.android.EditTextAscii;
//import com.mojang.minecraftpe.R;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
public class MainMenuOptionsActivity extends PreferenceActivity implements
SharedPreferences.OnSharedPreferenceChangeListener
{
static public final String Multiplayer_Username = "mp_username";
static public final String Multiplayer_ServerVisible = "mp_server_visible_default";
static public final String Graphics_Fancy = "gfx_fancygraphics";
static public final String Graphics_LowQuality = "gfx_lowquality";
static public final String Controls_InvertMouse = "ctrl_invertmouse";
static public final String Controls_Sensitivity = "ctrl_sensitivity";
static public final String Controls_UseTouchscreen = "ctrl_usetouchscreen";
static public final String Controls_UseTouchJoypad = "ctrl_usetouchjoypad";
static public final String Controls_FeedbackVibration = "feedback_vibration";
static public final String Game_DifficultyLevel = "game_difficulty";
static public final String Internal_Game_DifficultyPeaceful = "game_difficultypeaceful";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
addPreferencesFromResource(extras.getInt("preferenceId"));//R.xml.preferences);
//getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
PreferenceScreen s = getPreferenceScreen();
if (PreferenceManager.getDefaultSharedPreferences(this).contains(Multiplayer_Username)) {
previousName = PreferenceManager.getDefaultSharedPreferences(this).getString(Multiplayer_Username, null);
}
_validator = new PreferenceValidator(this);
readBackAll(s);
_validator.commit();
}
private void readBackAll(PreferenceGroup g) {
traversePreferences(g, new PreferenceTraverser() {
void onPreference(Preference p) { readBack(p); _validator.validate(p); }
});
}
private void traversePreferences(PreferenceGroup g, PreferenceTraverser pt) {
int size = g.getPreferenceCount();
for (int i = 0; i < size; ++i) {
Preference p = g.getPreference(i);
if (p instanceof PreferenceGroup) {
PreferenceGroup pg = (PreferenceGroup)p;
pt.onPreferenceGroup(pg);
traversePreferences(pg, pt);
}
else
pt.onPreference(p);
}
}
private void readBack(Preference p) {
if (p == null)
return;
//System.out.println("pref: " + p.toString());
if (p instanceof EditTextPreference) {
EditTextPreference e = (EditTextPreference) p;
p.setSummary("'" + e.getText() + "'");
}
}
//@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
Preference p = findPreference(key);
_validator.validate(sharedPreferences, key);
if (p instanceof EditTextPreference) {
EditTextPreference e = (EditTextPreference) p;
Editor editor = sharedPreferences.edit();
String s = e.getText();
String sanitized = EditTextAscii.sanitize(s).trim();
if (key.equals(Multiplayer_Username) && sanitized == null || sanitized.length() == 0) {
sanitized = previousName;
if (sanitized == null || sanitized.equals("")) {
sanitized = "Steve";
previousName = sanitized;
}
}
if (!s.equals(sanitized)) {
editor.putString(key, sanitized);
editor.commit();
e.setText(sanitized);
}
}
readBack(p);
}
String previousName;
PreferenceValidator _validator;
}
class PreferenceValidator {
static private class Pref {
Pref(PreferenceGroup g, Preference p) {
this.g = g;
this.p = p;
}
PreferenceGroup g;
Preference p;
}
private PreferenceActivity _prefs;
private ArrayList<Pref> _arrayList = new ArrayList<Pref>();
public PreferenceValidator(PreferenceActivity prefs) {
_prefs = prefs;
}
public void commit() {
//System.err.println("ERR: " + _arrayList.size());
for (int i = 0; i < _arrayList.size(); ++i) {
PreferenceGroup g = _arrayList.get(i).g;
Preference p = _arrayList.get(i).p;
g.removePreference(p);
}
}
public void validate(Preference p) {
validate(PreferenceManager.getDefaultSharedPreferences(_prefs), p.getKey());
}
public void validate(SharedPreferences preferences, String key) {
Preference p = findPreference(key);
if (p instanceof CheckBoxPreference) {
//CheckBoxPreference e = (CheckBoxPreference) p;
if (key.equals(MainMenuOptionsActivity.Graphics_LowQuality)) {
boolean isShort = preferences.getBoolean(MainMenuOptionsActivity.Graphics_LowQuality, false);
CheckBoxPreference fancyPref = (CheckBoxPreference)findPreference(MainMenuOptionsActivity.Graphics_Fancy);
if (fancyPref != null) {
fancyPref.setEnabled(isShort == false);
if (isShort)
fancyPref.setChecked(false);
}
}
if (key.equals(MainMenuOptionsActivity.Graphics_Fancy)) {
CheckBoxPreference fancyPref = (CheckBoxPreference) p;
//System.err.println("Is PowerVR? : " + MainActivity.isPowerVR());
if (MainActivity.isPowerVR()) {
fancyPref.setSummary("Experimental on this device!");
}
}
if (p.getKey().equals(MainMenuOptionsActivity.Controls_UseTouchscreen)) {
boolean hasOtherPrimaryControls = MainActivity.isXperiaPlay();
if (!hasOtherPrimaryControls) {
PreferenceCategory mCategory = (PreferenceCategory) findPreference("category_graphics");
_arrayList.add(new Pref(mCategory, p));
}
p.setEnabled(hasOtherPrimaryControls);
p.setDefaultValue( !hasOtherPrimaryControls );
if (hasOtherPrimaryControls) {
CheckBoxPreference pp = (CheckBoxPreference) p;
CheckBoxPreference j = (CheckBoxPreference)findPreference(MainMenuOptionsActivity.Controls_UseTouchJoypad);
j.setEnabled(pp.isChecked());
}
}
}
}
private Preference findPreference(String key) {
return _prefs.findPreference(key);
}
}
abstract class PreferenceTraverser {
void onPreference(Preference p) {}
void onPreferenceGroup(PreferenceGroup p) {}
}

View File

@@ -1,14 +1,14 @@
package com.mojang.minecraftpe;
import android.content.Intent;
import android.net.Uri;
import com.mojang.minecraftpe.MainActivity;
public class Minecraft_Market extends MainActivity {
@Override
public void buyGame() {
final Uri buyLink = Uri.parse("market://details?id=com.mojang.minecraftpe");
Intent marketIntent = new Intent( Intent.ACTION_VIEW, buyLink );
startActivity(marketIntent);
}
}
package com.mojang.minecraftpe;
import android.content.Intent;
import android.net.Uri;
import com.mojang.minecraftpe.MainActivity;
public class Minecraft_Market extends MainActivity {
@Override
public void buyGame() {
final Uri buyLink = Uri.parse("market://details?id=com.mojang.minecraftpe");
Intent marketIntent = new Intent( Intent.ACTION_VIEW, buyLink );
startActivity(marketIntent);
}
}

View File

@@ -1,17 +1,17 @@
package com.mojang.minecraftpe;
import android.content.Intent;
import android.net.Uri;
import com.mojang.android.licensing.LicenseCodes;
public class Minecraft_Market_Demo extends MainActivity {
@Override
public void buyGame() {
final Uri buyLink = Uri.parse("market://details?id=com.mojang.minecraftpe");
Intent marketIntent = new Intent( Intent.ACTION_VIEW, buyLink );
startActivity(marketIntent);
}
@Override
protected boolean isDemo() { return true; }
}
package com.mojang.minecraftpe;
import android.content.Intent;
import android.net.Uri;
import com.mojang.android.licensing.LicenseCodes;
public class Minecraft_Market_Demo extends MainActivity {
@Override
public void buyGame() {
final Uri buyLink = Uri.parse("market://details?id=com.mojang.minecraftpe");
Intent marketIntent = new Intent( Intent.ACTION_VIEW, buyLink );
startActivity(marketIntent);
}
@Override
protected boolean isDemo() { return true; }
}

View File

@@ -1,89 +1,89 @@
package com.mojang.minecraftpe;
import android.os.Bundle;
import com.mojang.android.licensing.LicenseCodes;
import com.verizon.vcast.apps.LicenseAuthenticator;
public class Minecraft_Verizon extends MainActivity {
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
_licenseLib = new LicenseAuthenticator(this);
_verizonThread = new VerizonLicenseThread(_licenseLib, VCastMarketKeyword, false);
_verizonThread.start();
}
@Override
public int checkLicense() {
if (_verizonThread == null)
return _licenseCode;
if (!_verizonThread.hasCode)
return -1;
_licenseCode = _verizonThread.returnCode;
_verizonThread = null;
return _licenseCode;
}
@Override
public boolean hasBuyButtonWhenInvalidLicense() { return false; }
private LicenseAuthenticator _licenseLib;
private VerizonLicenseThread _verizonThread;
private int _licenseCode;
static private final String VCastMarketKeyword = "Minecraft";
}
//
// Requests license code from the Verizon VCAST application on the phone
//
class VerizonLicenseThread extends Thread
{
public VerizonLicenseThread(LicenseAuthenticator licenseLib, String keyword, boolean isTest) {
_keyword = keyword;
_isTest = isTest;
_licenseLib = licenseLib;
}
public void run() {
if (_isTest)
validateTestLicense();
else
validateLicense();
}
void validateTestLicense() {
try {
//final int status = LicenseAuthenticator.LICENSE_NOT_FOUND;
final int status = LicenseAuthenticator.LICENSE_OK;
returnCode = _licenseLib.checkTestLicense( _keyword, status );
}
catch (Throwable e) {
returnCode = LicenseCodes.LICENSE_CHECK_EXCEPTION;
}
hasCode = true;
}
void validateLicense() {
try {
returnCode = _licenseLib.checkLicense( _keyword );
}
catch (Throwable e) {
returnCode = LicenseCodes.LICENSE_CHECK_EXCEPTION;
//e.printStackTrace();
}
hasCode = true;
}
public volatile boolean hasCode = false;
public volatile int returnCode = -1;
private String _keyword;
private boolean _isTest;
private LicenseAuthenticator _licenseLib;
}
package com.mojang.minecraftpe;
import android.os.Bundle;
import com.mojang.android.licensing.LicenseCodes;
import com.verizon.vcast.apps.LicenseAuthenticator;
public class Minecraft_Verizon extends MainActivity {
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
_licenseLib = new LicenseAuthenticator(this);
_verizonThread = new VerizonLicenseThread(_licenseLib, VCastMarketKeyword, false);
_verizonThread.start();
}
@Override
public int checkLicense() {
if (_verizonThread == null)
return _licenseCode;
if (!_verizonThread.hasCode)
return -1;
_licenseCode = _verizonThread.returnCode;
_verizonThread = null;
return _licenseCode;
}
@Override
public boolean hasBuyButtonWhenInvalidLicense() { return false; }
private LicenseAuthenticator _licenseLib;
private VerizonLicenseThread _verizonThread;
private int _licenseCode;
static private final String VCastMarketKeyword = "Minecraft";
}
//
// Requests license code from the Verizon VCAST application on the phone
//
class VerizonLicenseThread extends Thread
{
public VerizonLicenseThread(LicenseAuthenticator licenseLib, String keyword, boolean isTest) {
_keyword = keyword;
_isTest = isTest;
_licenseLib = licenseLib;
}
public void run() {
if (_isTest)
validateTestLicense();
else
validateLicense();
}
void validateTestLicense() {
try {
//final int status = LicenseAuthenticator.LICENSE_NOT_FOUND;
final int status = LicenseAuthenticator.LICENSE_OK;
returnCode = _licenseLib.checkTestLicense( _keyword, status );
}
catch (Throwable e) {
returnCode = LicenseCodes.LICENSE_CHECK_EXCEPTION;
}
hasCode = true;
}
void validateLicense() {
try {
returnCode = _licenseLib.checkLicense( _keyword );
}
catch (Throwable e) {
returnCode = LicenseCodes.LICENSE_CHECK_EXCEPTION;
//e.printStackTrace();
}
hasCode = true;
}
public volatile boolean hasCode = false;
public volatile int returnCode = -1;
private String _keyword;
private boolean _isTest;
private LicenseAuthenticator _licenseLib;
}